implement display: -webkit-inline-flexbox
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2012 20:33:27 +0000 (20:33 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2012 20:33:27 +0000 (20:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77772

Reviewed by David Hyatt.

Source/WebCore:

Tests: css3/flexbox/inline-flexbox-expected.html
       css3/flexbox/inline-flexbox.html

* rendering/style/RenderStyle.h:
-Add INLINE_FLEXBOX to the list of replaced display types.
-Restructure the isDisplayInline methods to avoid code duplication.

LayoutTests:

* css3/flexbox/inline-flexbox-expected.html: Added.
* css3/flexbox/inline-flexbox.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@109014 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/css3/flexbox/inline-flexbox-expected.html [new file with mode: 0644]
LayoutTests/css3/flexbox/inline-flexbox.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/style/RenderStyle.h

index 27dae6095894d8a44cb3d2264f2ee18194bfef8e..945391a071ee537787b972c5b7dbd649e51abf70 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-27  Ojan Vafai  <ojan@chromium.org>
+
+        implement display: -webkit-inline-flexbox
+        https://bugs.webkit.org/show_bug.cgi?id=77772
+
+        Reviewed by David Hyatt.
+
+        * css3/flexbox/inline-flexbox-expected.html: Added.
+        * css3/flexbox/inline-flexbox.html: Added.
+
 2012-02-27  Ken Buchanan  <kenrb@chromium.org>
 
         Absolute positioned elements with Inline Relative Positioned Container are not layout correctly
 2012-02-27  Ken Buchanan  <kenrb@chromium.org>
 
         Absolute positioned elements with Inline Relative Positioned Container are not layout correctly
diff --git a/LayoutTests/css3/flexbox/inline-flexbox-expected.html b/LayoutTests/css3/flexbox/inline-flexbox-expected.html
new file mode 100644 (file)
index 0000000..f2044f9
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<span>foo</span>
+<span>flex item 1</span><span>flex item 2</span>
+<span>baz</span>
\ No newline at end of file
diff --git a/LayoutTests/css3/flexbox/inline-flexbox.html b/LayoutTests/css3/flexbox/inline-flexbox.html
new file mode 100644 (file)
index 0000000..6e15e2f
--- /dev/null
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<span>foo</span>
+<div style="display:-webkit-inline-flexbox">
+    <div>flex item 1</div>
+    <div>flex item 2</div>
+</div>
+<span>baz</span>
\ No newline at end of file
index 37e74787e22415166d9a8f1d33227412d9d57d09..85bb233f7d38bbd52d252bf54b907521eb0c042a 100644 (file)
@@ -1,3 +1,17 @@
+2012-02-27  Ojan Vafai  <ojan@chromium.org>
+
+        implement display: -webkit-inline-flexbox
+        https://bugs.webkit.org/show_bug.cgi?id=77772
+
+        Reviewed by David Hyatt.
+
+        Tests: css3/flexbox/inline-flexbox-expected.html
+               css3/flexbox/inline-flexbox.html
+
+        * rendering/style/RenderStyle.h:
+        -Add INLINE_FLEXBOX to the list of replaced display types.
+        -Restructure the isDisplayInline methods to avoid code duplication.
+
 2012-02-27  Ken Buchanan  <kenrb@chromium.org>
 
         Absolute positioned elements with Inline Relative Positioned Container are not layout correctly
 2012-02-27  Ken Buchanan  <kenrb@chromium.org>
 
         Absolute positioned elements with Inline Relative Positioned Container are not layout correctly
index 4e9473028f768c409434a9c5be7ce67875c9ec7a..b6b84d3c8f8b5a77f739130363a30b817cacf9ed 100644 (file)
@@ -1450,21 +1450,9 @@ public:
 
     StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const;
 
 
     StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const;
 
-    bool isDisplayReplacedType() const
-    {
-        return display() == INLINE_BLOCK || display() == INLINE_BOX || display() == INLINE_TABLE;
-    }
-
-    bool isDisplayInlineType() const
-    {
-        return display() == INLINE || isDisplayReplacedType();
-    }
-
-    bool isOriginalDisplayInlineType() const
-    {
-        return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK
-            || originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
-    }
+    bool isDisplayReplacedType() const { return isDisplayReplacedType(display()); }
+    bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
+    bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); }
 
     void setWritingMode(WritingMode v) { inherited_flags.m_writingMode = v; }
 
 
     void setWritingMode(WritingMode v) { inherited_flags.m_writingMode = v; }
 
@@ -1715,6 +1703,12 @@ private:
         return isHorizontalWritingMode() ? getImageVerticalOutsets(image, logicalTop, logicalBottom) : getImageHorizontalOutsets(image, logicalTop, logicalBottom);
     }
 
         return isHorizontalWritingMode() ? getImageVerticalOutsets(image, logicalTop, logicalBottom) : getImageHorizontalOutsets(image, logicalTop, logicalBottom);
     }
 
+    bool isDisplayReplacedType(EDisplay display) const
+    {
+        return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_FLEXBOX || display == INLINE_TABLE;
+    }
+    bool isDisplayInlineType(EDisplay display) const { return display == INLINE || isDisplayReplacedType(display); }
+
     // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
     const Color& invalidColor() const { static Color invalid; return invalid; }
     const Color& borderLeftColor() const { return surround->border.left().color(); }
     // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
     const Color& invalidColor() const { static Color invalid; return invalid; }
     const Color& borderLeftColor() const { return surround->border.left().color(); }