History log of /php-src/ext/dom/tests/bug77686.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# 0e34ac86 04-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix bug #77686: Removed elements are still returned by getElementById

From the moment an ID is created, libxml2's behaviour is to cache that element,
even if that element is not yet atta

Fix bug #77686: Removed elements are still returned by getElementById

From the moment an ID is created, libxml2's behaviour is to cache that element,
even if that element is not yet attached to the document. Similarly, only upon
destruction of the element the ID is actually removed by libxml2.
Since libxml2 has such behaviour deeply ingrained in the library, and uses the
cache for various purposes, it seems like a bad idea and lost cause to fight it.
Instead, we'll simply walk the tree upwards to check if the node is attached to
the document.

Closes GH-11369.

show more ...