Title: [120780] trunk/Source/WebCore
Revision
120780
Author
[email protected]
Date
2012-06-19 17:40:39 -0700 (Tue, 19 Jun 2012)

Log Message

Refactor RenderFlexibleBox terminology to use grow/shrink instead of positive/negative
https://bugs.webkit.org/show_bug.cgi?id=89493

Reviewed by Eric Seidel.

The spec stopped referring to positive and negative flex and now
talks about flex grow and flex shrink. Also, the preferred size is
now known as the flex basis. Make the code match the terms used in
the spec. http://dev.w3.org/csswg/css3-flexbox/

This will also make it easier to split flex into long hand notation
(flex-grow, flex-shrink and flex-basis).

No new tests, covered by existing tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyFlex::applyInheritValue):
(WebCore::ApplyPropertyFlex::applyInitialValue):
(WebCore::ApplyPropertyFlex::applyValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::PropertyWrapperFlex::equals):
(WebCore::PropertyWrapperFlex::blend):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::flexBasisForChild):
(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
(WebCore::RenderFlexibleBox::computeNextFlexLine):
(WebCore::RenderFlexibleBox::freezeViolations):
(WebCore::RenderFlexibleBox::resolveFlexibleLengths):
* rendering/RenderFlexibleBox.h:
* rendering/style/RenderStyle.h:
* rendering/style/StyleFlexibleBoxData.cpp:
(WebCore::StyleFlexibleBoxData::StyleFlexibleBoxData):
(WebCore::StyleFlexibleBoxData::operator==):
* rendering/style/StyleFlexibleBoxData.h:
(StyleFlexibleBoxData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (120779 => 120780)


--- trunk/Source/WebCore/ChangeLog	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/ChangeLog	2012-06-20 00:40:39 UTC (rev 120780)
@@ -1,3 +1,45 @@
+2012-06-19  Tony Chang  <[email protected]>
+
+        Refactor RenderFlexibleBox terminology to use grow/shrink instead of positive/negative
+        https://bugs.webkit.org/show_bug.cgi?id=89493
+
+        Reviewed by Eric Seidel.
+
+        The spec stopped referring to positive and negative flex and now
+        talks about flex grow and flex shrink. Also, the preferred size is
+        now known as the flex basis. Make the code match the terms used in
+        the spec. http://dev.w3.org/csswg/css3-flexbox/
+
+        This will also make it easier to split flex into long hand notation
+        (flex-grow, flex-shrink and flex-basis).
+
+        No new tests, covered by existing tests.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/StyleBuilder.cpp:
+        (WebCore::ApplyPropertyFlex::applyInheritValue):
+        (WebCore::ApplyPropertyFlex::applyInitialValue):
+        (WebCore::ApplyPropertyFlex::applyValue):
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::PropertyWrapperFlex::equals):
+        (WebCore::PropertyWrapperFlex::blend):
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::flexBasisForChild):
+        (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
+        (WebCore::RenderFlexibleBox::layoutFlexItems):
+        (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
+        (WebCore::RenderFlexibleBox::computeNextFlexLine):
+        (WebCore::RenderFlexibleBox::freezeViolations):
+        (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
+        * rendering/RenderFlexibleBox.h:
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleFlexibleBoxData.cpp:
+        (WebCore::StyleFlexibleBoxData::StyleFlexibleBoxData):
+        (WebCore::StyleFlexibleBoxData::operator==):
+        * rendering/style/StyleFlexibleBoxData.h:
+        (StyleFlexibleBoxData):
+
 2012-06-19  Steve VanDeBogart  <[email protected]>
 
         Make DOMFileSystem selectively structure clonable so it can be the body of a web intent.

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (120779 => 120780)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-06-20 00:40:39 UTC (rev 120780)
@@ -1652,16 +1652,16 @@
 #if ENABLE(CSS3_FLEXBOX)
         case CSSPropertyWebkitFlex: {
             RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
-            list->append(cssValuePool().createValue(style->positiveFlex()));
-            list->append(cssValuePool().createValue(style->negativeFlex()));
+            list->append(cssValuePool().createValue(style->flexGrow()));
+            list->append(cssValuePool().createValue(style->flexShrink()));
 
-            Length preferredSize = style->flexPreferredSize();
-            if (preferredSize.isAuto())
+            Length flexBasis = style->flexBasis();
+            if (flexBasis.isAuto())
                 list->append(cssValuePool().createIdentifierValue(CSSValueAuto));
-            else if (preferredSize.isPercent())
-                list->append(cssValuePool().createValue(preferredSize.value(), CSSPrimitiveValue::CSS_PERCENTAGE));
+            else if (flexBasis.isPercent())
+                list->append(cssValuePool().createValue(flexBasis.value(), CSSPrimitiveValue::CSS_PERCENTAGE));
             else
-                list->append(cssValuePool().createValue(preferredSize.value(), CSSPrimitiveValue::CSS_PX));
+                list->append(cssValuePool().createValue(flexBasis.value(), CSSPrimitiveValue::CSS_PX));
 
             return list.release();
         }

Modified: trunk/Source/WebCore/css/StyleBuilder.cpp (120779 => 120780)


--- trunk/Source/WebCore/css/StyleBuilder.cpp	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/css/StyleBuilder.cpp	2012-06-20 00:40:39 UTC (rev 120780)
@@ -1707,16 +1707,16 @@
 public:
     static void applyInheritValue(StyleResolver* styleResolver)
     {
-        ApplyPropertyDefaultBase<float, &RenderStyle::positiveFlex, float, &RenderStyle::setPositiveFlex, float, &RenderStyle::initialNegativeFlex>::applyInheritValue(styleResolver);
-        ApplyPropertyDefaultBase<float, &RenderStyle::negativeFlex, float, &RenderStyle::setNegativeFlex, float, &RenderStyle::initialPositiveFlex>::applyInheritValue(styleResolver);
-        ApplyPropertyDefaultBase<Length, &RenderStyle::flexPreferredSize, Length, &RenderStyle::setFlexPreferredSize, Length, &RenderStyle::initialFlexPreferredSize>::applyInheritValue(styleResolver);
+        ApplyPropertyDefaultBase<float, &RenderStyle::flexGrow, float, &RenderStyle::setFlexGrow, float, &RenderStyle::initialFlexGrow>::applyInheritValue(styleResolver);
+        ApplyPropertyDefaultBase<float, &RenderStyle::flexShrink, float, &RenderStyle::setFlexShrink, float, &RenderStyle::initialFlexShrink>::applyInheritValue(styleResolver);
+        ApplyPropertyDefaultBase<Length, &RenderStyle::flexBasis, Length, &RenderStyle::setFlexBasis, Length, &RenderStyle::initialFlexBasis>::applyInheritValue(styleResolver);
     }
 
     static void applyInitialValue(StyleResolver* styleResolver)
     {
-        styleResolver->style()->setPositiveFlex(RenderStyle::initialPositiveFlex());
-        styleResolver->style()->setNegativeFlex(RenderStyle::initialNegativeFlex());
-        styleResolver->style()->setFlexPreferredSize(RenderStyle::initialFlexPreferredSize());
+        styleResolver->style()->setFlexGrow(RenderStyle::initialFlexGrow());
+        styleResolver->style()->setFlexShrink(RenderStyle::initialFlexShrink());
+        styleResolver->style()->setFlexBasis(RenderStyle::initialFlexBasis());
     }
 
     static void applyValue(StyleResolver* styleResolver, CSSValue* value)
@@ -1724,9 +1724,9 @@
         if (value->isPrimitiveValue()) {
             CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
             if (primitiveValue->getIdent() == CSSValueNone) {
-                styleResolver->style()->setPositiveFlex(0);
-                styleResolver->style()->setNegativeFlex(0);
-                styleResolver->style()->setFlexPreferredSize(Length(Auto));
+                styleResolver->style()->setFlexGrow(0);
+                styleResolver->style()->setFlexShrink(0);
+                styleResolver->style()->setFlexBasis(Length(Auto));
             }
             return;
         }
@@ -1740,13 +1740,13 @@
         float flexValue = 0;
         if (!getFlexValue(valueList->itemWithoutBoundsCheck(0), flexValue))
             return;
-        styleResolver->style()->setPositiveFlex(flexValue);
+        styleResolver->style()->setFlexGrow(flexValue);
 
         if (!getFlexValue(valueList->itemWithoutBoundsCheck(1), flexValue))
             return;
-        styleResolver->style()->setNegativeFlex(flexValue);
+        styleResolver->style()->setFlexShrink(flexValue);
 
-        ApplyPropertyLength<&RenderStyle::flexPreferredSize, &RenderStyle::setFlexPreferredSize, &RenderStyle::initialFlexPreferredSize, AutoEnabled>::applyValue(styleResolver, valueList->itemWithoutBoundsCheck(2));
+        ApplyPropertyLength<&RenderStyle::flexBasis, &RenderStyle::setFlexBasis, &RenderStyle::initialFlexBasis, AutoEnabled>::applyValue(styleResolver, valueList->itemWithoutBoundsCheck(2));
     }
 
     static PropertyHandler createHandler()

Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (120779 => 120780)


--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2012-06-20 00:40:39 UTC (rev 120780)
@@ -917,14 +917,14 @@
         if (!a || !b)
             return false;
 
-        return a->flexPreferredSize() == b->flexPreferredSize() && a->positiveFlex() == b->positiveFlex() && a->negativeFlex() == b->negativeFlex();
+        return a->flexBasis() == b->flexBasis() && a->flexGrow() == b->flexGrow() && a->flexShrink() == b->flexShrink();
     }
 
     virtual void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const
     {
-        dst->setFlexPreferredSize(blendFunc(anim, a->flexPreferredSize(), b->flexPreferredSize(), progress));
-        dst->setPositiveFlex(blendFunc(anim, a->positiveFlex(), b->positiveFlex(), progress));
-        dst->setNegativeFlex(blendFunc(anim, a->negativeFlex(), b->negativeFlex(), progress));
+        dst->setFlexBasis(blendFunc(anim, a->flexBasis(), b->flexBasis(), progress));
+        dst->setFlexGrow(blendFunc(anim, a->flexGrow(), b->flexGrow(), progress));
+        dst->setFlexShrink(blendFunc(anim, a->flexShrink(), b->flexShrink(), progress));
     }
 };
 #endif

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (120779 => 120780)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2012-06-20 00:40:39 UTC (rev 120780)
@@ -337,9 +337,9 @@
     return style()->flexWrap() != FlexWrapNone;
 }
 
