Page MenuHomePhabricator

ve.dm.Converter.static.renderHtmlAttributeList deep applying to handlesOwnChildren nodes causes errors
Closed, ResolvedPublic1 Story Points

Description

Create a page with the following wikitext:
[[Image:VisualEditor-logo.svg|thumb|Test <span style="background:red">store</span>]]

In VE, edit the caption to make 'Test' bold. Observe that your wikitext is now:

[[Image:VisualEditor-logo.svg|thumb|<b style="background:red">Test</b> <span style="background:red">store</span>]]

This is because renderHtmlAttributeList is using deep mode for handlesOwnChildren nodes (such as mw block images), and so is instructed to restore the attributes of originalElement.children[0] (the <span>) to targetElement.children[0] (the <b>).

Event Timeline

Esanders created this task.Mar 6 2018, 4:48 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 6 2018, 4:48 PM

Change 416726 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Fix node type check

https://gerrit.wikimedia.org/r/416726

Change 416731 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] WIP Failing test case for renderHtmlAttributeList

https://gerrit.wikimedia.org/r/416731

Esanders claimed this task.Mar 6 2018, 7:05 PM
Esanders edited projects, added VisualEditor (Current work); removed VisualEditor.

Change 416726 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Fix node type check

https://gerrit.wikimedia.org/r/416726

Change 416731 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Don't descend into dataElement-generated nodes in renderHtmlAttributeList

https://gerrit.wikimedia.org/r/416731

Change 417033 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (f46b51b83)

https://gerrit.wikimedia.org/r/417033

Change 417033 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (f46b51b83)

https://gerrit.wikimedia.org/r/417033

Deskana closed this task as Resolved.Mar 8 2018, 10:39 AM
Deskana set the point value for this task to 1.