Intent to Deprecate and Remove: background-size should not accept negative values

41 views
Skip to first unread message

zhuoy...@samsung.com

unread,
Jun 25, 2018, 6:54:33 PM6/25/18
to blink-dev, fut...@chromium.org, ericwi...@chromium.org
Primary eng (and PM) emails

zhuoy...@samsung.com

Summary
background-size should not accept negative values

Motivation
The spec explicitly mentions negative values are not allowed:
https://drafts.csswg.org/css-backgrounds/#background-size

Interoperability and Compatibility Risk
Low risk since most implementations reject negative values for background size already.

Alternative implementation suggestion for web developers
N/A, negative values have no effect, 0% already no size.

Usage information from UseCounter

Very low usage, maximum is around 0.005%:

https://www.chromestatus.com/metrics/feature/timeline/popularity/2402

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=825549

Entry on the feature dashboard
No entry. Change is believed to be too small to merit one.

Requesting approval to remove too?

Yes, asking approval to deprecate and remove this feature.

Eric Willigers

unread,
Jun 26, 2018, 8:08:18 AM6/26/18
to zhuoy...@samsung.com, blink-dev, Rune Lillesveen
We can also deprecate and remove support for negative -webkit-mask-size values. Usage is 0 (chromestatus).


Daniel Bratell

unread,
Jun 27, 2018, 5:52:55 AM6/27/18
to blink-dev, zhuoy...@samsung.com, fut...@chromium.org, ericwi...@chromium.org
So the net effect is that CSS rules that have negative values will now be ignored instead of... whatever they do now?

Is there anything in wpt that tests this and ensures long-term browser compatibility?

The feature dashboard controls changelogs as well so it could be worth putting something there even if it's not a big change.

(also see Eric Willigers' suggestion)

/Daniel
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/f53896ff-5ece-46e5-b500-14a42e0ce3a2%40chromium.org.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

Eric Willigers

unread,
Jun 27, 2018, 7:03:57 AM6/27/18
to Daniel Bratell, blink-dev, zhuoy...@samsung.com, Rune Lillesveen
On Wed, Jun 27, 2018 at 7:52 PM, Daniel Bratell <bra...@opera.com> wrote:
So the net effect is that CSS rules that have negative values will now be ignored instead of... whatever they do now?

Is there anything in wpt that tests this and ensures long-term browser compatibility?

Yes, CSS rules with negative values will be ignored.

The issue was discovered by writing the WPT background-size-invalid.html. The bug has also been reported to WebKit.

There is no WPT for -webkit-mask-size. Edge does not support it. Firefox supports only non-negative values. WebKit (like Blink) currently accepts negative values.


Chris Harrelson

unread,
Jun 27, 2018, 4:59:13 PM6/27/18
to Eric, Daniel Bratell, blink-dev, zhuoy...@samsung.com, Rune Lillesveen
LGTM1

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Yoav Weiss

unread,
Jun 28, 2018, 3:02:49 AM6/28/18
to Daniel Bratell, blink-dev, zhuoy...@samsung.com, fut...@chromium.org, ericwi...@chromium.org
On Wed, Jun 27, 2018 at 11:52 AM Daniel Bratell <bra...@opera.com> wrote:
So the net effect is that CSS rules that have negative values will now be ignored instead of... whatever they do now?

Just to be clear, as negative values seem to be treated like 0 for layout purposes, breakage would look like currently-invisible background becoming visible, right?

 

Daniel Bratell

unread,
Jun 28, 2018, 8:42:10 AM6/28/18
to Yoav Weiss, blink-dev, zhuoy...@samsung.com, fut...@chromium.org, ericwi...@chromium.org
LGTM2

I do wish it had been clearer what the de facto change will be for a web page that use background-size: -0.00001px now.

/Daniel

Yoav Weiss

unread,
Jun 28, 2018, 12:34:35 PM6/28/18
to Daniel Bratell, blink-dev, zhuoy...@samsung.com, fut...@chromium.org, ericwi...@chromium.org
LGTM3

Even though this can result in visible breakage, usage is low enough to believe this doesn't happen often, and matching Firefox' behavior in those cases seems like the right thing to do.
Reply all
Reply to author
Forward
0 new messages