-Length RenderFlexibleBox::preferredLengthForChild(RenderBox* child) const
+Length RenderFlexibleBox::flexBasisForChild(RenderBox* child) const
 {
-    Length flexLength = child->style()->flexPreferredSize();
+    Length flexLength = child->style()->flexBasis();
     if (flexLength.isAuto())
         flexLength = isHorizontalFlow() ? child->style()->width() : child->style()->height();
     return flexLength;
@@ -579,12 +579,12 @@
 
 LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild(RenderBox* child) const
 {
-    Length mainAxisLength = preferredLengthForChild(child);
-    if (mainAxisLength.isAuto()) {
+    Length flexBasis = flexBasisForChild(child);
+    if (flexBasis.isAuto()) {
         LayoutUnit mainAxisExtent = hasOrthogonalFlow(child) ? child->logicalHeight() : child->maxPreferredLogicalWidth();
         return mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child);
     }
-    return std::max(LayoutUnit(0), minimumValueForLength(mainAxisLength, mainAxisContentExtent(), view()));
+    return std::max(LayoutUnit(0), minimumValueForLength(flexBasis, mainAxisContentExtent(), view()));
 }
 
 LayoutUnit RenderFlexibleBox::computeAvailableFreeSpace(LayoutUnit preferredMainAxisExtent)
@@ -614,18 +614,18 @@
 {
     OrderedFlexItemList orderedChildren;
     LayoutUnit preferredMainAxisExtent;
-    float totalPositiveFlexibility;
-    float totalWeightedNegativeFlexibility;
+    float totalFlexGrow;
+    float totalWeightedFlexShrink;
     LayoutUnit minMaxAppliedMainAxisExtent;
 
     LayoutUnit crossAxisOffset = flowAwareBorderBefore() + flowAwarePaddingBefore();
-    while (computeNextFlexLine(iterator, orderedChildren, preferredMainAxisExtent, totalPositiveFlexibility, totalWeightedNegativeFlexibility, minMaxAppliedMainAxisExtent)) {
+    while (computeNextFlexLine(iterator, orderedChildren, preferredMainAxisExtent, totalFlexGrow, totalWeightedFlexShrink, minMaxAppliedMainAxisExtent)) {
         LayoutUnit availableFreeSpace = computeAvailableFreeSpace(preferredMainAxisExtent);
         FlexSign flexSign = (minMaxAppliedMainAxisExtent < preferredMainAxisExtent + availableFreeSpace) ? PositiveFlexibility : NegativeFlexibility;
         InflexibleFlexItemSize inflexibleItems;
         WTF::Vector<LayoutUnit> childSizes;
-        while (!resolveFlexibleLengths(flexSign, orderedChildren, availableFreeSpace, totalPositiveFlexibility, totalWeightedNegativeFlexibility, inflexibleItems, childSizes)) {
-            ASSERT(totalPositiveFlexibility >= 0 && totalWeightedNegativeFlexibility >= 0);
+        while (!resolveFlexibleLengths(flexSign, orderedChildren, availableFreeSpace, totalFlexGrow, totalWeightedFlexShrink, inflexibleItems, childSizes)) {
+            ASSERT(totalFlexGrow >= 0 && totalWeightedFlexShrink >= 0);
             ASSERT(inflexibleItems.size() > 0);
         }
 
@@ -748,7 +748,7 @@
 
         child->clearOverrideSize();
         // Only need to layout here if we will need to get the logicalHeight of the child in computeNextFlexLine.
-        if (hasOrthogonalFlow(child) && preferredLengthForChild(child).isAuto()) {
+        if (hasOrthogonalFlow(child) && flexBasisForChild(child).isAuto()) {
             if (!relayoutChildren)
                 child->setChildNeedsLayout(true);
             child->layoutIfNeeded();
@@ -794,11 +794,11 @@
     return childSize;
 }
 
-bool RenderFlexibleBox::computeNextFlexLine(OrderIterator& iterator, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalPositiveFlexibility, float& totalWeightedNegativeFlexibility, LayoutUnit& minMaxAppliedMainAxisExtent)
+bool RenderFlexibleBox::computeNextFlexLine(OrderIterator& iterator, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalFlexGrow, float& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent)
 {
     orderedChildren.clear();
     preferredMainAxisExtent = 0;
-    totalPositiveFlexibility = totalWeightedNegativeFlexibility = 0;
+    totalFlexGrow = totalWeightedFlexShrink = 0;
     minMaxAppliedMainAxisExtent = 0;
 
     if (!iterator.currentChild())
@@ -821,8 +821,8 @@
             break;
         orderedChildren.append(child);
         preferredMainAxisExtent += childMainAxisMarginBoxExtent;
-        totalPositiveFlexibility += child->style()->positiveFlex();
-        totalWeightedNegativeFlexibility += child->style()->negativeFlex() * childMainAxisExtent;
+        totalFlexGrow += child->style()->flexGrow();
+        totalWeightedFlexShrink += child->style()->flexShrink() * childMainAxisExtent;
 
         LayoutUnit childMinMaxAppliedMainAxisExtent = adjustChildSizeForMinAndMax(child, childMainAxisExtent, flexboxAvailableContentExtent);
         minMaxAppliedMainAxisExtent += childMinMaxAppliedMainAxisExtent - childMainAxisExtent + childMainAxisMarginBoxExtent;
@@ -830,21 +830,21 @@
     return true;
 }
 
-void RenderFlexibleBox::freezeViolations(const WTF::Vector<Violation>& violations, LayoutUnit& availableFreeSpace, float& totalPositiveFlexibility, float& totalWeightedNegativeFlexibility, InflexibleFlexItemSize& inflexibleItems)
+void RenderFlexibleBox::freezeViolations(const WTF::Vector<Violation>& violations, LayoutUnit& availableFreeSpace, float& totalFlexGrow, float& totalWeightedFlexShrink, InflexibleFlexItemSize& inflexibleItems)
 {
     for (size_t i = 0; i < violations.size(); ++i) {
         RenderBox* child = violations[i].child;
         LayoutUnit childSize = violations[i].childSize;
         LayoutUnit preferredChildSize = preferredMainAxisContentExtentForChild(child);
         availableFreeSpace -= childSize - preferredChildSize;
-        totalPositiveFlexibility -= child->style()->positiveFlex();
-        totalWeightedNegativeFlexibility -= child->style()->negativeFlex() * preferredChildSize;
+        totalFlexGrow -= child->style()->flexGrow();
+        totalWeightedFlexShrink -= child->style()->flexShrink() * preferredChildSize;
         inflexibleItems.set(child, childSize);
     }
 }
 
 // Returns true if we successfully ran the algorithm and sized the flex items.
-bool RenderFlexibleBox::resolveFlexibleLengths(FlexSign flexSign, const OrderedFlexItemList& children, LayoutUnit& availableFreeSpace, float& totalPositiveFlexibility, float& totalWeightedNegativeFlexibility, InflexibleFlexItemSize& inflexibleItems, WTF::Vector<LayoutUnit>& childSizes)
+bool RenderFlexibleBox::resolveFlexibleLengths(FlexSign flexSign, const OrderedFlexItemList& children, LayoutUnit& availableFreeSpace, float& totalFlexGrow, float& totalWeightedFlexShrink, InflexibleFlexItemSize& inflexibleItems, WTF::Vector<LayoutUnit>& childSizes)
 {
     childSizes.clear();
     LayoutUnit flexboxAvailableContentExtent = mainAxisContentExtent();
@@ -864,10 +864,10 @@
         else {
             LayoutUnit preferredChildSize = preferredMainAxisContentExtentForChild(child);
             LayoutUnit childSize = preferredChildSize;
-            if (availableFreeSpace > 0 && totalPositiveFlexibility > 0 && flexSign == PositiveFlexibility && isfinite(totalPositiveFlexibility))
-                childSize += static_cast<int>(lroundf(availableFreeSpace * child->style()->positiveFlex() / totalPositiveFlexibility));
-            else if (availableFreeSpace < 0 && totalWeightedNegativeFlexibility > 0 && flexSign == NegativeFlexibility && isfinite(totalWeightedNegativeFlexibility))
-                childSize += static_cast<int>(lroundf(availableFreeSpace * child->style()->negativeFlex() * preferredChildSize / totalWeightedNegativeFlexibility));
+            if (availableFreeSpace > 0 && totalFlexGrow > 0 && flexSign == PositiveFlexibility && isfinite(totalFlexGrow))
+                childSize += static_cast<int>(lroundf(availableFreeSpace * child->style()->flexGrow() / totalFlexGrow));
+            else if (availableFreeSpace < 0 && totalWeightedFlexShrink > 0 && flexSign == NegativeFlexibility && isfinite(totalWeightedFlexShrink))
+                childSize += static_cast<int>(lroundf(availableFreeSpace * child->style()->flexShrink() * preferredChildSize / totalWeightedFlexShrink));
 
             LayoutUnit adjustedChildSize = adjustChildSizeForMinAndMax(child, childSize, flexboxAvailableContentExtent);
             childSizes.append(adjustedChildSize);
@@ -883,7 +883,7 @@
     }
 
     if (totalViolation)
-        freezeViolations(totalViolation < 0 ? maxViolations : minViolations, availableFreeSpace, totalPositiveFlexibility, totalWeightedNegativeFlexibility, inflexibleItems);
+        freezeViolations(totalViolation < 0 ? maxViolations : minViolations, availableFreeSpace, totalFlexGrow, totalWeightedFlexShrink, inflexibleItems);
     else
         availableFreeSpace -= usedFreeSpace;
 

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.h (120779 => 120780)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.h	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.h	2012-06-20 00:40:39 UTC (rev 120780)
@@ -73,7 +73,7 @@
     bool isLeftToRightFlow() const;
     bool isMultiline() const;
     Length crossAxisLength() const;
-    Length preferredLengthForChild(RenderBox* child) const;
+    Length flexBasisForChild(RenderBox* child) const;
     void setCrossAxisExtent(LayoutUnit);
     LayoutUnit crossAxisExtentForChild(RenderBox* child);
     LayoutUnit mainAxisExtentForChild(RenderBox* child);
@@ -117,11 +117,11 @@
     void computeMainAxisPreferredSizes(bool relayoutChildren, OrderHashSet&);
     LayoutUnit lineBreakLength();
     LayoutUnit adjustChildSizeForMinAndMax(RenderBox*, LayoutUnit childSize, LayoutUnit flexboxAvailableContentExtent);
-    bool computeNextFlexLine(OrderIterator&, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalPositiveFlexibility, float& totalWeightedNegativeFlexibility, LayoutUnit& minMaxAppliedMainAxisExtent);
+    bool computeNextFlexLine(OrderIterator&, OrderedFlexItemList& orderedChildren, LayoutUnit& preferredMainAxisExtent, float& totalFlexGrow, float& totalWeightedFlexShrink, LayoutUnit& minMaxAppliedMainAxisExtent);
     LayoutUnit computeAvailableFreeSpace(LayoutUnit preferredMainAxisExtent);
 
-    bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit& availableFreeSpace, float& totalPositiveFlexibility, float& totalWeightedNegativeFlexibility, InflexibleFlexItemSize&, WTF::Vector<LayoutUnit>& childSizes);
-    void freezeViolations(const WTF::Vector<Violation>&, LayoutUnit& availableFreeSpace, float& totalPositiveFlexibility, float& totalWeightedNegativeFlexibility, InflexibleFlexItemSize&);
+    bool resolveFlexibleLengths(FlexSign, const OrderedFlexItemList&, LayoutUnit& availableFreeSpace, float& totalFlexGrow, float& totalWeightedFlexShrink, InflexibleFlexItemSize&, WTF::Vector<LayoutUnit>& childSizes);
+    void freezeViolations(const WTF::Vector<Violation>&, LayoutUnit& availableFreeSpace, float& totalFlexGrow, float& totalWeightedFlexShrink, InflexibleFlexItemSize&);
 
     void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize);
     void prepareChildForPositionedLayout(RenderBox* child, LayoutUnit mainAxisOffset, LayoutUnit crossAxisOffset, PositionedLayoutMode);

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (120779 => 120780)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-06-20 00:40:39 UTC (rev 120780)
@@ -815,9 +815,9 @@
     EBoxPack boxPack() const { return static_cast<EBoxPack>(rareNonInheritedData->m_deprecatedFlexibleBox->pack); }
 
     float order() const { return rareNonInheritedData->m_order; }
-    float positiveFlex() const { return rareNonInheritedData->m_flexibleBox->m_positiveFlex; }
-    float negativeFlex() const { return rareNonInheritedData->m_flexibleBox->m_negativeFlex; }
-    Length flexPreferredSize() const { return rareNonInheritedData->m_flexibleBox->m_preferredSize; }
+    float flexGrow() const { return rareNonInheritedData->m_flexibleBox->m_flexGrow; }
+    float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_flexShrink; }
+    Length flexBasis() const { return rareNonInheritedData->m_flexibleBox->m_flexBasis; }
     EAlignContent alignContent() const { return static_cast<EAlignContent>(rareNonInheritedData->m_alignContent); }
     EAlignItems alignItems() const { return static_cast<EAlignItems>(rareNonInheritedData->m_alignItems); }
     EAlignItems alignSelf() const { return static_cast<EAlignItems>(rareNonInheritedData->m_alignSelf); }
@@ -1270,9 +1270,9 @@
     void setBoxShadow(PassOwnPtr<ShadowData>, bool add = false);
     void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
     void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
-    void setPositiveFlex(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_positiveFlex, f); }
-    void setNegativeFlex(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_negativeFlex, f); }
-    void setFlexPreferredSize(Length l) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_preferredSize, l); }
+    void setFlexGrow(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexGrow, f); }
+    void setFlexShrink(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexShrink, f); }
+    void setFlexBasis(Length length) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexBasis, length); }
     void setOrder(float o) { SET_VAR(rareNonInheritedData, m_order, o); }
     void setAlignContent(EAlignContent p) { SET_VAR(rareNonInheritedData, m_alignContent, p); }
     void setAlignItems(EAlignItems a) { SET_VAR(rareNonInheritedData, m_alignItems, a); }
