Page MenuHomePhabricator

Update html5 package from upstream.
Closed, ResolvedPublic

Description

We should resync our forked html5 parser package with upstream (https://github.com/aredridel/html5). We've made changes of two types:

  1. changes to allow us to pass in our tokens directly
  2. changes to support using domino instead of jsdom.

2b) changes to support using DOM4 instead of DOM3 (because domino only supports DOM4 methods)

It looks like upstream has landed changes to support DOM4 now, so the changes needed upstream to support domino might be very trivial. https://github.com/aredridel/html5/blob/master/lib/html5/parser.js#L2374 has to be changed to allow using domino instead of jsdom, based on options (see https://gerrit.wikimedia.org/r/#/c/49953/3/js/lib/html5/parser.js). domino also doesn't support direct array access to attributes, so a few .item() accessor methods might need to be added, similar to https://gerrit.wikimedia.org/r/49838.


Version: unspecified
Severity: normal

Details

Reference
bz47323

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:44 AM
bzimport added a project: Parsoid-DOM.
bzimport set Reference to bz47323.
cscott created this task.Apr 17 2013, 5:10 PM

Gwicke mentions that we have some foster parenting bugs, so hopefully resyncing with upstream will fix those. Upstream also has some issues with node 0.10 (https://github.com/aredridel/html5/issues/73); hopefully we'll inherit fixes for those (depending on when we resync).

See also https://gerrit.wikimedia.org/r/59509 which is a console.log we'd like to turn off upstream.

https://github.com/aredridel/html5/blob/master/lib/html5/parser.js#L2374 is just the default document which does not necessarily need to be changed. Passing in a domino document should work fine and will avoid using jsdom.

Change 79442 had a related patch set uploaded by Arlolra:
WIP: Update html5 package from upstream.

https://gerrit.wikimedia.org/r/79442

Change 79442 merged by jenkins-bot:
Update html5 package from upstream.

https://gerrit.wikimedia.org/r/79442