Changeset 146697 in webkit


Ignore:
Timestamp:
Mar 22, 2013 6:07:17 PM (11 years ago)
Author:
jchaffraix@webkit.org
Message:

[CSS Grid Layout] content-sized row tracks with percentage logical height grid items don't resolve properly
https://bugs.webkit.org/show_bug.cgi?id=113085

Reviewed by Tony Chang.

Source/WebCore:

The core issue is that because overrideContainingBlockLogicalHeight() is unset in
logicalContentHeightForChild, RenderBox::computePercentageLogicalHeight would try to
resolve percentage logical height against the grid element (wrong containing block
as a grid item's containing block is the grid area).

Tests: fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html

fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::logicalContentHeightForChild):
Set our override logical height to -1, so that we don't try to constrain a grid item's logical height
based on resolving (badly) its percentage.

LayoutTests:

  • fast/css-grid-layout/grid-auto-columns-rows-auto-flow-resolution-expected.txt:

Updated the result to pass.

  • fast/css-grid-layout/grid-item-multiple-minmax-content-resolution-expected.txt: Added.
  • fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html: Added.
  • fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution-expected.txt: Added.
  • fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html: Added.

Added more testing to ensure that we properly do the resolution.

Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r146696 r146697  
     12013-03-22  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        [CSS Grid Layout] content-sized row tracks with percentage logical height grid items don't resolve properly
     4        https://bugs.webkit.org/show_bug.cgi?id=113085
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/css-grid-layout/grid-auto-columns-rows-auto-flow-resolution-expected.txt:
     9        Updated the result to pass.
     10
     11        * fast/css-grid-layout/grid-item-multiple-minmax-content-resolution-expected.txt: Added.
     12        * fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html: Added.
     13        * fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution-expected.txt: Added.
     14        * fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html: Added.
     15        Added more testing to ensure that we properly do the resolution.
     16
    1172013-03-22  Stephen Chenney  <schenney@chromium.org>
    218
  • trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-auto-flow-resolution-expected.txt

    r146467 r146697  
    1919PASS
    2020XXXXX XXXXXX
    21 FAIL:
    22 Expected 20 for height, but got 1000.
    23 
    24 <div class="grid gridAutoMinMaxContent gridAutoFlowColumn">
    25         <div class="sizedToGridArea autoRowFirstColumn" data-offset-x="0" data-offset-y="5" data-expected-width="10" data-expected-height="20">XXXXX XXXXXX</div>
    26         <div class="sizedToGridArea firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="5"></div>
    27     </div>
    28 XXXXX XXXXXX
    29 FAIL:
    30 Expected 20 for height, but got 1000.
    31 
    32 <div class="grid gridAutoMinMaxContent gridAutoFlowRow">
    33         <div class="sizedToGridArea autoRowFirstColumn" data-offset-x="0" data-offset-y="5" data-expected-width="10" data-expected-height="20">XXXXX XXXXXX</div>
    34         <div class="sizedToGridArea firstRowFirstColumn" data-offset-x="0" data-offset-y="0" data-expected-width="10" data-expected-height="5"></div>
    35     </div>
     21PASS
    3622XXXXX XXXXXX
    3723PASS
     24XXXXX XXXXXX
     25PASS
  • trunk/Source/WebCore/ChangeLog

    r146694 r146697  
     12013-03-22  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        [CSS Grid Layout] content-sized row tracks with percentage logical height grid items don't resolve properly
     4        https://bugs.webkit.org/show_bug.cgi?id=113085
     5
     6        Reviewed by Tony Chang.
     7
     8        The core issue is that because overrideContainingBlockLogicalHeight() is unset in
     9        logicalContentHeightForChild, RenderBox::computePercentageLogicalHeight would try to
     10        resolve percentage logical height against the grid element (wrong containing block
     11        as a grid item's containing block is the grid area).
     12
     13        Tests: fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html
     14               fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html
     15
     16        * rendering/RenderGrid.cpp:
     17        (WebCore::RenderGrid::logicalContentHeightForChild):
     18        Set our override logical height to -1, so that we don't try to constrain a grid item's logical height
     19        based on resolving (badly) its percentage.
     20
    1212013-03-19  Zhenyao Mo  <zmo@google.com>
    222
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r146482 r146697  
    373373
    374374    child->setOverrideContainingBlockContentLogicalWidth(gridAreaBreadthForChild(child, ForColumns, columnTracks));
    375     child->clearOverrideContainingBlockContentLogicalHeight();
     375    // If |child| has a percentage logical height, we shouldn't let it override its intrinsic height, which is
     376    // what we are interested in here. Thus we need to set the override logical height to -1 (no possible resolution).
     377    child->setOverrideContainingBlockContentLogicalHeight(-1);
    376378    child->layout();
    377379    return child->logicalHeight();
Note: See TracChangeset for help on using the changeset viewer.