Ignore:
Timestamp:
Feb 24, 2014, 2:29:20 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS Grid Layout] handle undefined RemainingSpace in computeUsedBreadthOfGridTracks algorithm
https://bugs.webkit.org/show_bug.cgi?id=128372

Patch by Javier Fernandez <jfernandez@igalia.com> on 2014-02-24
Reviewed by David Hyatt.

From Blink r165692 by <svillar@igalia.com>

Source/WebCore:

The spec defines a different code path for the computeUsedBreadthOfGridTracks algorithm
http://dev.w3.org/csswg/css-grid/#function-ComputeUsedBreadthOfGridTracks.

Basically the track breadth is different when the available size is undefined and thus,
cannot be taken into account during the computations.
The available size is undefined whenever the height is auto or the grid element has a
shrink-to-fit behavior.

It was also renamed the function to match the specs so the function name starts with
'compute' instead of 'computed'.

No new tests, but added new cases to some of them.

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::gridElementIsShrinkToFit):
(WebCore::RenderGrid::computeNormalizedFractionBreadth):
(WebCore::RenderGrid::layoutGridItems):

  • rendering/RenderGrid.h:

LayoutTests:

Adapt tests to consider also cases for undefined RemainingSpace.

  • fast/css-grid-layout/flex-and-minmax-content-resolution-rows-expected.txt:
  • fast/css-grid-layout/flex-and-minmax-content-resolution-rows.html:
  • fast/css-grid-layout/flex-content-resolution-rows-expected.txt:
  • fast/css-grid-layout/flex-content-resolution-rows.html:
  • fast/css-grid-layout/grid-auto-columns-rows-update-expected.txt:
  • fast/css-grid-layout/grid-auto-columns-rows-update.html:
  • fast/css-grid-layout/grid-dynamic-updates-relayout-expected.txt:
  • fast/css-grid-layout/grid-dynamic-updates-relayout.html:
  • fast/css-grid-layout/grid-item-addition-track-breadth-update-expected.txt:
  • fast/css-grid-layout/grid-item-addition-track-breadth-update.html:
  • fast/css-grid-layout/grid-item-multiple-minmax-content-resolution-expected.txt:
  • fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html:
  • fast/css-grid-layout/grid-item-removal-track-breadth-update-expected.txt:
  • fast/css-grid-layout/grid-item-removal-track-breadth-update.html:
  • fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution-expected.txt:
  • fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html:
  • fast/css-grid-layout/implicit-position-dynamic-change-expected.txt:
  • fast/css-grid-layout/implicit-position-dynamic-change.html:
  • fast/css-grid-layout/minmax-max-content-resolution-rows-expected.txt:
  • fast/css-grid-layout/minmax-max-content-resolution-rows.html:
  • fast/css-grid-layout/minmax-min-content-column-resolution-rows-expected.txt:
  • fast/css-grid-layout/minmax-min-content-column-resolution-rows.html:
  • fast/css-grid-layout/minmax-spanning-resolution-rows-expected.txt:
  • fast/css-grid-layout/minmax-spanning-resolution-rows.html:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/fast/css-grid-layout/minmax-max-content-resolution-rows.html

    r163625 r164609  
    3434
    3535<div class="constrainedContainer">
     36    <div class="grid gridMinMaxContent" style="height: 100%">
     37        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX XX XX</div>
     38    </div>
     39</div>
     40
     41<div class="constrainedContainer">
    3642    <div class="grid gridMinMaxContent">
    37         <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX XX XX</div>
     43        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="50">XX XX XX</div>
    3844    </div>
    3945</div>
     
    4652
    4753<div class="constrainedContainer">
    48     <div class="grid gridMinMaxContent">
     54    <div class="grid gridMinMaxContent" style="height: 100%">
    4955        <!-- The 'max' logical width ends up being smaller than the 'min' so per the spec we ignore the 'max'. -->
    5056        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="80">XX XX XX XX XX XX XX XX</div>
     57    </div>
     58</div>
     59
     60<div class="constrainedContainer">
     61    <div class="grid gridMinMaxContent">
     62        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="50">XX XX XX XX XX XX XX XX</div>
    5163    </div>
    5264</div>
     
    6072
    6173<div style="width: 10px; height: 100px;">
     74    <div class="grid gridMinMaxContent" style="height: 100%">
     75        <!-- The 'max' logical width ends up being smaller than the 'min' so per the spec we ignore the 'max'. -->
     76        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="80">XX XX XX XX XX XX XX XX</div>
     77    </div>
     78</div>
     79
     80<div style="width: 10px; height: 100px;">
    6281    <div class="grid gridMinMaxContent">
    6382        <!-- The 'max' logical width ends up being smaller than the 'min' so per the spec we ignore the 'max'. -->
    64         <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="80">XX XX XX XX XX XX XX XX</div>
     83        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="50">XX XX XX XX XX XX XX XX</div>
    6584    </div>
    6685</div>
     
    7998
    8099<div class="constrainedContainer">
     100    <div class="grid gridMaxMaxContent" style="height: 100%">
     101        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX XX XX XX XX</div>
     102    </div>
     103</div>
     104
     105<div class="constrainedContainer">
    81106    <div class="grid gridMaxMaxContent">
    82         <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX XX XX XX XX</div>
     107        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="50">XX XX XX XX XX</div>
    83108    </div>
    84109</div>
     
    93118
    94119<div style="width: 100px; height: 20px">
    95     <div class="grid gridMaxMaxContent">
     120    <div class="grid gridMaxMaxContent" style="height: 100%">
    96121        <!-- The 'max' logical width ends up being smaller than the 'min' so per the spec we ignore the 'max'. -->
    97122        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="30">XX XX XX XX XX</div>
     
    99124</div>
    100125
     126<div style="width: 100px; height: 20px">
     127    <div class="grid gridMaxMaxContent">
     128        <div class="firstRowFirstColumn" data-expected-width="20" data-expected-height="50">XX XX XX XX XX</div>
     129    </div>
     130</div>
     131
    101132</body>
    102133</html>
Note: See TracChangeset for help on using the changeset viewer.