Last modified: 2014-09-04 21:41:03 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 T72419, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70419 - DiffMarker meta nodes get in the way in the serializer
DiffMarker meta nodes get in the way in the serializer
Status: NEW
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Low enhancement
: ---
Assigned To: Parsoid Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-04 21:40 UTC by ssastry
Modified: 2014-09-04 21:41 UTC (History)
2 users (show)

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


Attachments

Description ssastry 2014-09-04 21:40:13 UTC
The serializer does a lot of checks against previous/next sibling and first/last child. The problem in selser-mode is that DOMDiff inserts mw:DiffMarker metas to signal places where the DOM has been modified compared to the original DOM. So, naive checks against previous/next sibling and first/last child will fail. In reality, those checks have to pretend as if the diff-marker metas don't exist. 

Currently, we do have helper functions that do these checks by ignoring them (previousNonDeletedSibling, etc). However, there are still places in the serializer where first/last child checks could be broken, and whenever new code is added to the serializer, we have to account for this fact.

An alternative way of encoding this diff information could be considered to prevent this ugliness and to guard against inadvertent errors introduced by our current style of recording diffs in the DOM. In the past, Gabriel and I have discussed on such solution where we introduce this diff-marker information in an attribute of the parent node. This attribute could record a diff flag for each of the children and would be queried wherever diff information is required.

However, doing this would be a fair bit of work and cleanup and hence is a non-trivial task. But, it could potentially be a useful cleanup. Recording it here so we consider this in our copious free time.

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


Navigation
Links