Page MenuHomePhabricator

Integrate the DOM library with RemexHtml
Open, MediumPublic


Domino.js comes with both a tree builder as well as a DOM library. RemexHtml covers the tree builder piece and is in use in various Wikimedia codebases. It currently integrates with the PHP-DOM-libxml combo which we would need to replace with the new DOM library.

So, this task is to figure out the details involved in the integration with RemexHtml, write the code for it, and test it. This may necessitate adding configuration options in RemexHtml if it doesn't already exist to pick a DOM library (see T271728: Migration strategy from DOMDocument to Dodo).

Event Timeline

ssastry renamed this task from Integrate the DOM library with Remex to Integrate the DOM library with RemexHtml.Dec 2 2020, 5:11 PM
ssastry created this task.
ssastry triaged this task as Medium priority.Dec 2 2020, 5:58 PM

Basically there's one "builder" class in remex html; dodo could implement that to quickly get a tree builder. Alternatively, we could remove some explicit type casts (as I did for zest) to get a "universal" remex that would work with any some library as long as it was given an appropriate duck typed "DOMImplementation" class.

Change 660954 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/libs/RemexHtml@master] Allow use of third-party DOM implementations

Change 660954 merged by jenkins-bot:
[mediawiki/libs/RemexHtml@master] Allow use of third-party DOM implementations

Still to-do:

  • implement getters and setters for innerHTML and outerHTML using Remex.
  • implement DOM Parsing & serialization interfaces from IDLeDOM 0.5.0
  • implement PHP-specific Document::{load,loadXML,saveHTML,saveXML} methods (also defined in IDLeDOM 0.5.0)