History log of /PHP-8.2/ext/dom/element.c (Results 1 – 25 of 163)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# ab508c98 05-Feb-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix unlikely memory leak in case of namespace removal with extremely deep trees


# 89ea24f6 13-Jan-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Give anonymous dom structs a name (#13135)


# b2d778c3 22-Dec-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix crash when toggleAttribute() is used without a document


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

Fix cloning attribute with namespace disappearing namespace

Closes GH-12547.


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

Fix #47531: No way of removing redundant xmlns: declarations

Now it's possible via removeAttribute("xmlns:prefix").
It was not possible to reuse a libxml2 function to reconcile because i

Fix #47531: No way of removing redundant xmlns: declarations

Now it's possible via removeAttribute("xmlns:prefix").
It was not possible to reuse a libxml2 function to reconcile because it
does not align with DOM behaviour.

Closes GH-12542.

show more ...


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

Replace always-false attribute type check with assertion

The type will always be XML_ATTRIBUTE_NODE by construction via
php_dom_create_object, no need to check the type. Use an assertion

Replace always-false attribute type check with assertion

The type will always be XML_ATTRIBUTE_NODE by construction via
php_dom_create_object, no need to check the type. Use an assertion
instead. This simplifies code and reasoning about error conditions.

show more ...


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

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


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

Fix various namespace prefix conflict resolution bugs and namespace shift bugs

There are two linked issues:

- Conflicts couldn't be resolved by changing the prefix name.
- Lacki

Fix various namespace prefix conflict resolution bugs and namespace shift bugs

There are two linked issues:

- Conflicts couldn't be resolved by changing the prefix name.
- Lacking a prefix would shift the namespace as the default namespace,
causing elements to suddenly become part of the namespace instead of
the attributes.

The output could still be improved by removing redundant namespace
declarations, but that's another issue. At least the output is
correct now.

Closes GH-11777.

show more ...


# bb092ab4 06-Aug-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix #80927: Removing documentElement after creating attribute node: possible use-after-free

Closes GH-11892.


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

Remove useless readonly checks

These checks will always be false because we're dealing with elements
here. DOMElement always are of type XML_ELEMENT_NODE, so they don't need
to be ch

Remove useless readonly checks

These checks will always be false because we're dealing with elements
here. DOMElement always are of type XML_ELEMENT_NODE, so they don't need
to be checked.

show more ...


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

Use xmlSetNsProp when possible to prevent parsing the name

The normal xmlSetProp() function parses the name to find the namespace.
But we don't care about the namespace in this case.


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

Implement DOMElement::toggleAttribute()

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

Closes GH-11696.


# 5b5a3d79 13-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Split off some methods so they can be reused in different places


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

Implement DOMElement::insertAdjacent{Element,Text} (#11700)

* Implement DOMElement::insertAdjacent{Element,Text}

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

Implement DOMElement::insertAdjacent{Element,Text} (#11700)

* Implement DOMElement::insertAdjacent{Element,Text}

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

Closes GH-11700.

show more ...


# 72e2e250 13-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement DOMElement::id

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

Closes GH-11701.


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

Fix ?


# 6560c9bf 13-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement DOMParentNode::replaceChildren()

ref: https://dom.spec.whatwg.org/#dom-parentnode-replacechildren


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

Implement DOMElement::className

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

Closes GH-11691.


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

Implement DOMElement::getAttributeNames()

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


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

Avoid allocations in DOMElement::getAttribute()


# 9880c336 13-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Avoid string allocation in dom_get_dom1_attribute() for as long as possible


# 87e7b61d 02-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Cleanup macro usage in ext/dom and ext/libxml

With the new lifetime system in place, we can simplify some macros.


# a7202682 05-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Use uint32_t for the number of nodes (#11371)


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

Implement iteration cache, item cache and length cache for node list iteration (#11330)

* Implement iteration cache, item cache and length cache for node list iteration

The current

Implement iteration cache, item cache and length cache for node list iteration (#11330)

* Implement iteration cache, item cache and length cache for node list iteration

The current implementation follows the spec requirement that the list
must be "live". This means that changes in the document must be
reflected in the existing node lists without requiring the user to
refetch the node list.
The consequence is that getting any item, or the length of the list,
always starts searching from the root element of the node list. This
results in O(n) time to get any item or the length. If there's a for
loop over the node list, this means the iterations will take O(n²) time
in total. This causes real-world performance issues with potential for
downtime (see GH-11308 and its references for details).

We fix this by introducing a caching strategy. We cache the last
iterated object in the iterator, the last requested item in the node
list, and the last length computation. To invalidate the cache, we
simply count the number of modifications made to the containing
document. If the modification number does not match what the number was
during caching, we know the document has been modified and the cache is
invalid. If this ever overflows, we saturate the modification number and
don't do any caching anymore. Note that we don't check for overflow on
64-bit systems because it would take hundreds of years to overflow.

Fixes GH-11308.

show more ...


# 3167d076 15-Nov-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-12616: DOM: Removing XMLNS namespace node results in invalid default: prefix

The namespace data is freed and set to NULL, but there remain references
to the namespace declaration

Fix GH-12616: DOM: Removing XMLNS namespace node results in invalid default: prefix

The namespace data is freed and set to NULL, but there remain references
to the namespace declaration nodes. This (rightfully) confuses libxml2
because its invariants are broken. We also have to remove all remaining
references from the subtree. This fixes the data corruption bug.

Closes GH-12681.

show more ...


1234567