New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 604023 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Compat



Sign in to add a comment

Chrome incorrectly accepts invalid values for -webkit-background-clip (content, padding, & border); should require "-box" suffix

Project Member Reported by dholb...@gmail.com, Apr 15 2016

Issue description

Version: 51.0.2704.7 dev (64-bit)
OS: Ubuntu 16.04

What steps will reproduce the problem?
(1) Visit https://jsfiddle.net/d557kky5/

What is the expected output?
No red should be visible. (The inner element's background should not be clipped.)

What do you see instead?
Red is visible. (The inner element's background *is* clipped.)


NOTES:
This bug indicates that Chrome is incorrectly accepting "-webkit-background-clip:content" as valid CSS.  It should not -- "content" is not a valid value for the "background-clip" property.  The correct value is "content-box" (note the "-box" suffix).

The same thing happens for "border"/"border-box" & "padding"/"padding-box".  (Chrome accepts the former values -- missing the "-box" suffix -- in the -webkit-background-clip alias, but it should not.)

More details on this property here:
 https://drafts.csswg.org/css-backgrounds-3/#the-background-clip
 Value:	<box> [ , <box> ]*
 <box> = border-box | padding-box | content-box

I ran into this because Mozilla is implementing support for "-webkit-background-clip" as an alias in Firefox Nightly (and Edge has done the same), and I ran across an ancient WebKit blogpost which did not work in Firefox Nightly or in Edge 13, but which does work in Chrome & Safari.  Turns out it's because it relies on one of these old keyword values ("border").

If there's a web-compatibility need to keep these "-box" suffixless aliases around, please let me know, and maybe we'll have to consider adding support for them.  But otherwise, please get rid of them for the sake of interoperability. Thanks!
 

Comment 1 by dholb...@gmail.com, Apr 15 2016

The ancient Safari blog post that I mentioned (which relies on "-webkit-background-clip:border" being valid) is https://webkit.org/blog/164/background-clip-text/

(The demo there is focusing on "-webkit-background-clip: text", which is moving towards standardization & which is implemented in Firefox Nightly & Edge 13. But I'm focusing on the part where it also relies on the "border" value as the second entry in a list -- specifically, it has "-webkit-background-clip: text, border;")

For reference, I also filed https://bugs.webkit.org/show_bug.cgi?id=156641 on this bug for WebKit, and I initially filed https://bugzilla.mozilla.org/show_bug.cgi?id=1265071 on this CSS being rejected in Firefox before I realized that Firefox was likely-correct.)
Cc: tabatkins@chromium.org
Labels: -Type-Bug Type-Compat
Status: Available (was: Untriaged)
I'm not sure about this property specifically, but since it's an old -webkit prefixed one, its behaviour is calcified as-is, pre-standardisation.

chromestatus.com currently shows 15% of page loads contain -webkit-background-clip (https://www.chromestatus.com/metrics/css/timeline/popularity/178 - really high!). We don't have information about the usage of non'-box'-suffixed values, but without this data it's too risky to change behaviour.

This is one we're likely stuck with.

+tabatkins in case he's got more insight into this one.

Comment 3 by timloh@chromium.org, Apr 18 2016

We should probably add a counter. The prefixed property also supports a "text" value.

FWIW, I've been trying to keep track of our various legacy behaviors we have (with the intent that we can slowly make it smaller). https://docs.google.com/document/d/18PQf6HIrQPh8kKp3yNRZoeijBP4mF-7yZsmdoGT23gg/
In general, it would also be interesting to have counters of 'how often does a webkit prefixed property get overridden by the non-prefixed version'.

Comment 5 by dholb...@gmail.com, Apr 18 2016

> since it's an old -webkit prefixed one, its behaviour is
> calcified as-is, pre-standardisation.

Prefixed properties don't necessarily *have* to be calcified.  If the modern syntax evolves and not much web content depends on the legacy syntax being different, then it's completely reasonable to evolve the legacy version in tandem.  (And unless there's proof that the web depends on the legacy cruft, it seems like it's better to err on the side of keeping the legacy version consistent with the unprefixed version.)

So: in this bug, I'm curious if there's any proof that legacy content *does* depend on these old suffixless "box" values (content/padding/border) for -webkit-background-clip.

(Let's set "text" aside -- Microsoft and Mozilla have both found that the web depends on "-webkit-background-clip: text", which is an unfortunate reality.)

If it *is* the case that the web depends on these specific suffixless "box" values, it would be great to see evidence of that, and then Mozilla and Microsoft may need to implement them (as "-webkit-background-clip" values) for compatibility's sake.  But otherwise, it would be great to see Blink remove them, for compatibility's sake (and for a reduced legacy-code-maintenance burden).

tl;dr: +1 to "we should probably add a counter".  Thanks! :)

Comment 6 by nainar@chromium.org, Feb 13 2017

Labels: Hotlist-Interop Update-Quarterly
The same issue applies to -webkit-background-origin
Labels: ApproachableBug
Labels: -Update-Quarterly
Project Member

Comment 10 by sheriffbot@chromium.org, Dec 6

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment