Bug 247826 - Serialization differences with "columns" with one or more `auto` value
Summary: Serialization differences with "columns" with one or more `auto` value
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2022-11-11 15:03 PST by Ahmad Saleem
Modified: 2022-11-14 19:25 PST (History)
8 users (show)

See Also:


Attachments
Testcase from chromium (31.55 KB, text/html)
2022-11-12 23:48 PST, Tim Nguyen (:ntim)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmad Saleem 2022-11-11 15:03:18 PST
Hi Team,

While going through Bug 103597 and trying to see "column-count: auto" support, I came across following Blink Commit:

Blink Commit - https://src.chromium.org/viewvc/blink?view=revision&revision=155047

I took the test case from above commit and changed it into "JSFiddle" below:

Link - https://jsfiddle.net/2jhw4k5x/show

It seems that we fail following tests compared to Chrome Canary 109:

FAIL element.style.WebkitColumns should be auto auto. Was auto.
FAIL element.style.WebkitColumns should be auto auto. Was auto.
FAIL element.style.WebkitColumns should be auto auto. Was auto.
FAIL element.style.WebkitColumns should be auto 7. Was 7.
FAIL element.style.WebkitColumns should be 7em auto. Was 7em.

Rather than opening old bug, I just thought to create a separate to track this issue. Thanks!
Comment 1 Tim Nguyen (:ntim) 2022-11-12 14:27:47 PST
This was already fixed in https://commits.webkit.org/182834@main

The remaining cases you reported are about serialization differences, what we do is correct given the guideline is always to use the shortest form.

auto auto -> auto
auto 7 -> 7
7em auto -> 7em.

Seems reasonable IMO as I don't see a case where this could cause ambiguity, but we can always adjust.

Firefox seems to be like Chrome and always serializes both for the shorthand: https://jsfiddle.net/3nd4w5qh/show

Oriol, Emilio, wdyt?
Comment 2 Oriol Brufau 2022-11-12 16:16:07 PST
Yes I would say that omitting optional values seems more correct.

https://drafts.csswg.org/cssom/#serialize-a-css-value
> If component values can be omitted or replaced with a shorter representation without changing the meaning of the value, omit/replace them.
Comment 3 Tim Nguyen (:ntim) 2022-11-12 23:48:13 PST
Created attachment 463505 [details]
Testcase from chromium
Comment 4 Tim Nguyen (:ntim) 2022-11-12 23:56:33 PST
https://github.com/web-platform-tests/wpt/blob/a6e9e432ca/css/css-multicol/parsing/columns-valid.html should probably be extended to cover everything in the testcase.

Also I notice WebKit is inconsistent on omitting explicit or implicit `auto`.

Probably makes sense to omit in both case?
Comment 5 Oriol Brufau 2022-11-13 01:34:34 PST
I think WebKit should just remove the notion of implicit values.
Comment 6 Radar WebKit Bug Importer 2022-11-13 01:56:59 PST
<rdar://problem/102287297>
Comment 7 Tim Nguyen (:ntim) 2022-11-13 02:06:28 PST
Pull request: https://github.com/WebKit/WebKit/pull/6441
Comment 8 Emilio Cobos Álvarez (:emilio) 2022-11-13 12:50:45 PST
Yeah agreed omitting redundant values is more correct, in Gecko this is what causes the behavior: https://searchfox.org/mozilla-central/rev/219df29d0fb5d8928ae41bba4a605046de411cf0/servo/components/style/properties/shorthands/column.mako.rs#11

I'd be happy to change to follow suit here if you file a bug :)
Comment 9 Ahmad Saleem 2022-11-13 12:54:52 PST
(In reply to Emilio Cobos Álvarez (:emilio) from comment #8)
> Yeah agreed omitting redundant values is more correct, in Gecko this is what
> causes the behavior:
> https://searchfox.org/mozilla-central/rev/
> 219df29d0fb5d8928ae41bba4a605046de411cf0/servo/components/style/properties/
> shorthands/column.mako.rs#11
> 
> I'd be happy to change to follow suit here if you file a bug :)

https://bugzilla.mozilla.org/show_bug.cgi?id=1800394
Comment 10 EWS 2022-11-13 20:00:11 PST
Committed 256625@main (492c75edf7c7): <https://commits.webkit.org/256625@main>

Reviewed commits have been landed. Closing PR #6441 and removing active labels.