Page MenuHomePhabricator

Active section is determined incorrectly when real active section is inside a wrapper
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

image.png (674×617 px, 75 KB)

What happens?:
"Beginning" is highlighted as active.

What should have happened instead?:
The current section should be highlighted as active.

There is a lot of cases when sections are wrapped in a tag (among them template documentations, archived discussions, sections with a different text direction). There is no way for such sections to get selected as active because of the bug.

Why it happens?
Because of the selector used for matching section headings: .mw-parser-output > ${tag}, not .mw-parser-output ${tag} (for example).

@Jdlrobson introduced this, arguing: "Headings can also appear in templates inside divs and subtitles. These do not get rendered in the table of contents and should not be tracked." But headings inside divs do indeed get rendered in the TOC.

Event Timeline

Change 867725 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/skins/Vector@master] Mark active sections even when their headings are in wrapper elements

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

Change 867725 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Mark active sections even when their headings are in wrapper elements

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

EAkinloose subscribed.

✅ Active section is determined correctly when real active section is inside a wrapper
See https://photos.app.goo.gl/baRT6Pf22ke6LJpA6

Screenshot 2022-12-20 at 15.45.33.png (1×3 px, 302 KB)

ppelberg claimed this task.

Change 874884 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/skins/Vector@wmf/1.40.0-wmf.14] Mark active sections even when their headings are in wrapper elements

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

Change 874884 merged by jenkins-bot:

[mediawiki/skins/Vector@wmf/1.40.0-wmf.14] Mark active sections even when their headings are in wrapper elements

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

Mentioned in SAL (#wikimedia-operations) [2023-01-04T14:18:04Z] <urbanecm@deploy1002> Started scap: Backport for [[gerrit:870978|plwiki: Add editcontentmodel to interface-admin (T325819)]], [[gerrit:874884|Mark active sections even when their headings are in wrapper elements (T318044 T324869)]]

Mentioned in SAL (#wikimedia-operations) [2023-01-04T14:19:53Z] <urbanecm@deploy1002> urbanecm and stang and matmarex: Backport for [[gerrit:870978|plwiki: Add editcontentmodel to interface-admin (T325819)]], [[gerrit:874884|Mark active sections even when their headings are in wrapper elements (T318044 T324869)]] synced to the testservers: mwdebug2002.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1001.eqiad.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-01-04T14:27:36Z] <urbanecm@deploy1002> Finished scap: Backport for [[gerrit:870978|plwiki: Add editcontentmodel to interface-admin (T325819)]], [[gerrit:874884|Mark active sections even when their headings are in wrapper elements (T318044 T324869)]] (duration: 09m 32s)