Changeset 141317 in webkit


Ignore:
Timestamp:
Jan 30, 2013 2:41:59 PM (11 years ago)
Author:
jchaffraix@webkit.org
Message:

[CSS Grid Layout] Support 'auto' sized grid items
https://bugs.webkit.org/show_bug.cgi?id=103332

Reviewed by Tony Chang.

Source/WebCore:

Tests: fast/css-grid-layout/auto-content-resolution-columns.html

fast/css-grid-layout/auto-content-resolution-rows.html

The specification interprets 'auto' as minmax(min-content, max-content).
Because we stored the grid definitions as an 'auto' length, we wouldn't
handle it properly during layout.

This change makes us do the translation when we query the information for
layout.

  • rendering/style/GridTrackSize.h:

(WebCore::GridTrackSize::minTrackBreadth):
(WebCore::GridTrackSize::maxTrackBreadth):
Translate 'auto' to minmax(min-content, max-content). This works as getComputedStyle
still sees the GridTrackSize as a single length and thus query length() instead of the
individual component of minmax().

LayoutTests:

  • fast/css-grid-layout/auto-content-resolution-columns-expected.txt: Added.
  • fast/css-grid-layout/auto-content-resolution-columns.html: Added.
  • fast/css-grid-layout/auto-content-resolution-rows-expected.txt: Added.
  • fast/css-grid-layout/auto-content-resolution-rows.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141316 r141317  
     12013-01-30  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        [CSS Grid Layout] Support 'auto' sized grid items
     4        https://bugs.webkit.org/show_bug.cgi?id=103332
     5
     6        Reviewed by Tony Chang.
     7
     8        * fast/css-grid-layout/auto-content-resolution-columns-expected.txt: Added.
     9        * fast/css-grid-layout/auto-content-resolution-columns.html: Added.
     10        * fast/css-grid-layout/auto-content-resolution-rows-expected.txt: Added.
     11        * fast/css-grid-layout/auto-content-resolution-rows.html: Added.
     12
    1132013-01-30  Alec Flett  <alecflett@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r141316 r141317  
     12013-01-30  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        [CSS Grid Layout] Support 'auto' sized grid items
     4        https://bugs.webkit.org/show_bug.cgi?id=103332
     5
     6        Reviewed by Tony Chang.
     7
     8        Tests: fast/css-grid-layout/auto-content-resolution-columns.html
     9               fast/css-grid-layout/auto-content-resolution-rows.html
     10
     11        The specification interprets 'auto' as minmax(min-content, max-content).
     12        Because we stored the grid definitions as an 'auto' length, we wouldn't
     13        handle it properly during layout.
     14
     15        This change makes us do the translation when we query the information for
     16        layout.
     17
     18        * rendering/style/GridTrackSize.h:
     19        (WebCore::GridTrackSize::minTrackBreadth):
     20        (WebCore::GridTrackSize::maxTrackBreadth):
     21        Translate 'auto' to minmax(min-content, max-content). This works as getComputedStyle
     22        still sees the GridTrackSize as a single length and thus query length() instead of the
     23        individual component of minmax().
     24
    1252013-01-30  Alec Flett  <alecflett@chromium.org>
    226
  • trunk/Source/WebCore/rendering/style/GridTrackSize.h

    r139025 r141317  
    6868    {
    6969        ASSERT(!m_minTrackBreadth.isUndefined());
     70        if (m_minTrackBreadth.isAuto()) {
     71            DEFINE_STATIC_LOCAL(Length, minContent, (MinContent));
     72            return minContent;
     73        }
    7074        return m_minTrackBreadth;
    7175    }
     
    7478    {
    7579        ASSERT(!m_maxTrackBreadth.isUndefined());
     80        if (m_maxTrackBreadth.isAuto()) {
     81            DEFINE_STATIC_LOCAL(Length, maxContent, (MaxContent));
     82            return maxContent;
     83        }
    7684        return m_maxTrackBreadth;
    7785    }
Note: See TracChangeset for help on using the changeset viewer.