Page MenuHomePhabricator

CSS counters are messing up <references> list numbering in Firefox
Closed, ResolvedPublic5 Estimated Story Points

Description

First mentioned in T239725#5709390. Here is a minimal example that creates broken numbers in Firefox:

* <ref>x</ref>
<references />

Firefox renders a "2." down in the <references> section. Chrome renders a "1.", as expected.

This means the CSS counters we are using are somehow messing with the build-in numbering of the numbered list in Firefox. This should not happen.

Event Timeline

I did a bisect and the bug was not there before the patch https://gerrit.wikimedia.org/r/553111. That was the patch that introduced new CSS counters for sub-references.

The minimal example is not even using extended references. The only line of code that is active in this example is a counter-reset on the <ol> the <references> list is made of. It appears like Firefox does have a bug where any counter-reset on an <ol> somehow messes with the build-in counter, and makes it continue from the previous, unrelated list.

According to https://drafts.csswg.org/css-lists-3/#list-item-counter the build-in counter does have a name: list-item. According to https://bugzilla.mozilla.org/show_bug.cgi?id=1545746#c5 we are supposed to reset both the custom and the build-in list-item counter whenever using counter-reset on an <ol> element. I did just that now, and it seems to work. However, it doesn't explain why it was behaving different in Chrome.

Change 554484 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Cite@master] Fix possibly broken reference list counters in Firefox

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

Change 554484 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Fix possibly broken reference list counters in Firefox

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

awight renamed this task from CSS counters are messing up <references> list numbering in Fixefox to CSS counters are messing up <references> list numbering in Firefox.Dec 5 2019, 10:45 AM
awight moved this task from Review to Demo on the WMDE-QWERTY-Sprint-2019-11-20 board.
awight set the point value for this task to 5.Dec 19 2019, 10:45 AM

Assigning random story points, please revise as needed.

WMDE-Fisch claimed this task.
WMDE-Fisch moved this task from Demo to Done on the WMDE-QWERTY-Sprint-2019-12-11 board.