Page MenuHomePhabricator

TemplateStyles not applied when loading VE/NWE
Open, Needs TriagePublic

Description

As suggested in T212085, here a new task for this problem.

I was wondering if TemplateStyles could be applied also while loading the VE/NWE (those approx. 2 seconds after clicking the edit button). It is confusing, to say the least, seeing the page broken, even if it is only for a few seconds.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 4 2020, 8:19 PM
Restricted Application added a project: VisualEditor. · View Herald TranscriptJun 4 2020, 10:47 PM

I think this is caused by how we "disable" the existing style tags on the page when loading the editor (we do this so that the styles no longer apply if you remove the template that adds them in the editor).

Video for reference – note how the styling of the quote box in bottom-left flickers while the editor is loading, and then again while it is closing:
(recorded on https://en.wikipedia.org/wiki/Animism#Theories)

We probably disable/enable the styles at the wrong time during the editor setup/teardown.

Change 602724 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Toggle TemplateStyles at a better time during (de)activation to avoid flashing

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

matmarex moved this task from To Triage to Triaged on the VisualEditor board.Jun 10 2020, 7:10 PM

Change 602724 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Toggle TemplateStyles at a better time during (de)activation to avoid flashing

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

matmarex edited projects, added Skipped QA; removed Editing QA.Wed, Sep 16, 6:28 PM

I can confirm that this works correctly now, testing on the same page as before (https://en.wikipedia.org/wiki/Animism#Old_animism) and looking at the quote box:

Before (T254518#6196300)After