Bug 105836 - getComputedStyle returns "left" instead of "none" for "float" on abspos elements
Summary: getComputedStyle returns "left" instead of "none" for "float" on abspos elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://jsfiddle.net/ChPCD/7/
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-28 11:12 PST by Mike Sherov
Modified: 2013-01-28 12:45 PST (History)
8 users (show)

See Also:


Attachments
Proposed patch (4.65 KB, patch)
2013-01-27 16:04 PST, Uday Kiran
no flags Details | Formatted Diff | Diff
Patch (4.79 KB, patch)
2013-01-28 10:57 PST, Uday Kiran
no flags Details | Formatted Diff | Diff
Patch (4.79 KB, patch)
2013-01-28 11:11 PST, Uday Kiran
no flags Details | Formatted Diff | Diff
Patch (4.92 KB, patch)
2013-01-28 11:56 PST, Uday Kiran
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Sherov 2012-12-28 11:12:14 PST
http://www.w3.org/TR/css3-positioning/ Section 8:
> if ‘position’ has the value absolute, page or fixed, and the value of float is left or right, the box is absolutely positioned and the computed value of float is none.

Webkit incorrectly returns "left". This has surfaced as a jQuery bug: http://bugs.jquery.com/ticket/13126#comment:1

Here's a jsfiddle demonstrating the problem: http://jsfiddle.net/ChPCD/7/ Note the output says "left" for "absolute" instead of "none". 

The same test case returns correct values in FF15, Opera 12, and IE9+
Comment 1 Uday Kiran 2013-01-27 16:04:23 PST
Created attachment 184924 [details]
Proposed patch
Comment 2 Tony Chang 2013-01-28 10:03:04 PST
Comment on attachment 184924 [details]
Proposed patch

I mentioned on IRC that CSSComputedStyleDeclaration.cpp might be a better place for this type of change since we don't need to change the style for rendering.
Comment 3 Uday Kiran 2013-01-28 10:57:01 PST
Created attachment 185008 [details]
Patch

Fixed review comments.
Comment 4 Uday Kiran 2013-01-28 11:11:03 PST
Created attachment 185014 [details]
Patch
Comment 5 Tony Chang 2013-01-28 11:42:35 PST
Comment on attachment 185014 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=185014&action=review

> LayoutTests/ChangeLog:10
> +        If 'position' has the value absolute, page or fixed, and the value of float is
> +        left or right, the box is absolutely positioned and the computed value of float is none.
> +        http://www.w3.org/TR/css3-positioning/#dis-pos-flo

Please mention that this matches Firefox and IE.  BTW, do you know of any websites that depend on this behavior?
Comment 6 Uday Kiran 2013-01-28 11:56:28 PST
Created attachment 185027 [details]
Patch

Updated ChangeLog
Comment 7 Uday Kiran 2013-01-28 11:59:45 PST
Thanks for review.

(In reply to comment #5)
> (From update of attachment 185014 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=185014&action=review
> 
> > LayoutTests/ChangeLog:10
> > +        If 'position' has the value absolute, page or fixed, and the value of float is
> > +        left or right, the box is absolutely positioned and the computed value of float is none.
> > +        http://www.w3.org/TR/css3-positioning/#dis-pos-flo
> 
> Please mention that this matches Firefox and IE.  BTW, do you know of any websites that depend on this behavior?

Fixed ChangeLog. Sorry I am not aware of websites.
Can I carry-forward your r+ to next patch? If yes, how do I do it with webkit-patch?
Comment 8 Tony Chang 2013-01-28 12:09:51 PST
Comment on attachment 185027 [details]
Patch

When the previous patch still had r+, you can use 'webkit-patch land-safely' to forward on the review flag.
Comment 9 Uday Kiran 2013-01-28 12:28:08 PST
(In reply to comment #8)
> (From update of attachment 185027 [details])
> When the previous patch still had r+, you can use 'webkit-patch land-safely' to forward on the review flag.

Thanks. Will remember it from next time :)
Comment 10 WebKit Review Bot 2013-01-28 12:45:04 PST
Comment on attachment 185027 [details]
Patch

Clearing flags on attachment: 185027

Committed r140993: <http://trac.webkit.org/changeset/140993>
Comment 11 WebKit Review Bot 2013-01-28 12:45:08 PST
All reviewed patches have been landed.  Closing bug.