Changeset 174946 in webkit


Ignore:
Timestamp:
Oct 21, 2014 5:11:29 AM (9 years ago)
Author:
Manuel Rego Casasnovas
Message:

ASSERTION FAILED: !gridWasPopulated() in WebCore::RenderGrid::placeItemsOnGrid
https://bugs.webkit.org/show_bug.cgi?id=136939

Reviewed by Darin Adler.

Source/WebCore:

In some particular situations computeIntrinsicLogicalWidths() is called
in the middle of layoutGridItems(). In these cases we do not need to
populate the grid again, so we should avoid calling placeItemsOnGrid().
In addition, we do not need to clean the grid either, as that will be
done later by layoutGridItems().

Test: fast/css-grid-layout/grid-was-populated-assert.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Avoid calls to
placeItemsOnGrid() and clearGrid() if the grid was already populated.

  • rendering/RenderGrid.h: Move gridWasPopulated() header out of the

debug ifdefs.

LayoutTests:

Added a test case to reproduce the crash in debug mode.

  • fast/css-grid-layout/grid-was-populated-assert-expected.txt: Added.
  • fast/css-grid-layout/grid-was-populated-assert.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r174922 r174946  
     12014-10-21  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        ASSERTION FAILED: !gridWasPopulated() in WebCore::RenderGrid::placeItemsOnGrid
     4        https://bugs.webkit.org/show_bug.cgi?id=136939
     5
     6        Reviewed by Darin Adler.
     7
     8        Added a test case to reproduce the crash in debug mode.
     9
     10        * fast/css-grid-layout/grid-was-populated-assert-expected.txt: Added.
     11        * fast/css-grid-layout/grid-was-populated-assert.html: Added.
     12
    1132014-10-17  Jeffrey Pfau  <jpfau@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r174931 r174946  
     12014-10-21  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        ASSERTION FAILED: !gridWasPopulated() in WebCore::RenderGrid::placeItemsOnGrid
     4        https://bugs.webkit.org/show_bug.cgi?id=136939
     5
     6        Reviewed by Darin Adler.
     7
     8        In some particular situations computeIntrinsicLogicalWidths() is called
     9        in the middle of layoutGridItems(). In these cases we do not need to
     10        populate the grid again, so we should avoid calling placeItemsOnGrid().
     11        In addition, we do not need to clean the grid either, as that will be
     12        done later by layoutGridItems().
     13
     14        Test: fast/css-grid-layout/grid-was-populated-assert.html
     15
     16        * rendering/RenderGrid.cpp:
     17        (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Avoid calls to
     18        placeItemsOnGrid() and clearGrid() if the grid was already populated.
     19        * rendering/RenderGrid.h: Move gridWasPopulated() header out of the
     20        debug ifdefs.
     21
    1222014-10-21  Zan Dobersek  <zdobersek@igalia.com>
    223
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r174643 r174946  
    243243void RenderGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
    244244{
    245     const_cast<RenderGrid*>(this)->placeItemsOnGrid();
     245    bool wasPopulated = gridWasPopulated();
     246    if (!wasPopulated)
     247        const_cast<RenderGrid*>(this)->placeItemsOnGrid();
    246248
    247249    GridSizingData sizingData(gridColumnCount(), gridRowCount());
     
    260262    }
    261263
    262     const_cast<RenderGrid*>(this)->clearGrid();
     264    if (!wasPopulated)
     265        const_cast<RenderGrid*>(this)->clearGrid();
    263266}
    264267
  • trunk/Source/WebCore/rendering/RenderGrid.h

    r174643 r174946  
    111111#ifndef NDEBUG
    112112    bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, const Vector<GridTrack>&);
     113#endif
     114
    113115    bool gridWasPopulated() const { return !m_grid.isEmpty() && !m_grid[0].isEmpty(); }
    114 #endif
    115116
    116117    size_t gridColumnCount() const
Note: See TracChangeset for help on using the changeset viewer.