RESOLVED FIXED 210468
axis in scroll-snap-type should be required
https://bugs.webkit.org/show_bug.cgi?id=210468
Summary axis in scroll-snap-type should be required
Simon Fraser (smfr)
Reported 2020-04-13 17:07:10 PDT
We don't parse scroll-snap-type according to the spec: https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-type which means we're not compatible with Firefox and Chrome.
Attachments
Patch (12.37 KB, patch)
2020-10-15 06:34 PDT, Martin Robinson
no flags
Radar WebKit Bug Importer
Comment 1 2020-04-13 17:11:00 PDT
Simon Fraser (smfr)
Comment 2 2020-04-13 18:28:28 PDT
Actually we do parse it: auto firstValue = consumeIdent<CSSValueX, CSSValueY, CSSValueBlock, CSSValueInline, CSSValueBoth>(range); if (firstValue) secondValue = consumeIdent<CSSValueProximity, CSSValueMandatory>(range); else firstValue = consumeIdent<CSSValueNone, CSSValueProximity, CSSValueMandatory>(range); but we treat the axis optional, when it should be required.
Martin Robinson
Comment 3 2020-10-15 06:34:11 PDT
Martin Robinson
Comment 4 2020-10-15 07:26:35 PDT
*** Bug 187697 has been marked as a duplicate of this bug. ***
Simon Fraser (smfr)
Comment 5 2020-10-15 10:12:03 PDT
Comment on attachment 411435 [details] Patch I'm concerned about web compat here. Does the snapping on https://music.apple.com still work?
Majid Valipour
Comment 6 2020-10-15 17:58:13 PDT
FWIW, apple music scroll snapping works in Chrome which requires the new syntax. Quick check on their home page showed they are using "scroll-snap-type: x mandatory". Unfortunately chrome css data stats (https://chromestatus.com/metrics/css/popularity) do not tell you much about the value. But we can use it to compare usage of attributes that exclusively belong to the old syntax vs the new syntax: [exclusively old] <= 0.000001% scroll-snap-points-{x,y}, scroll-snap-coordinates, scroll-snap-destinations [common in both] 2.090845% scroll-snap-types [exclusively new] 2.090845% scroll-snap-align This does suggest that old syntax is not being used much compared to the new one which could indicate that it is rare to have a single value that is not an axis as that is from old syntax and not valid in Chrome, Firefox, or Edge. None of this is hard data on compat but hopefully helps.
Majid Valipour
Comment 7 2020-10-15 18:00:38 PDT
scroll-snap-align usage should be 2.119231% so [exclusively old] <= 0.000001% scroll-snap-points-{x,y}, scroll-snap-coordinates, scroll-snap-destinations [common in both] 2.090845% scroll-snap-type [exclusively new] 2.119231% scroll-snap-align
EWS
Comment 8 2020-10-19 02:24:53 PDT
Committed r268665: <https://trac.webkit.org/changeset/268665> All reviewed patches have been landed. Closing bug and clearing flags on attachment 411435 [details].
Note You need to log in before you can comment on or make changes to this bug.