Page MenuHomePhabricator

Font and font-sizes broken in VE
Closed, ResolvedPublic

Description

Such as on
https://en.wikipedia.beta.wmflabs.org/wiki/Benjamin_Kowalewicz?veaction=edit

image.png (430×469 px, 65 KB)

Should look like read mode:

image.png (469×421 px, 55 KB)


Ref T279388: ResourceLoaderSkinModule: Improve the content-parser-output module

Places to check:

  • Main VE surface
  • TargetWidgets, such as in the media dialog
    • ve.ui.MWTargetWidget adds the mw-body-content class
  • ContentTranslation
    • ve.init.mw.CXTarget adds the mw-body-content class
  • Preview within 2017WTE
    • ve.ui.MWSaveDialog adds the mw-body-content class
  • Reference previews inside VE reference context popups
    • ve.ui.MWPreviewElement adds the mw-body-content class
  • Visual diffs (both within VE, and on the history page)
    • Within VE
      • ve.ui.MWSaveDialog adds the mw-body-content class
    • History page
      • Content is already appended inside the mw-body-content wrapper
  • DiscussionTools' Reply Tool (and new topic tool, but should be the same)
  • GrowthExperiments link suggestion tool (cc @kostajh, @mewoph)

Event Timeline

Esanders triaged this task as Unbreak Now! priority.May 17 2021, 2:38 PM

Looks like this was caused by https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/682774

I would imagine such a significant change may have broken other things.

CC @Jdlrobson @Krinkle

Change 692074 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/skins/Vector@master] Revert "Remove mw-body-content from HTML that is not the article body"

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

There was a series of changes related to that class in multiple skins, other commits might need reverting or fixing too: https://gerrit.wikimedia.org/r/q/message:mw-body-content

Other places that could be affected by these changes:

  • ContentTranslation
  • Preview within 2017WTE
  • Reference previews inside VE reference context popups
  • Visual diffs (both within VE, and on the history page)

Should this block the train tomorrow?

I think so, yes [i]. Thank you for raising this option, James.


i. This issue upends, what I consider to be, an important "promise" of VE: people having a [close to] 1:1 mapping between reading and editing modes.

Change 692358 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[VisualEditor/VisualEditor@master] Add mw-body-content to .ve-ui-surface

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

Test wiki created on Patch Demo by ESanders (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/4555942430/w/

Change 692361 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/VisualEditor@master] Add mw-body-content to surface element

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

Test wiki on Patch Demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/4555942430/w/

Test wiki created on Patch Demo by ESanders (WMF) using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/38c4a7e1dd/w/

DiscussionTools reply widget is broken by the patch that adds mw-body-content to MW surfaces unconditionally, as the widget was already within the mw-body-content, so the font-size: 0.875em rule is applied twice.

Conceptually the mw-body-content class should be added by the target class (ve.init.mw.DesktopArticleTarget/MobileArticleTarget, or just ArticleTarget if it applies to both) as that class is responsible for the integration of the surface into the context of the page.

Test wiki created on Patch Demo by Jdlrobson using patch(es) linked to this task:

https://patchdemo.wmflabs.org/wikis/b2467b1736/w/

Change 692358 abandoned by Esanders:

[VisualEditor/VisualEditor@master] Add mw-body-content to .ve-ui-surface

Reason:

See I4833d1ca9fda4fc0bd433760e47fe7010f00db05

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

Change 692361 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Add mw-body-content to surface element

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

Jdlrobson lowered the priority of this task from Unbreak Now! to Needs Triage.EditedMay 17 2021, 7:30 PM

Just to summarize the problem: Various extensions were trying to mimic the HTML markup of the content which was previously inconsistent across skins (notably Minerva).

In the VisualEditor case, Previously #bodyContent had the class mw-body-content. Now it doesn't. VisualEditor creates a sibling element designed to mimic #bodyContent but because the class is missing Vector wasn't styling it correctly. The style has now been added.

Big kudos to @Esanders for identifying the issue and testing various other places which follow this pattern.

Note, going forward, if this is a common need of extensions it may be useful to have an mw.util.bodyContent utility function to provide a more safe way of doing this in future but I leave that conversation for another time.

We'll (web) keep this open to assess impact anywhere else.

Adding a note: the Growth experiment link suggestion tool is not currently deployed to any wikis, although it is expected to go out within the next week. Setting the priority as high to allow for quick QA and triage of any other issues potentially found related to this bug. If we find anything that does not affect the main namespace or the list in the task description we can consider this normal or high priority for the time being (vs UBN)

Test wiki on Patch Demo by Jdlrobson using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/b2467b1736/w/

Test wiki on Patch Demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/38c4a7e1dd/w/

Change 692074 abandoned by Jdlrobson:

[mediawiki/skins/Vector@master] Partial Revert "Remove mw-body-content from HTML that is not the article body"

Reason:

fixed by other means

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

ovasileva updated the task description. (Show Details)

All done, resolving!