Bug 28440 - background-size: X treated as background-size: X X, not background-size: X auto
Summary: background-size: X treated as background-size: X X, not background-size: X auto
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: mitz
URL: data:text/html,%3Cstyle%3Ediv%20{%20-...
Keywords:
Depends on:
Blocks: 27569
  Show dependency treegraph
 
Reported: 2009-08-18 16:51 PDT by Jeff Walden (remove +bwo to email)
Modified: 2009-10-26 15:42 PDT (History)
3 users (show)

See Also:


Attachments
Reinstate -webkit-background-size and keep its behavior of using a copy of the first value; and change background-size to use 'auto' (15.44 KB, patch)
2009-10-26 15:21 PDT, mitz
bdakin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Walden (remove +bwo to email) 2009-08-18 16:51:01 PDT
See URL.
Comment 1 mitz 2009-08-23 21:15:47 PDT
The draft <http://dev.w3.org/csswg/css3-background/#the-background-size> does say “If only one value is given the second is assumed to be ‘auto’”, but this sort of behavior doesn’t make much sense to me, especially given the behavior of background-repeat and the 4-value (top-right-bottom-left) properties, where missing values are filled in with specified values.

If the spec isn’t going to change, we will need to fix this bug, but we will also have to undo the aliasing of -webkit-background-size to background-size and have the former maintain the current parsing. We also need to decide what to do about -webkit-mask-size.
Comment 2 Jeff Walden (remove +bwo to email) 2009-08-24 12:31:06 PDT
Interpreting as background-size: X auto does have the useful property that it produces an undistorted rendering.  There doesn't seem to be a comparably obvious way to interpret background-repeat or any of the 4-value properties to produce a "good" rendering every time.  The 4-values have an obvious symmetry argument for repeating that I think doesn't apply here as a general rule.  Drawing without distortion seems the best default, to me, when the one specified value in general only has meaning in the context of all the other surrounding widths (and the aspect ratio of the image itself).

I wasn't paying attention to www-style when the change was made, tho, so I have no idea what arguments were or were not presented in favor of this default.
Comment 3 mitz 2009-10-26 15:21:30 PDT
Created attachment 41905 [details]
Reinstate -webkit-background-size and keep its behavior of using a copy of the first value; and change background-size to use 'auto'
Comment 4 mitz 2009-10-26 15:42:09 PDT
Fixed in <http://trac.webkit.org/projects/webkit/changeset/50108>.