Changeset 191879 in webkit


Ignore:
Timestamp:
Nov 2, 2015 1:02:50 AM (8 years ago)
Author:
svillar@igalia.com
Message:

[CSS Grid Layout] min-content row does not always shrink
https://bugs.webkit.org/show_bug.cgi?id=144581

Reviewed by Zalan Bujtas.

Source/WebCore:

Grid items height must be recomputed whenever the grid tracks
change if the items had been previously stretched. In those
cases we have to clear the override height and layout the item
with the new row size.

Tests: fast/css-grid-layout/min-content-row-must-shrink-when-column-grows.html

fast/css-grid-layout/relayout-indefinite-heights.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::logicalContentHeightForChild):

LayoutTests:

Based on Blink's r191001 by <jfernandez@igalia.com>.

  • fast/css-grid-layout/min-content-row-must-shrink-when-column-grows-expected.txt: Added.
  • fast/css-grid-layout/min-content-row-must-shrink-when-column-grows.html: Added.
  • fast/css-grid-layout/relayout-indefinite-heights-expected.txt: Added.
  • fast/css-grid-layout/relayout-indefinite-heights.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r191877 r191879  
     12015-10-29  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [CSS Grid Layout] min-content row does not always shrink
     4        https://bugs.webkit.org/show_bug.cgi?id=144581
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Based on Blink's r191001 by <jfernandez@igalia.com>.
     9
     10        * fast/css-grid-layout/min-content-row-must-shrink-when-column-grows-expected.txt: Added.
     11        * fast/css-grid-layout/min-content-row-must-shrink-when-column-grows.html: Added.
     12        * fast/css-grid-layout/relayout-indefinite-heights-expected.txt: Added.
     13        * fast/css-grid-layout/relayout-indefinite-heights.html: Added.
     14
    1152015-11-01  Brady Eidson  <beidson@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r191877 r191879  
     12015-10-29  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [CSS Grid Layout] min-content row does not always shrink
     4        https://bugs.webkit.org/show_bug.cgi?id=144581
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Grid items height must be recomputed whenever the grid tracks
     9        change if the items had been previously stretched. In those
     10        cases we have to clear the override height and layout the item
     11        with the new row size.
     12
     13        Tests: fast/css-grid-layout/min-content-row-must-shrink-when-column-grows.html
     14               fast/css-grid-layout/relayout-indefinite-heights.html
     15
     16        * rendering/RenderGrid.cpp:
     17        (WebCore::RenderGrid::logicalContentHeightForChild):
     18
    1192015-11-01  Brady Eidson  <beidson@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r191385 r191879  
    591591    Optional<LayoutUnit> oldOverrideContainingBlockContentLogicalWidth = child.hasOverrideContainingBlockLogicalWidth() ? child.overrideContainingBlockContentLogicalWidth() : LayoutUnit();
    592592    LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, columnTracks);
    593     if (child.hasRelativeLogicalHeight() || !oldOverrideContainingBlockContentLogicalWidth || oldOverrideContainingBlockContentLogicalWidth.value() != overrideContainingBlockContentLogicalWidth)
     593    if (child.hasOverrideLogicalContentHeight() || child.hasRelativeLogicalHeight() || !oldOverrideContainingBlockContentLogicalWidth || oldOverrideContainingBlockContentLogicalWidth.value() != overrideContainingBlockContentLogicalWidth)
    594594        child.setNeedsLayout(MarkOnlyThis);
    595595
     
    603603    if (child.hasRelativeLogicalHeight())
    604604        child.setOverrideContainingBlockContentLogicalHeight(Nullopt);
     605
    605606    child.layoutIfNeeded();
    606607    return child.logicalHeight() + child.marginLogicalHeight();
Note: See TracChangeset for help on using the changeset viewer.