Last modified: 2013-08-27 17:32:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T55410, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53410 - Don't modify the document after passing it to callbacks in mediawiki.HTML5TreeBuilder.node.js
Don't modify the document after passing it to callbacks in mediawiki.HTML5Tre...
Status: NEW
Product: Parsoid
Classification: Unclassified
DOM (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-27 17:29 UTC by Gabriel Wicke
Modified: 2013-08-27 17:32 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gabriel Wicke 2013-08-27 17:29:44 UTC
When we process a document to HTML DOM, the document that is passed to callbacks is eventually modified in mediawiki.HTML5TreeBuilder.node.js when the pipeline is reused for another parse. This is unexpected behavior, so should really be fixed.

The main reason for this is that there seems to be no efficient way to re-initialize an existing HTML5 parser with a new document. Creating a new HTML5 parser would work, but is (or at least was) quite expensive with a lot of work done in the constructor.

So we should probably:

1) measure how expensive it currently is to create a new HTML5 parser from scratch, and if that is too slow,

2) create a way to efficiently reset the HTML5 parser with a new document without clobbering the old one.

See also https://gerrit.wikimedia.org/r/#/c/81251/ for an earlier partial fix and bug 53407 for an example illustrating why modifying the document is a problem.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links