[php-src] Issue #23575: Dom\HTMLDocument: prototype.js like DOM-Traversal
| From: | codemasher | Date: | Fri, 04 Sep 2026 22:33:27 +0000 |
| Subject: | [php-src] Issue #23575: Dom\HTMLDocument: prototype.js like DOM-Traversal | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-252703@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/23575
Author: codemasher
### Description
Hi,
I just started diving into the new DOM features that came with PHP 8.4, and wondered if it's
possible (and/or in the focus of
HTMLDocument) to add some of [Prototype's
DOM](https://github.com/prototypejs/prototype/blob/master/src/prototype/dom/dom.js)
[traversal](https://web.archive.org/web/20250815181227/http://api.prototypejs.org/dom/Element/index.html)
and [enumerable](https://web.archive.org/web/20250815065630/http://api.prototypejs.org/language/Enumerable/index.html)
features. Prototype may may vanished from the web, but it's intuitive traversal methods are to
this day unmatched and made working on a HTML tree a breeze.
I've [implemented this in PHP before](https://github.com/chillerlan/php-prototype-dom), but it
was a pain fighting against the quirks of DOMDocument, XML and the countless
DOMNode subclasses, it felt very messy to begin with.
Now before I attempt to implement this again in userland with HTMLDocument: is there
any chance to even consider such features, or is this out of focus?