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

       Web browser: ---
            Bug ID: 48231
           Summary: findBuilderCorrectedTags runs even in editMode and
                    inserts meta placeholders in foster-parent position,
                    which creates dirty diffs
           Product: Parsoid
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: JS/DOM
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Those meta placeholders are foster-parented out on the client, which triggers a
DOM diff and throws off selser with the out-of-order dsr value.

In edit mode, we should probably not be inserting information like this at all.
So maybe don't run findBuilderCorrectedTags in edit mode and instead replace it
with a pass that simply strips the related meta tags? We might also be able to
avoid inserting those metas altogether in meta mode.

Minimal test case extracted from
http://en.wikipedia.org/wiki/Indo-Pakistani_War_of_1965:

echo -ne '{{col-begin}}\n{{col-3}}\nfoo' | node parse
<body data-parsoid='{"dsr":[0,27,0,0]}'><span about="#mwt1"
typeof="mw:Object/Template"
data-mw='{"parts":[{"template":{"target":{"wt":"col-begin"},"params":{}}},"\n",{"template":{"target":{"wt":"col-3"},"params":{}}},"\nfoo"]}'
data-parsoid='{"tsr":[0,13],"src":"{{col-begin}}\n{{col-3}}\nfoo","dsr":[0,27,null,null]}'>
</span><p data-parsoid='{"stx":"html"}' about="#mwt1"></p><table class="
multicol" style="border-collapse: collapse; padding: 0px; border: 0px;
background:transparent; width:100%;" about="#mwt1"
data-parsoid='{"dsr":[null,27,2,2]}'>
<meta typeof="mw:Placeholder"
data-parsoid='{"tsr":[14,23],"src":"{{col-3}}","dsr":[14,23,null,null]}'>
<tbody data-parsoid='{"dsr":[null,25,0,0]}'><tr
data-parsoid='{"dsr":[null,25,0,0]}'><td style="width: 33.33%;" align="left"
valign="top" data-parsoid='{"dsr":[null,25,null,0]}'>
<p data-parsoid='{"dsr":[24,25,0,0]}'>foo</p></td></tr></tbody></table></body>

-- 
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