Page MenuHomePhabricator

Selser is broken in the needsOldDom case when opts.from === "pagebundle"
Open, MediumPublic

Description

(See the discussion in https://gerrit.wikimedia.org/r/#/c/311626/)

https://github.com/wikimedia/parsoid/blob/master/lib/utils/DOMUtils.js#L2678-L2693

mw ids aren't added to the dom which results in a lot of dirty diffs (ids aren't ignored when domdiff'ing).

Ignoring ids with a specialized attribute handler doesn't seem like a good solution.

We can add the ids by setting env.pageBundle = true;, but this is always going to be a best-faith effort when regenerating the dom (subbu's words). This is equally true in the opts.from === "html" case.

What to do? what to do? Should we drop this "feature" or fix the pagebundle path to work like html.

Event Timeline

Arlolra triaged this task as Medium priority.Sep 20 2016, 6:50 PM

Ignoring ids with a specialized attribute handler doesn't seem like a good solution.

Not sure why I wrote that but, on the contrary, it does seem like it would be ok.

We can add the ids by setting env.pageBundle = true;, but this is always going to be a best-faith effort when regenerating the dom (subbu's words). This is equally true in the opts.from === "html" case.

This was probably all before we did the analysis in,
https://github.com/wikimedia/parsoid/blob/master/src/Core/WikitextContentModelHandler.php#L24-L58

In practice, RESTBase sends us the old DOM in the "pagebundle" case and we generate the DOM more often in the "html" case.

Also, needsOldDom is now just this condition $selserData->oldHTML === null,
https://github.com/wikimedia/parsoid/blob/master/src/Core/WikitextContentModelHandler.php#L59

Arlolra claimed this task.