Changeset 208277 in webkit


Ignore:
Timestamp:
Nov 2, 2016 5:40:23 AM (7 years ago)
Author:
Manuel Rego Casasnovas
Message:

[css-grid] mimax(auto, <flex>) should be serialized as <flex>
https://bugs.webkit.org/show_bug.cgi?id=164316

Reviewed by Sergio Villar Senin.

Source/WebCore:

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
properly this case.

  • rendering/style/GridLength.h:

(WebCore::GridLength::isAuto): Add new function to check if GridLength
is or not "auto".

LayoutTests:

Add new test case to verify it. We can only check it
using grid-auto-columns|rows, because grid-template-columns|rows
is serialized to the used breadth.

  • fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt:
  • fast/css-grid-layout/grid-auto-columns-rows-get-set.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r208276 r208277  
     12016-11-02  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] mimax(auto, <flex>) should be serialized as <flex>
     4        https://bugs.webkit.org/show_bug.cgi?id=164316
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Add new test case to verify it. We can only check it
     9        using grid-auto-columns|rows, because grid-template-columns|rows
     10        is serialized to the used breadth.
     11
     12        * fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt:
     13        * fast/css-grid-layout/grid-auto-columns-rows-get-set.html:
     14
    1152016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
    216
  • trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set-expected.txt

    r205977 r208277  
    5353PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "fit-content(10px) fit-content(30%)"
    5454PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "fit-content(5%) fit-content(40px)"
     55PASS getComputedStyle(element, '').getPropertyValue('grid-auto-columns') is "2fr"
     56PASS getComputedStyle(element, '').getPropertyValue('grid-auto-rows') is "1fr"
    5557
    5658Test setting grid-auto-columns and grid-auto-rows to bad minmax value through JS
  • trunk/LayoutTests/fast/css-grid-layout/grid-auto-columns-rows-get-set.html

    r205977 r208277  
    124124testAutoValues("minmax(-webkit-min-content, 10px) 48px 5%", "auto 30px minmax(10%, 60%)");
    125125testAutoValues("fit-content(10px) fit-content(30%)", "fit-content(5%) fit-content(calc(20px + 2em))", "fit-content(10px) fit-content(30%)", "fit-content(5%) fit-content(40px)");
     126testAutoValues("minmax(auto, 2fr)", "minmax(auto, 1fr)", "2fr", "1fr");
    126127
    127128debug("");
  • trunk/Source/WebCore/ChangeLog

    r208276 r208277  
     12016-11-02  Manuel Rego Casasnovas  <rego@igalia.com>
     2
     3        [css-grid] mimax(auto, <flex>) should be serialized as <flex>
     4        https://bugs.webkit.org/show_bug.cgi?id=164316
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        * css/CSSComputedStyleDeclaration.cpp:
     9        (WebCore::specifiedValueForGridTrackSize): Add a simple if to serialize
     10        properly this case.
     11        * rendering/style/GridLength.h:
     12        (WebCore::GridLength::isAuto): Add new function to check if GridLength
     13        is or not "auto".
     14
    1152016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
    216
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r208253 r208277  
    10131013    default:
    10141014        ASSERT(trackSize.type() == MinMaxTrackSizing);
     1015        if (trackSize.minTrackBreadth().isAuto() && trackSize.maxTrackBreadth().isFlex())
     1016            return CSSValuePool::singleton().createValue(trackSize.maxTrackBreadth().flex(), CSSPrimitiveValue::CSS_FR);
     1017
    10151018        auto minMaxTrackBreadths = CSSValueList::createCommaSeparated();
    10161019        minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.minTrackBreadth(), style));
  • trunk/Source/WebCore/rendering/style/GridLength.h

    r184055 r208277  
    7373
    7474    bool isContentSized() const { return m_type == LengthType && (m_length.isAuto() || m_length.isMinContent() || m_length.isMaxContent()); }
     75    bool isAuto() const { return m_type == LengthType && m_length.isAuto(); }
    7576
    7677private:
Note: See TracChangeset for help on using the changeset viewer.