Bug 215941 - Add ::marker { font-variant-numeric: tabular-nums; } to UA stylesheet per spec
Summary: Add ::marker { font-variant-numeric: tabular-nums; } to UA stylesheet per spec
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Minor
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-28 12:04 PDT by Tyler Wilcock
Modified: 2020-09-13 12:56 PDT (History)
13 users (show)

See Also:


Attachments
Patch (1.24 KB, patch)
2020-08-28 12:07 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2020-08-28 12:04:05 PDT
Quoting https://www.w3.org/TR/css-pseudo-4/#marker-pseudo:

> UAs must add the following rule to their default style sheet:
>     ::marker { font-variant-numeric: tabular-nums; }
Comment 1 Tyler Wilcock 2020-08-28 12:07:16 PDT
Created attachment 407493 [details]
Patch
Comment 2 Darin Adler 2020-08-28 14:38:13 PDT
Comment on attachment 407493 [details]
Patch

Code change looks great. Can we add a test, please? Surprised there is no test of this in Web Platform Tests.
Comment 3 Tyler Wilcock 2020-08-28 14:45:46 PDT
Sure, I'll add one and give it another r?.
Comment 4 Tyler Wilcock 2020-08-28 16:05:53 PDT
Actually, I think there is a WPT for the addition of this property, but it started passing here with the addition of `::marker { text-transform }` for some reason:

https://bugs.webkit.org/show_bug.cgi?id=214359
Comment 5 Darin Adler 2020-08-30 18:30:35 PDT
That is very strange. Maybe we don’t need this change, then?
Comment 6 Darin Adler 2020-08-30 18:30:54 PDT
If the test is passing that makes it sound like we might not need this code.
Comment 7 Darin Adler 2020-08-31 09:45:21 PDT
It the test already passes without this fix, then there are a few different possibilities:

1) The test is not a very good test, and we need to make a better test that can detect that this is missing.

2) The test is being run incorrectly or skipped, and we need to correct how it’s being run by WebKit’s test machinery.

3) This code change isn’t actually needed for some reason.

We should not land the change without figuring this out.
Comment 8 Darin Adler 2020-08-31 09:46:29 PDT
Another possibility is:

4) There is another bug in the implementation of markers that causes the test to pass. A "false negative". Once we fix that other bug then the test will start failing.
Comment 9 Radar WebKit Bug Importer 2020-09-04 12:05:13 PDT
<rdar://problem/68358696>
Comment 10 Oriol Brufau 2020-09-13 08:08:56 PDT
(In reply to Darin Adler from comment #7)
> 3) This code change isn’t actually needed for some reason.
Basically this one. font-variant-numeric is already applied in RenderListItem::computeMarkerStyle
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/rendering/RenderListItem.cpp#L59

However, before bug 214359, I think this wouldn't be reflected in getComputedStyle for unstyled ::marker.

BTW, not sure if it's the same in WebKit, but directly adding ::marker in the UA sheet would have disabled some optimizations in Chromium. I had to do it more carefully. See this comment from the link above:

> Although the CSS Pseudo-Elements Module Level 4 spec. saids to add ::marker to the UA sheet we apply it here as an optimization because it only applies to markers. That is, it does not apply to all elements.
Comment 11 Darin Adler 2020-09-13 12:56:42 PDT
So I think there is no bug to fix here. Resolving for now.

If we can find something wrong, then it’s fine to reopen this bug.