Bug 184256 - CSSOM test for serializing counter() fails
Summary: CSSOM test for serializing counter() fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: FromImplementor, InRadar
Depends on:
Blocks:
 
Reported: 2018-04-03 02:26 PDT by Simon Pieters (:zcorpan)
Modified: 2021-06-08 22:07 PDT (History)
11 users (show)

See Also:


Attachments
Patch (3.45 KB, patch)
2021-06-08 02:11 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (9.42 KB, patch)
2021-06-08 04:09 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (8.62 KB, patch)
2021-06-08 04:40 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (8.61 KB, patch)
2021-06-08 12:50 PDT, Rob Buis
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (8.61 KB, patch)
2021-06-08 13:06 PDT, Rob Buis
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Pieters (:zcorpan) 2018-04-03 02:26:49 PDT
See: https://github.com/w3c/csswg-drafts/issues/670#issuecomment-366329393

Relevant part of the spec:
https://drafts.csswg.org/cssom/#serialize-a-css-component-value
> Let list be a list of CSS component values belonging to <counter>, omitting the last CSS component value if it is "decimal".

Test: http://w3c-test.org/css/cssom/serialize-values.html (search for "counter")

> Fail	content: counter(par-num)	assert_equals: content raw inline style declaration expected "counter(par-num)" but got "counter(par-num, decimal)"

This test passes in Chromium canary and Firefox Nightly. It fails in WebKit TP and EdgeHTML 16 (tested in browserstack).
Comment 1 Radar WebKit Bug Importer 2018-06-13 21:32:35 PDT
<rdar://problem/41114169>
Comment 2 Rob Buis 2021-06-08 02:11:08 PDT
Created attachment 430820 [details]
Patch
Comment 3 Rob Buis 2021-06-08 04:09:12 PDT
Created attachment 430829 [details]
Patch
Comment 4 Rob Buis 2021-06-08 04:40:10 PDT
Created attachment 430830 [details]
Patch
Comment 5 Sam Weinig 2021-06-08 10:29:18 PDT
Comment on attachment 430830 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=430830&action=review

> Source/WebCore/css/CSSPrimitiveValue.cpp:1085
> +        if (listStyle == "decimal")
> +            listStyle = emptyString();
>          result.append(listStyle.isEmpty() ? "" : ", ", listStyle, ')');

This seems like it would be a bit cleaner as:

if (!(listStyle.empty() || listStyle == "decimal"))
    result.append(", ", listStyle);
result.append(')');

(or something like that).
Comment 6 Rob Buis 2021-06-08 12:50:19 PDT
Created attachment 430879 [details]
Patch
Comment 7 Rob Buis 2021-06-08 13:06:52 PDT
Created attachment 430881 [details]
Patch
Comment 8 EWS 2021-06-08 22:07:33 PDT
Committed r278648 (238630@main): <https://commits.webkit.org/238630@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430881 [details].