https://bugzilla.wikimedia.org/show_bug.cgi?id=70419

            Bug ID: 70419
           Summary: DiffMarker meta nodes get in the way in the serializer
           Product: Parsoid
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: Unprioritized
         Component: serializer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
       Web browser: ---
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to