The normalize_document algo that rewrites dom to deal with nested inline tags does not work in the presence of mw:StartTag and mw:EndTag meta-tags. The algo needs fixup to handle that. Plus, the reordered nodes also need their tsr and other attrs. patched up.
longest_linear_path function is one that checks for children.length > 1 -- and this check is not valid anymore. Look for other such checks and update.
Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=49873
https://bugzilla.wikimedia.org/show_bug.cgi?id=53208