Page MenuHomePhabricator

Footnote weirdness after editing the title parameter
Open, Needs TriagePublic

Description

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6

Details

Related Gerrit Patches:
mediawiki/extensions/VisualEditor : masterOnly preserve data-parsoid/RESTBase ID on transclusion nodes
mediawiki/extensions/VisualEditor : masterDon't preserveHtmlAttributes on transclusion nodes

Event Timeline

Josve05a created this task.Oct 17 2018, 8:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 17 2018, 8:11 PM
Tgr reopened this task as Open.Oct 18 2018, 3:28 PM
Tgr added a project: TemplateStyles.
Tgr added a subscriber: Tgr.

The mechanism of this error might be similar to T206527, but it's not going to be fixed by MCS patches (only apps use that API, VisualEditor doesn't) so reopening.

Izno added a subscriber: Izno.Oct 18 2018, 4:05 PM

It also looked like T187142: Deduplicate template styles in Parsoid which is linked in that task. Would it be fixed there?

bearND added a subscriber: bearND.EditedOct 19 2018, 2:38 PM

Deduplication would only fix it for subsequent occurrences of references with <cite> elements. The first one would still have the <style> element coming shortly after the <cite> element.
Having said that, I've tried three browsers but cannot reproduce this issue.

I can reproduce this 100% with Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6 (in e.g. this edit https://en.wikipedia.org/w/index.php?title=User:Josve05a/cite-sandbox&diff=864943011&oldid=864942991; by simply pressing Edit and changing the title parameter in the cite template).

JTannerWMF added subscribers: matmarex, JTannerWMF.

@matmarex will try to reproduce this

I had been hoping to find that this has been fixed by patches for TemplateStyles support a few months ago, but alas it hasn't. Instead I have reproduction steps:

  1. Follow the instructions on https://en.wikipedia.org/wiki/Category:CS1_maint:_Archived_copy_as_title to enable showing of CS1 maintenance messages:

Editors who wish to see all cs1|2 maintenance category messages can do so by updating either their common CSS page or their specific skin's CSS page (common.css and skin.css respectively) to include the following:

.citation-comment {display: inline !important;} /* show all Citation Style 1 error and maintenance messages */
  1. Visit a page that has such a maintenance message (for example, https://en.wikipedia.org/w/index.php?title=User:Josve05a/cite-sandbox&oldid=864942991) and edit it using VE
  2. Edit the citation template to resolve the problem and thus cause the maintenance message to disappear (in this example, change the "Title" parameter to something different than "Archived copy")

You end up with a bunch of CSS code being shown in place of the maintenance message, with the same styling (e.g. text color). Instead the message should just disappear.

It seems that VE copies attributes from the <span class="citation-comment" …> node (which is removed) to the <style data-mw-deduplicate="TemplateStyles:r861714446" …> node (following it), causing it to appear (it is normally invisible). I have not worked out how it happens.

matmarex assigned this task to Esanders.Dec 19 2018, 9:46 PM

I think this has something to do with ve.dm.Converter.static.renderHtmlAttributeList, and I think Ed understands that code better.

Esanders added a subscriber: Catrope.EditedJan 2 2019, 1:21 PM

Regression was caused by moving renderHtmlAttributeList to initialize unconditionally in https://gerrit.wikimedia.org/r/#/c/VisualEditor/VisualEditor/+/195238/ (by @Catrope). I think for GeneratedContentNodes, we don't need to call renderHtmlAttributeList when updating.

Actually this isn't an issue with CE rendering. CE generated content nodes already have renderHtmlAttributes set to false. This is a DM rendering created by PreviewElement, so we need to disable preserveHtmlAttributes as well.

Change 481894 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Don't preserveHtmlAttributes on transclusion nodes

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

Change 481894 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Don't preserveHtmlAttributes on transclusion nodes

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

marcella closed this task as Resolved.Jan 15 2019, 2:27 PM

Change 485024 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Don't preserve all HTML attributes on transclusion nodes

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

ggellerman moved this task from Up next to External on the TemplateStyles board.Jan 23 2019, 10:12 PM

With that patch, the issue is fixed for refs' context menus, but it is not fixed for reflists' CE renderings. We might need a similar patch in the Cite extension?