History log of /PHP-8.2/ext/dom/node.c (Results 1 – 25 of 197)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1890d47c 11-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix missing deref in C14N (#14203)

Follow-up for 30a0b0359ed8338c0e3acd1682de3cf96429e898, which didn't fix
all places. This is the last remaining place.


# 30a0b035 30-Apr-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix references not handled correctly in C14N

Closes GH-14090.


# e3711af8 09-Mar-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Add ZPP checks in DOMNode::{__sleep,__wakeup}

Closes GH-13651.


# 93951cf5 24-Dec-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-13012: DOMNode::isEqualNode() is incorrect when attribute order is different

Attributes (and namespace declarations) have to be compared in an
unordered way.

Closes GH-13

Fix GH-13012: DOMNode::isEqualNode() is incorrect when attribute order is different

Attributes (and namespace declarations) have to be compared in an
unordered way.

Closes GH-13017.

show more ...


# 9c306470 04-Dec-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Handle libxml2 OOM more consistently (#11927)

This is a continuation of commit c2a58ab07d, in which several OOM error
handling was converted to throwing an INVALID_STATE_ERR DOMException

Handle libxml2 OOM more consistently (#11927)

This is a continuation of commit c2a58ab07d, in which several OOM error
handling was converted to throwing an INVALID_STATE_ERR DOMException.
Some places were missed and they still returned false without an
exception, or threw a PHP_ERR DOMException.
Convert all of these to INVALID_STATE_ERR DOMExceptions. This also
reduces confusion of users going through documentation [1].

Unfortunately, not all node creations are checked for a NULL pointer.
Some places therefore will not do anything if an OOM occurs (well,
except crash).
On the one hand it's nice to handle these OOM cases.
On the other hand, this adds some complexity and it's very unlikely to
happen in the real world. But then again, "unlikely" situations have
caused trouble before. Ideally all cases should be checked.

[1] https://github.com/php/doc-en/issues/1741

show more ...


# acbdfd24 24-Nov-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix DOMElement->prefix with empty string creates bogus prefix

Closes GH-12770.


# 1492be52 13-Nov-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

[RFC] DOM HTML5 parsing and serialization support (#12111)


# bb42b418 04-Nov-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Cleanup arguments of _php_dom_insert_fragment() (#12610)


# 3e33eda3 28-Oct-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix cloning attribute with namespace disappearing namespace

Closes GH-12547.


# eebc528c 01-Oct-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix broken cache invalidation with deallocated and reallocated document node

The original caching implementation had an oversight in combination with
the new lifetime management in DOM f

Fix broken cache invalidation with deallocated and reallocated document node

The original caching implementation had an oversight in combination with
the new lifetime management in DOM for 8.3.
The modification counter is stored on the document object itself, but as
that can get deallocated when all references disappear, stale cache data
can be used. Normally this isn't a problem, unless getElementsByTagName is
called not on the document but on a child node. Fix it by moving caching
data into the ref object, which will outlive all nodes from a document
even if the document object disappears.

Closes GH-12338.

show more ...


# 12790b2b 24-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Extend C14N fast path to HTML documents too (#12293)


# 554f6596 22-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Remove unnecessary invalidation


# 5d68d619 22-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement #53655: Improve speed of DOMNode::C14N() on large XML documents

The XPath query is in accordance to spec [1]. However, we can do it in a
simpler way. We can use a custom callba

Implement #53655: Improve speed of DOMNode::C14N() on large XML documents

The XPath query is in accordance to spec [1]. However, we can do it in a
simpler way. We can use a custom callback function instead of a linear
search in XPath to check if a node is visible. Note that comment nodes
are handled internally by libxml2 already, so we do not need to
differentiate between node types. The callback will do an upwards
traversal of the tree until the root of the canonicalization is reached.
In practice this will speed up the application a lot.

[1] https://www.w3.org/TR/2001/REC-xml-c14n-20010315 section 2.1

Closes GH-12278.

show more ...


# 0ea268b5 09-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Remove obsolete libxml2 code

LIBXML2_NEW_BUFFER is always defined since libxml2 2.9.0.
That's the minimum version PHP requires, so it will always be defined.


# 880faa39 08-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Add DOMNode::compareDocumentPosition() (#12146)

Reference: https://dom.spec.whatwg.org/#dom-node-comparedocumentposition


# 48443183 02-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Use zend_result as return for properties in ext/dom (#12113)


# c0ce3e7e 18-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Get rid of some unnecessary string conversion (#11733)

For typed properties that are of type "string", we don't need to do any
conversion as the zval will already be a string. Removing t

Get rid of some unnecessary string conversion (#11733)

For typed properties that are of type "string", we don't need to do any
conversion as the zval will already be a string. Removing this
simplifies code and avoids unnecessary refcounting.

show more ...


# 2f318cfb 12-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement DOMNode::isEqualNode()

Since we still support obsoleted nodes in our implementation, this uses
the old spec to match the old nodes; and this uses the new spec for
nodes sti

Implement DOMNode::isEqualNode()

Since we still support obsoleted nodes in our implementation, this uses
the old spec to match the old nodes; and this uses the new spec for
nodes still defined in the living spec.
When unclear, the behaviour was cross-verified with Firefox.

References:
https://dom.spec.whatwg.org/#dom-node-isequalnode (for everything still in the living spec)
https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/DOM3-Core.html#core-Node3-isEqualNode (for old nodes removed from the living spec)

Closes GH-11690.

show more ...


# c97507b5 17-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix build on Windows


# d04f48b6 11-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement DOMNode::parentElement and DOMNameSpaceNode::parentElement

ref: https://dom.spec.whatwg.org/#parent-element

Closes GH-11679.


# d38cc9b9 11-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement DOMNode::isConnected and DOMNameSpaceNode::isConnected

ref: https://dom.spec.whatwg.org/#dom-node-isconnected

Closes GH-11677.


# d17069e1 12-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement DOMNode::getRootNode()

ref: https://dom.spec.whatwg.org/#dom-node-getrootnode

Closes GH-11693.


# b3899eb5 12-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Refactor dom_node_node_name_read() to avoid double allocation

We will use this helper later outside of the node name read handler.


# ea794e9c 11-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement DOMNode::contains()

ref: https://dom.spec.whatwg.org/#dom-node-contains


# 941a7e59 26-Jun-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Avoid allocation when getting the node content, if possible

Closes GH-11543.


12345678