@@ -1605,9 +1605,9 @@
     static unsigned int initialBoxOrdinalGroup() { return 1; }
     static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
     static StyleReflection* initialBoxReflect() { return 0; }
-    static float initialPositiveFlex() { return 0; }
-    static float initialNegativeFlex() { return 1; }
-    static Length initialFlexPreferredSize() { return Length(Auto); }
+    static float initialFlexGrow() { return 0; }
+    static float initialFlexShrink() { return 1; }
+    static Length initialFlexBasis() { return Length(Auto); }
     static float initialOrder() { return 0; }
     static EAlignContent initialAlignContent() { return AlignContentStretch; }
     static EAlignItems initialAlignItems() { return AlignStretch; }

Modified: trunk/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp (120779 => 120780)


--- trunk/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp	2012-06-20 00:40:39 UTC (rev 120780)
@@ -31,9 +31,9 @@
 namespace WebCore {
 
 StyleFlexibleBoxData::StyleFlexibleBoxData()
-    : m_positiveFlex(RenderStyle::initialPositiveFlex())
-    , m_negativeFlex(RenderStyle::initialNegativeFlex())
-    , m_preferredSize(RenderStyle::initialFlexPreferredSize())
+    : m_flexGrow(RenderStyle::initialFlexGrow())
+    , m_flexShrink(RenderStyle::initialFlexShrink())
+    , m_flexBasis(RenderStyle::initialFlexBasis())
     , m_flexDirection(RenderStyle::initialFlexDirection())
     , m_flexWrap(RenderStyle::initialFlexWrap())
 {
@@ -41,9 +41,9 @@
 
 StyleFlexibleBoxData::StyleFlexibleBoxData(const StyleFlexibleBoxData& o)
     : RefCounted<StyleFlexibleBoxData>()
-    , m_positiveFlex(o.m_positiveFlex)
-    , m_negativeFlex(o.m_negativeFlex)
-    , m_preferredSize(o.m_preferredSize)
+    , m_flexGrow(o.m_flexGrow)
+    , m_flexShrink(o.m_flexShrink)
+    , m_flexBasis(o.m_flexBasis)
     , m_flexDirection(o.m_flexDirection)
     , m_flexWrap(o.m_flexWrap)
 {
@@ -51,7 +51,7 @@
 
 bool StyleFlexibleBoxData::operator==(const StyleFlexibleBoxData& o) const
 {
-    return m_positiveFlex == o.m_positiveFlex && m_negativeFlex == o.m_negativeFlex && m_preferredSize == o.m_preferredSize
+    return m_flexGrow == o.m_flexGrow && m_flexShrink == o.m_flexShrink && m_flexBasis == o.m_flexBasis
         && m_flexDirection == o.m_flexDirection && m_flexWrap == o.m_flexWrap;
 }
 

Modified: trunk/Source/WebCore/rendering/style/StyleFlexibleBoxData.h (120779 => 120780)


--- trunk/Source/WebCore/rendering/style/StyleFlexibleBoxData.h	2012-06-20 00:25:40 UTC (rev 120779)
+++ trunk/Source/WebCore/rendering/style/StyleFlexibleBoxData.h	2012-06-20 00:40:39 UTC (rev 120780)
@@ -44,9 +44,9 @@
         return !(*this == o);
     }
 
-    float m_positiveFlex;
-    float m_negativeFlex;
-    Length m_preferredSize;
+    float m_flexGrow;
+    float m_flexShrink;
+    Length m_flexBasis;
 
     unsigned m_flexDirection : 2; // EFlexDirection
     unsigned m_flexWrap : 2; // EFlexWrap
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to