[wpt-sync] Sync PR 24365 - [css-lists] Fix 'content: counter(list-item)' in pseudo-elements
Categories
(Core :: Layout: Generated Content, Lists, and Counters, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox80 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 24365 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/24365
Details from upstream follow.
Oriol Brufau <obrufau@igalia.com> wrote:
[css-lists] Fix 'content: counter(list-item)' in pseudo-elements
::before, ::after and ::marker pseudo-elements can use the counter()
function in the 'content' property in order to retrieve the value of a
counter. This was already working well, except for the automatic
'list-item' counter.The problem was that in \<ol> elements, the counter was set to the start
value. For example, in '\<ol start="3">\<li>\</li>\</ol>', the counter was 3
in ol::before, but \<li> increments it, so it became 4 in li::before.
This patch sets it to the start value minus 1, according to the spec
https://drafts.csswg.org/css-lists/#ua-stylesheetThere was also the problem that list items would increment the value,
even in reversed lists. E.g. in '\<ol reversed>\<li>\</li>\<li>\</li>\</ol>',
the counter used to be 2 in ol::before, 3 in li:first-child::before,
and 4 in li:last-child::before. This patch checks whether the list item
is in a reversed list in order to decide if the value should be
incremented or decremented.Bug: 796961
TEST=external/wpt/css/css-lists/counter-list-item.html
TEST=external/wpt/css/css-pseudo/marker-content-002.html
TEST=external/wpt/css/css-pseudo/marker-content-005.htmlThe former test is imported from WebKit.
Change-Id: I011499095379df547820eb6417f68ab61cf5a23d
Reviewed-on: https://chromium-review.googlesource.com/2270305
WPT-Export-Revision: 422ce7ee35a60389fbbd9ad95e89dcac9e048cc4
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
|
||
| Assignee | ||
Comment 2•6 years ago
|
||
CI Results
Ran 12 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 1 tests
Status Summary
Firefox
PASS: 1
FAIL: 1
Chrome
FAIL: 1
Safari
PASS: 1
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
/css/css-lists/counter-list-item.html: FAIL [Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt], PASS [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt, GitHub] (Chrome: FAIL, Safari: PASS)
Comment 4•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/effe6f91adaa
https://hg.mozilla.org/mozilla-central/rev/8ef7ee99300a
Description
•