@jlinehan started working on T217867: Port domino (or another spec-compliant DOM library) to PHP and has a first cut version ready.
This is a tracker task to outline the tasks to complete that port and integration. Subtasks will cover those different pieces.
The porting will be bounded by the following constraints (similar to domino.js)
- We will only target the latest DOM spec (DOM4), not any of the deprecated legacy methods.
- We will not support dynamic script loading, and document.write functionality. The library will be "secure" -- setting the src element on an <img> tag won't trigger network traffic and resource loading, etc.
- We will not support all events (see above re onload etc). We *may* support *some* events, eg document mutation events, which are relevant.
- Given the limited functionality we are targeting as above, full W3C spec test suite compliance not a goal. But, Domino test suite compliance is a goal. Subtasks will specify the exact test suites and degree of test compliance expected.
Ideally the set of methods implemented will be a (bug-fixed) superset of PHP's libxml binding, to facilitate migration (T271728). But PHP's binding includes some deprecated methods (getAttributeNode etc) which we needn't port over.
In the end, for use within the Wikimedia Foundation, this DOM library's use will be bounded by how libxml + PHP-DOM are used. So, as a rule of thumb, when making prioritization choices about what to implement and what to leave out, leave out anything that is not essential for the first-cut replacement of libxml + PHP-DOM combo.
Milestones & priority
The following are the top level milestones, in priority order