You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
-webkit-background-size has behavioural differences to background-size #28
-webkit-background-size is listed as a simple alias for background-size when it has different syntactic behaviour. -webkit-background-size: 10px is equivalent to background-size: 10px 10px. background-size: 10px is equivalent to background-size: 10px auto (see https://drafts.csswg.org/css-backgrounds-3/#bg-size).
FWIW, I regret making the decision to default the second value to auto. If it were Web-compatible, I'd make the unprefixed property parse like -webkit-background-size.
@zcorpan Particularly given that single-value syntax isn't the same as doubling it, which is the typical pattern in CSS, serializing as two values feels pretty reasonable here.
In WebKit -webkit-background-size and background-size are different longhands that share a computed value. It seems the only difference is in the parsing, so it should be easy to turn -webkit-background-size into a legacy shorthand of background-size, which would be the standard approach.
gCS should round-trip, so either serialize -webkit-background-size and background-size differently, or always use 2 values.
Activity
miketaylr commentedon Jan 15, 2016
Excellent feedback, thanks.
Link to Issue #28 until its resolved.
zcorpan commentedon Mar 6, 2020
Should this property always be serialized with two values, so that it can roundtrip with both the prefixed and unprefixed variants?
Demo http://software.hixie.ch/utilities/js/live-dom-viewer/saved/7809
Result in chrome
fantasai commentedon Sep 29, 2020
FWIW, I regret making the decision to default the second value to
auto. If it were Web-compatible, I'd make the unprefixed property parse like -webkit-background-size.@zcorpan Particularly given that single-value syntax isn't the same as doubling it, which is the typical pattern in CSS, serializing as two values feels pretty reasonable here.
karlcow commentedon Jun 22, 2022
I was reviewing the tests in https://github.com/web-platform-tests/wpt/blob/master/compat/
And it doesn't seem to really work.
Safari
Firefox
Chrome
fun!
I need to add more tests on the compat tests enumeration to test the behaviors of the values of the properties.
karlcow commentedon Jun 22, 2022
I'm taking care of this in web-platform-tests/wpt#34493
nt1m commentedon Jun 22, 2022
cc @Loirooriol who did work on this in WebKit
Loirooriol commentedon Jun 22, 2022
In WebKit
-webkit-background-sizeandbackground-sizeare different longhands that share a computed value. It seems the only difference is in the parsing, so it should be easy to turn-webkit-background-sizeinto a legacy shorthand ofbackground-size, which would be the standard approach.gCS should round-trip, so either serialize
-webkit-background-sizeandbackground-sizedifferently, or always use 2 values.zcorpan commentedon Jun 30, 2022
If they're parsed differently, always serializing two values seems better.
Is there interest in trying to change the unprefixed property to match the -webkit- prefixed property as @fantasai suggested in #28 (comment) ?
karlcow commentedon Aug 18, 2022
see WebKit/WebKit#3372
pxlcoder commentedon Sep 23, 2022
Should we also change the serialization of
mask-sizeto always use two values, for consistency?pxlcoder commentedon Sep 23, 2022
There are two WPTs that current assume single-value serialization:
I would like to update these tests as part of the WebKit change.
@zcorpan @karlcow Do we have consensus from other engines on:
zcorpan commentedon Sep 28, 2022
I filed an issue for the CSS WG for those questions: w3c/csswg-drafts#7802
Parse -webkit-background-size with the legacy syntax