Title: [124297] trunk
Revision
124297
Author
[email protected]
Date
2012-07-31 21:48:22 -0700 (Tue, 31 Jul 2012)

Log Message

-webkit-flex-flow does not work with inherit/initial values
https://bugs.webkit.org/show_bug.cgi?id=92709

Patch by Douglas Stockwell <[email protected]> on 2012-07-31
Reviewed by Ojan Vafai.

Source/WebCore:

Add a new handler for flex-flow and move flex to StyleBuilder to mirror the standard pattern for handling initial/inherit in shorthands.

Test: css3/flexbox/flex-flow-initial.html

* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder): Added handlers for flex and flex-flow.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList): Removed hand written logic for handling flex.

LayoutTests:

Test that flex-flow handles 'initial' as expected.

* css3/flexbox/flex-flow-initial-expected.txt: Added.
* css3/flexbox/flex-flow-initial.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (124296 => 124297)


--- trunk/LayoutTests/ChangeLog	2012-08-01 04:14:13 UTC (rev 124296)
+++ trunk/LayoutTests/ChangeLog	2012-08-01 04:48:22 UTC (rev 124297)
@@ -1,3 +1,15 @@
+2012-07-31  Douglas Stockwell  <[email protected]>
+
+        -webkit-flex-flow does not work with inherit/initial values
+        https://bugs.webkit.org/show_bug.cgi?id=92709
+
+        Reviewed by Ojan Vafai.
+
+        Test that flex-flow handles 'initial' as expected.
+
+        * css3/flexbox/flex-flow-initial-expected.txt: Added.
+        * css3/flexbox/flex-flow-initial.html: Added.
+
 2012-07-31  Peter Kasting  <[email protected]>
 
         [Chromium] Rebaselines and test expectation updates.

Added: trunk/LayoutTests/css3/flexbox/flex-flow-initial-expected.txt (0 => 124297)


--- trunk/LayoutTests/css3/flexbox/flex-flow-initial-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/flex-flow-initial-expected.txt	2012-08-01 04:48:22 UTC (rev 124297)
@@ -0,0 +1,11 @@
+Tests that 'initial' is handled correctly for the -webkit-flex-flow shorthand.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.getComputedStyle(test1).webkitFlexDirection is "row"
+PASS window.getComputedStyle(test2).webkitFlexDirection is "row"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/css3/flexbox/flex-flow-initial.html (0 => 124297)


--- trunk/LayoutTests/css3/flexbox/flex-flow-initial.html	                        (rev 0)
+++ trunk/LayoutTests/css3/flexbox/flex-flow-initial.html	2012-08-01 04:48:22 UTC (rev 124297)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<style>
+#test1 {
+  -webkit-flex-flow: column;
+}
+#test1 {
+  -webkit-flex-flow: initial;
+}
+#test2 {
+  -webkit-flex-direction: column;
+}
+#test2 {
+  -webkit-flex-direction: initial;
+}
+</style>
+<span id="test1"></span>
+<span id="test2"></span>
+<script src=""
+<script>
+description("Tests that 'initial' is handled correctly for the -webkit-flex-flow shorthand.");
+value1 = window.getComputedStyle(test1).webkitFlexDirection;
+value2 = window.getComputedStyle(test2).webkitFlexDirection;
+shouldBeEqualToString('window.getComputedStyle(test1).webkitFlexDirection', 'row');
+shouldBeEqualToString('window.getComputedStyle(test2).webkitFlexDirection', 'row');
+if (window.testRunner)
+   testRunner.dumpAsText();
+</script>
+<script src=""

Modified: trunk/Source/WebCore/ChangeLog (124296 => 124297)


--- trunk/Source/WebCore/ChangeLog	2012-08-01 04:14:13 UTC (rev 124296)
+++ trunk/Source/WebCore/ChangeLog	2012-08-01 04:48:22 UTC (rev 124297)
@@ -1,3 +1,19 @@
+2012-07-31  Douglas Stockwell  <[email protected]>
+
+        -webkit-flex-flow does not work with inherit/initial values
+        https://bugs.webkit.org/show_bug.cgi?id=92709
+
+        Reviewed by Ojan Vafai.
+
+        Add a new handler for flex-flow and move flex to StyleBuilder to mirror the standard pattern for handling initial/inherit in shorthands.
+
+        Test: css3/flexbox/flex-flow-initial.html
+
+        * css/StyleBuilder.cpp:
+        (WebCore::StyleBuilder::StyleBuilder): Added handlers for flex and flex-flow.
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::collectMatchingRulesForList): Removed hand written logic for handling flex.
+
 2012-07-31  Emil A Eklund  <[email protected]>
 
         Float imprecision causes incorrect wrapping in LineLayout with subpixel layout

