From 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 9 Feb 2012 14:16:12 +0100 Subject: Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223) --- Source/WebCore/css/CSSStyleApplyProperty.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'Source/WebCore/css/CSSStyleApplyProperty.cpp') diff --git a/Source/WebCore/css/CSSStyleApplyProperty.cpp b/Source/WebCore/css/CSSStyleApplyProperty.cpp index 629470b89..524ed773c 100644 --- a/Source/WebCore/css/CSSStyleApplyProperty.cpp +++ b/Source/WebCore/css/CSSStyleApplyProperty.cpp @@ -349,6 +349,8 @@ public: static void setValue(RenderStyle* style, Length value) { (style->*setterFunction)(value); } static void applyValue(CSSStyleSelector* selector, CSSValue* value) { + float positiveFlex = 0; + float negativeFlex = 0; if (!value->isPrimitiveValue()) { if (!flexDirection || !value->isFlexValue()) return; @@ -356,13 +358,16 @@ public: CSSFlexValue* flexValue = static_cast(value); value = flexValue->preferredSize(); - if (flexDirection == FlexWidth) { - selector->style()->setFlexboxWidthPositiveFlex(flexValue->positiveFlex()); - selector->style()->setFlexboxWidthNegativeFlex(flexValue->negativeFlex()); - } else if (flexDirection == FlexHeight) { - selector->style()->setFlexboxHeightPositiveFlex(flexValue->positiveFlex()); - selector->style()->setFlexboxHeightNegativeFlex(flexValue->negativeFlex()); - } + positiveFlex = flexValue->positiveFlex(); + negativeFlex = flexValue->negativeFlex(); + } + + if (flexDirection == FlexWidth) { + selector->style()->setFlexboxWidthPositiveFlex(positiveFlex); + selector->style()->setFlexboxWidthNegativeFlex(negativeFlex); + } else if (flexDirection == FlexHeight) { + selector->style()->setFlexboxHeightPositiveFlex(positiveFlex); + selector->style()->setFlexboxHeightNegativeFlex(negativeFlex); } CSSPrimitiveValue* primitiveValue = static_cast(value); -- cgit v1.2.1