Subramanya Sastry has submitted this change and it was merged.

Change subject: Add DOM diff and rework selective serializer
......................................................................


Add DOM diff and rework selective serializer

* Split out DOMDiff class, implemented basic DOM-based diffing that compares
  the original DOM for the revision with the DOM passed in for serialization.
  This will make Parsoid independent of change markers, so that selective
  serialization can be used with arbitrary clients. Since change markers are
  currently pretty coarse (never on inline elements for example), it should
  also improve selser range precision with the VE.

* DOM diff should finally fix the long-standing VE deletion bug (FIXME: bug
  number?)

* Add data-parsoid-diff information to the DOM that records after which
  revision a given element was changed last and the nature of the change. This
  information could in the future be used for an efficient 'git blame'
  implementation.

* Add change markers in the selective serializer based on the diff
  annotations.

* Killed separate SelserState object

* Prepared for simplified WTS callback scheme without newline buffering:
  Separate callback flags for unmodified source, separators and modified DOM
  subtrees. Assumption is that separators are passed in a single call from a
  DOM-based serializeSeparator(nodeA, nodeB, state) method in WTS or the like.

* Moved all page-related information into an env.page object (name, id, src,
  dom).

* Added a bunch of related utility methods in DOMUtils.

* There are still some regressions in plain selser mode (6006 down from 6820).
  Many seem to be related to trailing newlines.

* With trailing newline stripping in selser mode (part of this patch), selser
  test results are up to 7837

TODO:

- Better integrate with WTS / modify it to emit *all* (not just DSR gap based)
  separators separately
- Refine and test DOM diff algorithm
- get test results back up to the old state
- clean up

Change-Id: I69806740329a2094ab854577c3f20c7adc4db237
---
M cpp/contrib/netsurf/libhubbub
M js/api/ParserService.js
M js/lib/ext.core.ParserFunctions.js
M js/lib/ext.core.TemplateHandler.js
A js/lib/mediawiki.DOMDiff.js
M js/lib/mediawiki.DOMPostProcessor.js
M js/lib/mediawiki.DOMUtils.js
M js/lib/mediawiki.HTML5TreeBuilder.node.js
M js/lib/mediawiki.SelectiveSerializer.js
M js/lib/mediawiki.Title.js
M js/lib/mediawiki.Util.js
M js/lib/mediawiki.WikitextSerializer.js
M js/lib/mediawiki.parser.environment.js
M js/tests/parse.js
M js/tests/parserTests.js
M js/tests/roundtrip-test.js
16 files changed, 738 insertions(+), 457 deletions(-)

Approvals:
  Subramanya Sastry: Verified; Looks good to me, approved
  jenkins-bot: Checked


--
To view, visit https://gerrit.wikimedia.org/r/41816
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I69806740329a2094ab854577c3f20c7adc4db237
Gerrit-PatchSet: 18
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to