Modified: trunk/Source/WebCore/css/StyleBuilder.cpp (124296 => 124297)


--- trunk/Source/WebCore/css/StyleBuilder.cpp	2012-08-01 04:14:13 UTC (rev 124296)
+++ trunk/Source/WebCore/css/StyleBuilder.cpp	2012-08-01 04:48:22 UTC (rev 124297)
@@ -1990,8 +1990,10 @@
     setPropertyHandler(CSSPropertyWebkitAlignContent, ApplyPropertyDefault<EAlignContent, &RenderStyle::alignContent, EAlignContent, &RenderStyle::setAlignContent, EAlignContent, &RenderStyle::initialAlignContent>::createHandler());
     setPropertyHandler(CSSPropertyWebkitAlignItems, ApplyPropertyDefault<EAlignItems, &RenderStyle::alignItems, EAlignItems, &RenderStyle::setAlignItems, EAlignItems, &RenderStyle::initialAlignItems>::createHandler());
     setPropertyHandler(CSSPropertyWebkitAlignSelf, ApplyPropertyDefault<EAlignItems, &RenderStyle::alignSelf, EAlignItems, &RenderStyle::setAlignSelf, EAlignItems, &RenderStyle::initialAlignSelf>::createHandler());
+    setPropertyHandler(CSSPropertyWebkitFlex, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitFlexGrow, CSSPropertyWebkitFlexShrink, CSSPropertyWebkitFlexBasis>::createHandler());
     setPropertyHandler(CSSPropertyWebkitFlexBasis, ApplyPropertyLength<&RenderStyle::flexBasis, &RenderStyle::setFlexBasis, &RenderStyle::initialFlexBasis, AutoEnabled>::createHandler());
     setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
+    setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap>::createHandler());
     setPropertyHandler(CSSPropertyWebkitFlexGrow, ApplyPropertyDefault<float, &RenderStyle::flexGrow, float, &RenderStyle::setFlexGrow, float, &RenderStyle::initialFlexGrow>::createHandler());
     setPropertyHandler(CSSPropertyWebkitFlexShrink, ApplyPropertyDefault<float, &RenderStyle::flexShrink, float, &RenderStyle::setFlexShrink, float, &RenderStyle::initialFlexShrink>::createHandler());
     setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (124296 => 124297)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2012-08-01 04:14:13 UTC (rev 124296)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2012-08-01 04:48:22 UTC (rev 124297)
@@ -4001,19 +4001,6 @@
         return;
     }
 #endif
-#if ENABLE(CSS3_FLEXBOX)
-    case CSSPropertyWebkitFlex:
-        if (isInherit) {
-            m_style->setFlexGrow(m_parentStyle->flexGrow());
-            m_style->setFlexShrink(m_parentStyle->flexShrink());
-            m_style->setFlexBasis(m_parentStyle->flexBasis());
-        } else if (isInitial) {
-            m_style->setFlexGrow(RenderStyle::initialFlexGrow());
-            m_style->setFlexShrink(RenderStyle::initialFlexShrink());
-            m_style->setFlexBasis(RenderStyle::initialFlexBasis());
-        }
-        return;
-#endif
     case CSSPropertyInvalid:
         return;
     // Directional properties are resolved by resolveDirectionAwareProperty() before the switch.
@@ -4344,6 +4331,7 @@
     case CSSPropertyWebkitAlignContent:
     case CSSPropertyWebkitAlignItems:
     case CSSPropertyWebkitAlignSelf:
+    case CSSPropertyWebkitFlex:
     case CSSPropertyWebkitFlexBasis:
     case CSSPropertyWebkitFlexDirection:
     case CSSPropertyWebkitFlexFlow:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to