Changeset 182780 in webkit for trunk/Source/WebCore/ChangeLog


Ignore:
Timestamp:
Apr 13, 2015, 9:59:09 PM (11 years ago)
Author:
Manuel Rego Casasnovas
Message:

[CSS Grid Layout] Columns set in percentages collapse to auto width
https://bugs.webkit.org/show_bug.cgi?id=141435

Reviewed by David Hyatt.

Source/WebCore:

Based on a patch by Sergio Villar Senin <svillar@igalia.com>.

This patch adds 2 new new methods in RenderBox to determine if the grid
has a definite size or not.

RenderGrid::gridTrackSize() was not checking properly if the grid has or
not an indefinite size.
The condition was including auto which is not indefinite per se. For
example, auto is definite if the containing block is definite.
As the new method is more expensive, we just call it when it's really
needed to avoid performance regressions.

Finally we were setting the override logical width/height to -1 (no
possible resolution) for all the items regardless if they've a relative
width/height or a fixed one.
Added the condition, including not only items with percentage logical
width/height but also relative, to avoid overriding the value for items
with fixed width/height as it's not needed.

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

fast/css-grid-layout/percent-intrinsic-track-breadth.html
fast/css-grid-layout/percent-track-breadths-regarding-container-size.html

  • rendering/RenderBox.cpp:

(WebCore::logicalWidthIsResolvable):
(WebCore::RenderBox::hasDefiniteLogicalWidth):
(WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
(WebCore::RenderBox::hasRelativeLogicalWidth):

  • rendering/RenderBox.h:
  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::hasDefiniteLogicalSize):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::logicalContentHeightForChild):
(WebCore::RenderGrid::minContentForChild):
(WebCore::RenderGrid::maxContentForChild):

  • rendering/RenderGrid.h:

LayoutTests:

Added new tests to check that percentage track breadths are properly
calculated under different sizing conditions.
Modified one test to include relative sizes too.

  • 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/percent-intrinsic-track-breadth-expected.txt: Added.
  • fast/css-grid-layout/percent-intrinsic-track-breadth.html: Added.
  • fast/css-grid-layout/percent-track-breadths-regarding-container-size-expected.txt: Added.
  • fast/css-grid-layout/percent-track-breadths-regarding-container-size.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r182773 r182780  
     12015-04-13  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [CSS Grid Layout] Columns set in percentages collapse to auto width
     4        https://bugs.webkit.org/show_bug.cgi?id=141435
     5
     6        Reviewed by David Hyatt.
     7
     8        Based on a patch by Sergio Villar Senin  <svillar@igalia.com>.
     9
     10        This patch adds 2 new new methods in RenderBox to determine if the grid
     11        has a definite size or not.
     12
     13        RenderGrid::gridTrackSize() was not checking properly if the grid has or
     14        not an indefinite size.
     15        The condition was including auto which is not indefinite per se. For
     16        example, auto is definite if the containing block is definite.
     17        As the new method is more expensive, we just call it when it's really
     18        needed to avoid performance regressions.
     19
     20        Finally we were setting the override logical width/height to -1 (no
     21        possible resolution) for all the items regardless if they've a relative
     22        width/height or a fixed one.
     23        Added the condition, including not only items with percentage logical
     24        width/height but also relative, to avoid overriding the value for items
     25        with fixed width/height as it's not needed.
     26
     27        Tests: fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html
     28               fast/css-grid-layout/percent-intrinsic-track-breadth.html
     29               fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
     30
     31        * rendering/RenderBox.cpp:
     32        (WebCore::logicalWidthIsResolvable):
     33        (WebCore::RenderBox::hasDefiniteLogicalWidth):
     34        (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
     35        (WebCore::RenderBox::hasRelativeLogicalWidth):
     36        * rendering/RenderBox.h:
     37        * rendering/RenderGrid.cpp:
     38        (WebCore::RenderGrid::hasDefiniteLogicalSize):
     39        (WebCore::RenderGrid::gridTrackSize):
     40        (WebCore::RenderGrid::logicalContentHeightForChild):
     41        (WebCore::RenderGrid::minContentForChild):
     42        (WebCore::RenderGrid::maxContentForChild):
     43        * rendering/RenderGrid.h:
     44
    1452015-04-13  Chris Dumez  <cdumez@apple.com>
    246
Note: See TracChangeset for help on using the changeset viewer.