Bug 86880

Summary: REGRESSION (r116645): "background-size: auto 100%; width:auto; height:100%;" doesn't display correctly
Product: WebKit Reporter: Peter Lewis <peter>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap, bdakin, joethomas, menard
Priority: P1 Keywords: Regression
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://peterlew.is/beta.html
Attachments:
Description Flags
Safari vs Webkit nightly none

Description Peter Lewis 2012-05-18 11:53:51 PDT
Created attachment 142755 [details]
Safari vs Webkit nightly

On http://iam.ptrl.ws/beta.html I'm using width:auto; height:100% to have a 2000x2000px displayed. In Webkit this doesn't display correctly and instead fills the whole browser window.
Comment 1 Alexey Proskuryakov 2012-05-21 12:02:12 PDT
The bug URL is 404 Not Found. Could you please attach your test here?
Comment 2 Peter Lewis 2012-05-21 12:09:01 PDT
Oh I am sorry, I changed my website's URL today! The URL of the page is: 

http://peterlew.is/beta.html

Peter :)

(In reply to comment #1)
> The bug URL is 404 Not Found. Could you please attach your test here?
Comment 3 Alexey Proskuryakov 2012-05-21 13:13:55 PDT
Regressed in <http://trac.webkit.org/changeset/116645>.
Comment 4 Joe Thomas 2012-05-21 13:25:23 PDT
Here is the CSS from the regressed page

   background-size: auto 100%;
   width:auto;
   height:100%;
   background:url(pl_av_cp.jpg) center center no-repeat;

Here background-size is defined before background shorthand.

Since we added background-size to background-shorthand in http://trac.webkit.org/changeset/116645, if background-size is not part of background shorthand, we initialize it with the default value. So this can be solved either by adding background-size to background-shorthand or defining background-size after background.

Peter, Can you please try this out?
Comment 5 Joe Thomas 2012-05-21 13:28:18 PDT
The same issue is mentioned in https://bugs.webkit.org/show_bug.cgi?id=27577#c2
Comment 6 Alexis Menard (darktears) 2012-05-21 13:36:21 PDT
(In reply to comment #4)
> Here is the CSS from the regressed page
> 
>    background-size: auto 100%;
>    width:auto;
>    height:100%;
>    background:url(pl_av_cp.jpg) center center no-repeat;
> 
> Here background-size is defined before background shorthand.
> 
> Since we added background-size to background-shorthand in http://trac.webkit.org/changeset/116645, if background-size is not part of background shorthand, we initialize it with the default value. So this can be solved either by adding background-size to background-shorthand or defining background-size after background.
> 
> Peter, Can you please try this out?

We render the same as FF and Opera now. So it's not really a regression. The behavior we had before was buggy.
Comment 7 Alexis Menard (darktears) 2012-05-21 13:59:49 PDT
Previous behavior was wrong as we :

- Didn't parse the background-size if it was part of the shorthand. We do now.

- Didn't reset the background-size to initial if we don't find it in the shorthand, we do now.


We now behave like the specification : http://www.w3.org/TR/css3-background/#the-background . If a value is missing in a CSS shorthand declaration we should set it to initial which we do now.
Comment 8 Peter Lewis 2012-05-21 14:34:22 PDT
Gosh you guys are quick to respond, thank you.

I've made the adjustments as are recommended and it now renders correctly as can be seen in:

http://peterlew.is/beta2.html

So yes, the resolved/invalid status seems correct, thanks! :)