Title: [140993] trunk
Revision
140993
Author
[email protected]
Date
2013-01-28 12:43:33 -0800 (Mon, 28 Jan 2013)

Log Message

getComputedStyle returns "left" instead of "none" for "float" on abspos elements
https://bugs.webkit.org/show_bug.cgi?id=105836

Patch by Uday Kiran <[email protected]> on 2013-01-28
Reviewed by Tony Chang.

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
This matches behavior of Firefox 18, Opera 12 and IE9.

Source/WebCore:

Test: fast/css/position-absolute-float.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

LayoutTests:

* fast/css/position-absolute-float-expected.txt: Added.
* fast/css/position-absolute-float.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (140992 => 140993)


--- trunk/LayoutTests/ChangeLog	2013-01-28 20:36:12 UTC (rev 140992)
+++ trunk/LayoutTests/ChangeLog	2013-01-28 20:43:33 UTC (rev 140993)
@@ -1,3 +1,18 @@
+2013-01-28  Uday Kiran  <[email protected]>
+
+        getComputedStyle returns "left" instead of "none" for "float" on abspos elements
+        https://bugs.webkit.org/show_bug.cgi?id=105836
+
+        Reviewed by Tony Chang.
+
+        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
+        This matches behavior of Firefox 18, Opera 12 and IE9.
+
+        * fast/css/position-absolute-float-expected.txt: Added.
+        * fast/css/position-absolute-float.html: Added.
+
 2013-01-28  Zan Dobersek  <[email protected]>
 
         Unreviewed GTK gardening.

Added: trunk/LayoutTests/fast/css/position-absolute-float-expected.txt (0 => 140993)


--- trunk/LayoutTests/fast/css/position-absolute-float-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/position-absolute-float-expected.txt	2013-01-28 20:43:33 UTC (rev 140993)
@@ -0,0 +1,12 @@
+Test for Bug: 105836 - computed value of float on positioned elements.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS getComputedStyle(document.getElementById("static")).float is "right"
+PASS getComputedStyle(document.getElementById("absolute")).float is "none"
+PASS getComputedStyle(document.getElementById("fixed")).float is "none"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/position-absolute-float.html (0 => 140993)


--- trunk/LayoutTests/fast/css/position-absolute-float.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/position-absolute-float.html	2013-01-28 20:43:33 UTC (rev 140993)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#static { position: static; float: right; }
+#absolute { position: absolute; float: right; }
+#fixed { position: fixed; float: right; }
+</style>
+<script src=""
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body>
+<div id="static"></div>
+<div id="absolute"></div>
+<div id="fixed"></div>
+</body>
+<script>
+description("Test for Bug: 105836 - computed value of float on positioned elements.");
+shouldBe('getComputedStyle(document.getElementById("static")).float', '"right"');
+shouldBe('getComputedStyle(document.getElementById("absolute")).float', '"none"');
+shouldBe('getComputedStyle(document.getElementById("fixed")).float', '"none"');
+</script>
+<script src=""
+</html>

Modified: trunk/Source/WebCore/ChangeLog (140992 => 140993)


--- trunk/Source/WebCore/ChangeLog	2013-01-28 20:36:12 UTC (rev 140992)
+++ trunk/Source/WebCore/ChangeLog	2013-01-28 20:43:33 UTC (rev 140993)
@@ -1,3 +1,20 @@
+2013-01-28  Uday Kiran  <[email protected]>
+
+        getComputedStyle returns "left" instead of "none" for "float" on abspos elements
+        https://bugs.webkit.org/show_bug.cgi?id=105836
+
+        Reviewed by Tony Chang.
+
+        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
+        This matches behavior of Firefox 18, Opera 12 and IE9.
+
+        Test: fast/css/position-absolute-float.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+
 2013-01-28  Tony Gentilcore  <[email protected]>
 
         Don't use threaded HTML parser for data: URLs

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (140992 => 140993)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-01-28 20:36:12 UTC (rev 140992)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-01-28 20:43:33 UTC (rev 140993)
@@ -1860,6 +1860,8 @@
         case CSSPropertyWebkitOrder:
             return cssValuePool().createValue(style->order(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyFloat:
+            if (style->display() != NONE && style->hasOutOfFlowPosition())
+                return cssValuePool().createIdentifierValue(CSSValueNone);
             return cssValuePool().createValue(style->floating());
         case CSSPropertyFont: {
             RefPtr<FontValue> computedFont = FontValue::create();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to