From 919b67568295aac1aaaef85a48912bf9607fc07c Mon Sep 17 00:00:00 2001 From: "ojan@chromium.org" Date: Mon, 27 Feb 2012 20:33:27 +0000 Subject: [PATCH] implement display: -webkit-inline-flexbox 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 | 10 ++++++++ .../css3/flexbox/inline-flexbox-expected.html | 4 ++++ LayoutTests/css3/flexbox/inline-flexbox.html | 7 ++++++ Source/WebCore/ChangeLog | 14 +++++++++++ Source/WebCore/rendering/style/RenderStyle.h | 24 +++++++------------ 5 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 LayoutTests/css3/flexbox/inline-flexbox-expected.html create mode 100644 LayoutTests/css3/flexbox/inline-flexbox.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 27dae6095894..945391a071ee 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,13 @@ +2012-02-27 Ojan Vafai + + 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 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 index 000000000000..f2044f9d14ac --- /dev/null +++ b/LayoutTests/css3/flexbox/inline-flexbox-expected.html @@ -0,0 +1,4 @@ + +foo +flex item 1flex item 2 +baz \ 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 index 000000000000..6e15e2f56b7a --- /dev/null +++ b/LayoutTests/css3/flexbox/inline-flexbox.html @@ -0,0 +1,7 @@ + +foo +
+
flex item 1
+
flex item 2
+
+baz \ No newline at end of file diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 37e74787e224..85bb233f7d38 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2012-02-27 Ojan Vafai + + 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 Absolute positioned elements with Inline Relative Positioned Container are not layout correctly diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h index 4e9473028f76..b6b84d3c8f8b 100644 --- a/Source/WebCore/rendering/style/RenderStyle.h +++ b/Source/WebCore/rendering/style/RenderStyle.h @@ -1450,21 +1450,9 @@ public: 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; } @@ -1715,6 +1703,12 @@ private: 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(); } -- 2.36.0