Unreviewed, rolling out r143941.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 20:52:51 +0000 (20:52 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Feb 2013 20:52:51 +0000 (20:52 +0000)
http://trac.webkit.org/changeset/143941
https://bugs.webkit.org/show_bug.cgi?id=110901

This is a step in the wrong direction as it ties us to what
grid-{row|column} expect (see
https://bugs.webkit.org/show_bug.cgi?id=110777 for the right
direction) (Requested by jchaffraix on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-26

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridPosition):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/StyleResolver.cpp:
(WebCore::createGridPosition):
(WebCore::StyleResolver::applyProperty):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::maximumIndexInDirection):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::autoPlacementMajorAxisPositionForChild):
(WebCore::RenderGrid::autoPlacementMinorAxisPositionForChild):
* rendering/RenderGrid.h:
* rendering/style/GridPosition.h:
* rendering/style/RenderStyle.h:
* rendering/style/StyleGridItemData.h:
(StyleGridItemData):

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

Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h
Source/WebCore/rendering/style/GridPosition.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleGridItemData.h

index d7a0a4b..0c2843c 100644 (file)
@@ -1,3 +1,34 @@
+2013-02-26  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r143941.
+        http://trac.webkit.org/changeset/143941
+        https://bugs.webkit.org/show_bug.cgi?id=110901
+
+        This is a step in the wrong direction as it ties us to what
+        grid-{row|column} expect (see
+        https://bugs.webkit.org/show_bug.cgi?id=110777 for the right
+        direction) (Requested by jchaffraix on #webkit).
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::valueForGridPosition):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/StyleResolver.cpp:
+        (WebCore::createGridPosition):
+        (WebCore::StyleResolver::applyProperty):
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::maximumIndexInDirection):
+        (WebCore::RenderGrid::placeItemsOnGrid):
+        (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
+        (WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid):
+        (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
+        (WebCore::RenderGrid::autoPlacementMajorAxisPositionForChild):
+        (WebCore::RenderGrid::autoPlacementMinorAxisPositionForChild):
+        * rendering/RenderGrid.h:
+        * rendering/style/GridPosition.h:
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleGridItemData.h:
+        (StyleGridItemData):
+
 2013-02-26  Jer Noble  <jer.noble@apple.com>
 
         Unreviewed build fix; use correct macro for platform name in FeatureDefines.xcconfig.
index 8291748..2ae250c 100644 (file)
@@ -1067,12 +1067,6 @@ static PassRefPtr<CSSValue> valueForGridPosition(const GridPosition& position)
 
     return cssValuePool().createValue(position.integerPosition(), CSSPrimitiveValue::CSS_NUMBER);
 }
-
-static PassRefPtr<CSSValue> valueForGridPositions(const GridPositions& positions)
-{
-    return valueForGridPosition(positions.firstPosition());
-}
-
 static PassRefPtr<CSSValue> createTransitionPropertyValue(const Animation* animation)
 {
     RefPtr<CSSValue> propertyValue;
@@ -1931,9 +1925,9 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
             return valueForGridTrackList(style->gridRows(), style.get(), m_node->document()->renderView());
 
         case CSSPropertyWebkitGridColumn:
-            return valueForGridPositions(style->gridItemColumn());
+            return valueForGridPosition(style->gridItemColumn());
         case CSSPropertyWebkitGridRow:
-            return valueForGridPositions(style->gridItemRow());
+            return valueForGridPosition(style->gridItemRow());
 
         case CSSPropertyHeight:
             if (renderer) {
index 46db25a..6e739a3 100644 (file)
@@ -2696,7 +2696,7 @@ static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSiz
 }
 
 
-static bool createGridPositions(CSSValue* value, GridPositions& position)
+static bool createGridPosition(CSSValue* value, GridPosition& position)
 {
     // For now, we only accept: <integer> | 'auto'
     if (!value->isPrimitiveValue())
@@ -2707,7 +2707,7 @@ static bool createGridPositions(CSSValue* value, GridPositions& position)
         return true;
 
     ASSERT_WITH_SECURITY_IMPLICATION(primitiveValue->isNumber());
-    position.firstPosition().setIntegerPosition(primitiveValue->getIntValue());
+    position.setIntegerPosition(primitiveValue->getIntValue());
     return true;
 }
 
@@ -3567,15 +3567,15 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
     }
 
     case CSSPropertyWebkitGridColumn: {
-        GridPositions column;
-        if (!createGridPositions(value, column))
+        GridPosition column;
+        if (!createGridPosition(value, column))
             return;
         state.style()->setGridItemColumn(column);
         return;
     }
     case CSSPropertyWebkitGridRow: {
-        GridPositions row;
-        if (!createGridPositions(value, row))
+        GridPosition row;
+        if (!createGridPosition(value, row))
             return;
         state.style()->setGridItemRow(row);
         return;
index 8b62d60..f6b5cab 100644 (file)
@@ -334,14 +334,14 @@ size_t RenderGrid::maximumIndexInDirection(TrackSizingDirection direction) const
     size_t maximumIndex = std::max<size_t>(1, trackStyles.size());
 
     for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
-        const GridPositions& positions = (direction == ForColumns) ? child->style()->gridItemColumn() : child->style()->gridItemRow();
+        const GridPosition& position = (direction == ForColumns) ? child->style()->gridItemColumn() : child->style()->gridItemRow();
         // 'auto' items will need to be resolved in seperate phases anyway. Note that because maximumIndex is at least 1,
         // the grid-auto-flow == none case is automatically handled.
-        if (positions.firstPosition().isAuto())
+        if (position.isAuto())
             continue;
 
         // This function bypasses the cache (cachedGridCoordinate()) as it is used to build it.
-        maximumIndex = std::max(maximumIndex, resolveGridPositionFromStyle(positions.firstPosition()) + 1);
+        maximumIndex = std::max(maximumIndex, resolveGridPositionFromStyle(position) + 1);
     }
 
     return maximumIndex;
@@ -526,18 +526,18 @@ void RenderGrid::placeItemsOnGrid()
     Vector<RenderBox*> specifiedMajorAxisAutoGridItems;
     GridAutoFlow autoFlow = style()->gridAutoFlow();
     for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
-        const GridPositions& columnPositions = child->style()->gridItemColumn();
-        const GridPositions& rowPositions = child->style()->gridItemRow();
-        if (autoFlow != AutoFlowNone && (columnPositions.firstPosition().isAuto() || rowPositions.firstPosition().isAuto())) {
-            const GridPositions& majorAxisPositions = autoPlacementMajorAxisPositionsForChild(child);
-            if (majorAxisPositions.firstPosition().isAuto())
+        const GridPosition& columnPosition = child->style()->gridItemColumn();
+        const GridPosition& rowPosition = child->style()->gridItemRow();
+        if (autoFlow != AutoFlowNone && (columnPosition.isAuto() || rowPosition.isAuto())) {
+            const GridPosition& majorAxisPosition = autoPlacementMajorAxisPositionForChild(child);
+            if (majorAxisPosition.isAuto())
                 autoMajorAxisAutoGridItems.append(child);
             else
                 specifiedMajorAxisAutoGridItems.append(child);
             continue;
         }
-        size_t columnTrack = resolveGridPositionFromStyle(columnPositions.firstPosition());
-        size_t rowTrack = resolveGridPositionFromStyle(rowPositions.firstPosition());
+        size_t columnTrack = resolveGridPositionFromStyle(columnPosition);
+        size_t rowTrack = resolveGridPositionFromStyle(rowPosition);
         insertItemIntoGrid(child, rowTrack, columnTrack);
     }
 
@@ -558,9 +558,9 @@ void RenderGrid::placeItemsOnGrid()
 void RenderGrid::placeSpecifiedMajorAxisItemsOnGrid(Vector<RenderBox*> autoGridItems)
 {
     for (size_t i = 0; i < autoGridItems.size(); ++i) {
-        const GridPositions& majorAxisPositions = autoPlacementMajorAxisPositionsForChild(autoGridItems[i]);
-        ASSERT(!majorAxisPositions.firstPosition().isAuto());
-        GridIterator iterator(m_grid, autoPlacementMajorAxisDirection(), resolveGridPositionFromStyle(majorAxisPositions.firstPosition()));
+        const GridPosition& majorAxisPosition = autoPlacementMajorAxisPositionForChild(autoGridItems[i]);
+        ASSERT(!majorAxisPosition.isAuto());
+        GridIterator iterator(m_grid, autoPlacementMajorAxisDirection(), resolveGridPositionFromStyle(majorAxisPosition));
         if (OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {
             insertItemIntoGrid(autoGridItems[i], emptyGridArea->rowIndex, emptyGridArea->columnIndex);
             continue;
@@ -576,18 +576,18 @@ void RenderGrid::placeSpecifiedMajorAxisItemsOnGrid(Vector<RenderBox*> autoGridI
 void RenderGrid::placeAutoMajorAxisItemsOnGrid(Vector<RenderBox*> autoGridItems)
 {
     for (size_t i = 0; i < autoGridItems.size(); ++i) {
-        ASSERT(autoPlacementMajorAxisPositionsForChild(autoGridItems[i]).firstPosition().isAuto());
+        ASSERT(autoPlacementMajorAxisPositionForChild(autoGridItems[i]).isAuto());
         placeAutoMajorAxisItemOnGrid(autoGridItems[i]);
     }
 }
 
 void RenderGrid::placeAutoMajorAxisItemOnGrid(RenderBox* gridItem)
 {
-    ASSERT(autoPlacementMajorAxisPositionsForChild(gridItem).firstPosition().isAuto());
-    const GridPositions& minorAxisPositions = autoPlacementMinorAxisPositionsForChild(gridItem);
+    ASSERT(autoPlacementMajorAxisPositionForChild(gridItem).isAuto());
+    const GridPosition& minorAxisPosition = autoPlacementMinorAxisPositionForChild(gridItem);
     size_t minorAxisIndex = 0;
-    if (!minorAxisPositions.firstPosition().isAuto()) {
-        minorAxisIndex = resolveGridPositionFromStyle(minorAxisPositions.firstPosition());
+    if (!minorAxisPosition.isAuto()) {
+        minorAxisIndex = resolveGridPositionFromStyle(minorAxisPosition);
         GridIterator iterator(m_grid, autoPlacementMinorAxisDirection(), minorAxisIndex);
         if (OwnPtr<GridCoordinate> emptyGridArea = iterator.nextEmptyGridArea()) {
             insertItemIntoGrid(gridItem, emptyGridArea->rowIndex, emptyGridArea->columnIndex);
@@ -611,14 +611,14 @@ void RenderGrid::placeAutoMajorAxisItemOnGrid(RenderBox* gridItem)
     insertItemIntoGrid(gridItem, rowIndex, columnIndex);
 }
 
-const GridPositions& RenderGrid::autoPlacementMajorAxisPositionsForChild(const RenderBox* gridItem) const
+const GridPosition& RenderGrid::autoPlacementMajorAxisPositionForChild(const RenderBox* gridItem) const
 {
     GridAutoFlow flow = style()->gridAutoFlow();
     ASSERT(flow != AutoFlowNone);
     return (flow == AutoFlowColumn) ? gridItem->style()->gridItemColumn() : gridItem->style()->gridItemRow();
 }
 
-const GridPositions& RenderGrid::autoPlacementMinorAxisPositionsForChild(const RenderBox* gridItem) const
+const GridPosition& RenderGrid::autoPlacementMinorAxisPositionForChild(const RenderBox* gridItem) const
 {
     GridAutoFlow flow = style()->gridAutoFlow();
     ASSERT(flow != AutoFlowNone);
index b507149..62f15c3 100644 (file)
@@ -82,8 +82,8 @@ private:
     void placeSpecifiedMajorAxisItemsOnGrid(Vector<RenderBox*>);
     void placeAutoMajorAxisItemsOnGrid(Vector<RenderBox*>);
     void placeAutoMajorAxisItemOnGrid(RenderBox*);
-    const GridPositions& autoPlacementMajorAxisPositionsForChild(const RenderBox*) const;
-    const GridPositions& autoPlacementMinorAxisPositionsForChild(const RenderBox*) const;
+    const GridPosition& autoPlacementMajorAxisPositionForChild(const RenderBox*) const;
+    const GridPosition& autoPlacementMinorAxisPositionForChild(const RenderBox*) const;
     TrackSizingDirection autoPlacementMajorAxisDirection() const;
     TrackSizingDirection autoPlacementMinorAxisDirection() const;
 
index 382b72e..3f8fe97 100644 (file)
@@ -74,24 +74,6 @@ private:
     int m_integerPosition;
 };
 
-class GridPositions {
-public:
-    GridPositions()
-    {
-    }
-
-    const GridPosition& firstPosition() const { return m_firstPosition; }
-    GridPosition& firstPosition() { return m_firstPosition; }
-
-    bool operator==(const GridPositions& other) const
-    {
-        return m_firstPosition == other.m_firstPosition;
-    }
-
-private:
-    GridPosition m_firstPosition;
-};
-
 } // namespace WebCore
 
 #endif // GridPosition_h
index 322cb91..76d8b8d 100644 (file)
@@ -765,8 +765,8 @@ public:
     const Vector<GridTrackSize>& gridRows() const { return rareNonInheritedData->m_grid->m_gridRows; }
     GridAutoFlow gridAutoFlow() const { return rareNonInheritedData->m_grid->m_gridAutoFlow; }
 
-    const GridPositions& gridItemColumn() const { return rareNonInheritedData->m_gridItem->m_gridColumn; }
-    const GridPositions& gridItemRow() const { return rareNonInheritedData->m_gridItem->m_gridRow; }
+    const GridPosition& gridItemColumn() const { return rareNonInheritedData->m_gridItem->m_gridColumn; }
+    const GridPosition& gridItemRow() const { return rareNonInheritedData->m_gridItem->m_gridRow; }
 
     const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
     void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
@@ -1253,8 +1253,8 @@ public:
     void setGridColumns(const Vector<GridTrackSize>& lengths) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridColumns, lengths); }
     void setGridRows(const Vector<GridTrackSize>& lengths) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridRows, lengths); }
     void setGridAutoFlow(GridAutoFlow flow) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridAutoFlow, flow); }
-    void setGridItemColumn(const GridPositions& columnPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridColumn, columnPosition); }
-    void setGridItemRow(const GridPositions& rowPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridRow, rowPosition); }
+    void setGridItemColumn(const GridPosition& columnPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridColumn, columnPosition); }
+    void setGridItemRow(const GridPosition& rowPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridRow, rowPosition); }
 
     void setMarqueeIncrement(const Length& f) { SET_VAR(rareNonInheritedData.access()->m_marquee, increment, f); }
     void setMarqueeSpeed(int f) { SET_VAR(rareNonInheritedData.access()->m_marquee, speed, f); }
@@ -1663,9 +1663,9 @@ public:
 
     static GridAutoFlow initialGridAutoFlow() { return AutoFlowNone; }
 
-    // 'auto' / 'auto' is the default.
-    static GridPositions initialGridItemColumn() { return GridPositions(); }
-    static GridPositions initialGridItemRow() { return GridPositions(); }
+    // 'auto' is the default.
+    static GridPosition initialGridItemColumn() { return GridPosition(); }
+    static GridPosition initialGridItemRow() { return GridPosition(); }
 
     static unsigned initialTabSize() { return 8; }
 
index 3126db1..2f7487b 100644 (file)
@@ -54,8 +54,8 @@ public:
         return !(*this == o);
     }
 
-    GridPositions m_gridColumn;
-    GridPositions m_gridRow;
+    GridPosition m_gridColumn;
+    GridPosition m_gridRow;
 
 private:
     StyleGridItemData();