php / php/php-src

Dom\HTMLDocument: prototype.js like DOM-Traversal

Open
#23,575 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Extension: dom Feature Status: Requires RFC
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

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 traversal and enumerable features. Prototype may have vanished from the web, but its intuitive traversal methods are to this day unmatched and made working on a HTML tree a breeze.

I've implemented this in PHP before, 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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the HTMLDocument DOM features introduced in PHP 8.4 and compare the requested traversal and enumerable behavior with the linked Prototype APIs. Review the existing userland implementation in chillerlan/php-prototype-dom, then use the issue discussion to establish whether this belongs in HTMLDocument and what feature scope would count as done.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.