| Differences between
and this patch
- a/Source/WebCore/ChangeLog +60 lines
Lines 1-5 a/Source/WebCore/ChangeLog_sec1
1
2012-12-04  Julien Chaffraix  <jchaffraix@webkit.org>
1
2012-12-04  Julien Chaffraix  <jchaffraix@webkit.org>
2
2
3
        [CSS Grid Layout] Implement CSS parsing and handling for <track-minmax>
4
        https://bugs.webkit.org/show_bug.cgi?id=103799
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        This change adds support for:
9
        <track-minmax> => minmax( <track-breadth> , <track-breadth> ) | auto | <track-breadth>
10
        (note that we already supported auto | <track-breadth>).
11
12
        The change is mostly mechanical, the only newness is that GridTrackSize was updated to
13
        hold 2 Lengths internally and we map the single Length case to 2 by duplicating the value
14
        as this matches the rendering algorithm in the spec.
15
16
        Tests: fast/css-grid-layout/grid-columns-rows-get-set-multiple.html
17
               fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js
18
19
        * css/CSSComputedStyleDeclaration.cpp:
20
        (WebCore::valueForGridTrackBreadth):
21
        Changed the function to do the conversion of one track breadth (one Length).
22
        This was forgotten in the preparatory change in bug 103703.
23
24
        (WebCore::valueForGridTrackMinMax):
25
        Convert the value back using valueForGridTrackBreadth.
26
27
        * css/CSSFunctionValue.cpp:
28
        (WebCore::CSSFunctionValue::CSSFunctionValue):
29
        * css/CSSFunctionValue.h:
30
        (WebCore::CSSFunctionValue::create):
31
        (CSSFunctionValue):
32
        Added a new constructor. This enables us to return minmax(..., ...) when queried
33
        from JavaScript. I couldn't find a better way to serialize inside CSSComputedStyleDeclaration
34
        so that it properly match the function output.
35
36
        * css/CSSParser.cpp:
37
        (WebCore::CSSParser::parseGridTrackMinMax):
38
        Added parsing for the new syntax. We convert the 2 values into a Pair if we manage to
39
        parse both values correctly.
40
41
        * css/StyleResolver.cpp:
42
        (WebCore::createGridTrackMinMax):
43
        Updated to handle a Pair - for minmax - and set the 2 values on GridTrackSize.
44
45
        * rendering/RenderGrid.cpp:
46
        (WebCore::RenderGrid::computedUsedBreadthOfGridTracks):
47
        Updated to check the style. For now, we don't handle minmax values.
48
49
        * rendering/style/GridTrackSize.h:
50
        (WebCore::GridTrackSize::GridTrackSize):
51
        (WebCore::GridTrackSize::length):
52
        (WebCore::GridTrackSize::setLength):
53
        (WebCore::GridTrackSize::minTrackBreadth):
54
        (WebCore::GridTrackSize::maxTrackBreadth):
55
        (WebCore::GridTrackSize::setMinMax):
56
        (WebCore::GridTrackSize::operator==):
57
        Updated the class to handle minmax values. This means that we now always store
58
        2 values (the <length> case being a subset of minmax, however we kept the distinction
59
        to be able to reconstruct a <length> for getComputedStyle).
60
61
2012-12-04  Julien Chaffraix  <jchaffraix@webkit.org>
62
3
        Heap-use-after-free in WebCore::RenderLayer::paintList [MathML]
63
        Heap-use-after-free in WebCore::RenderLayer::paintList [MathML]
4
        https://bugs.webkit.org/show_bug.cgi?id=100764
64
        https://bugs.webkit.org/show_bug.cgi?id=100764
5
65
- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp -6 / +17 lines
Lines 30-35 a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec1
30
#include "CSSAspectRatioValue.h"
30
#include "CSSAspectRatioValue.h"
31
#include "CSSBasicShapes.h"
31
#include "CSSBasicShapes.h"
32
#include "CSSBorderImage.h"
32
#include "CSSBorderImage.h"
33
#include "CSSFunctionValue.h"
33
#include "CSSLineBoxContainValue.h"
34
#include "CSSLineBoxContainValue.h"
34
#include "CSSParser.h"
35
#include "CSSParser.h"
35
#include "CSSPrimitiveValue.h"
36
#include "CSSPrimitiveValue.h"
Lines 999-1016 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForFilter(const RenderObj a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp_sec2
999
}
1000
}
1000
#endif
1001
#endif
1001
1002
1002
static PassRefPtr<CSSValue> valueForGridTrackBreadth(const GridTrackSize& trackSize, const RenderStyle* style, RenderView *renderView)
1003
static PassRefPtr<CSSValue> valueForGridTrackBreadth(const Length& trackBreadth, const RenderStyle* style, RenderView *renderView)
1003
{
1004
{
1004
    if (trackSize.length().isAuto())
1005
    if (trackBreadth.isAuto())
1005
        return cssValuePool().createIdentifierValue(CSSValueAuto);
1006
        return cssValuePool().createIdentifierValue(CSSValueAuto);
1006
    if (trackSize.length().isViewportPercentage())
1007
    if (trackBreadth.isViewportPercentage())
1007
        return zoomAdjustedPixelValue(valueForLength(trackSize.length(), 0, renderView), style);
1008
        return zoomAdjustedPixelValue(valueForLength(trackBreadth, 0, renderView), style);
1008
    return zoomAdjustedPixelValueForLength(trackSize.length(), style);
1009
    return zoomAdjustedPixelValueForLength(trackBreadth, style);
1009
}
1010
}
1010
1011
1011
static PassRefPtr<CSSValue> valueForGridTrackMinMax(const GridTrackSize& trackSize, const RenderStyle* style, RenderView* renderView)
1012
static PassRefPtr<CSSValue> valueForGridTrackMinMax(const GridTrackSize& trackSize, const RenderStyle* style, RenderView* renderView)
1012
{
1013
{
1013
    return valueForGridTrackBreadth(trackSize, style, renderView);
1014
    switch (trackSize.type()) {
1015
    case LengthTrackSizing:
1016
        return valueForGridTrackBreadth(trackSize.length(), style, renderView);
1017
    case MinMaxTrackSizing:
1018
        RefPtr<CSSValueList> minMaxTrackBreadths = CSSValueList::createCommaSeparated();
1019
        minMaxTrackBreadths->append(valueForGridTrackBreadth(trackSize.minTrackBreadth(), style, renderView));
1020
        minMaxTrackBreadths->append(valueForGridTrackBreadth(trackSize.maxTrackBreadth(), style, renderView));
1021
        return CSSFunctionValue::create("minmax(", minMaxTrackBreadths);
1022
    }
1023
    ASSERT_NOT_REACHED();
1024
    return 0;
1014
}
1025
}
1015
1026
1016
static PassRefPtr<CSSValue> valueForGridTrackGroup(const Vector<GridTrackSize>& trackSizes, const RenderStyle* style, RenderView* renderView)
1027
static PassRefPtr<CSSValue> valueForGridTrackGroup(const Vector<GridTrackSize>& trackSizes, const RenderStyle* style, RenderView* renderView)
- a/Source/WebCore/css/CSSFunctionValue.cpp +7 lines
Lines 42-47 CSSFunctionValue::CSSFunctionValue(CSSParserFunction* function) a/Source/WebCore/css/CSSFunctionValue.cpp_sec1
42
        m_args = CSSValueList::createFromParserValueList(function->args.get());
42
        m_args = CSSValueList::createFromParserValueList(function->args.get());
43
}
43
}
44
44
45
CSSFunctionValue::CSSFunctionValue(String name, PassRefPtr<CSSValueList> args)
46
    : CSSValue(FunctionClass)
47
    , m_name(name)
48
    , m_args(args)
49
{
50
}
51
45
String CSSFunctionValue::customCssText() const
52
String CSSFunctionValue::customCssText() const
46
{
53
{
47
    StringBuilder result;
54
    StringBuilder result;
- a/Source/WebCore/css/CSSFunctionValue.h +6 lines
Lines 40-51 public: a/Source/WebCore/css/CSSFunctionValue.h_sec1
40
        return adoptRef(new CSSFunctionValue(function));
40
        return adoptRef(new CSSFunctionValue(function));
41
    }
41
    }
42
42
43
    static PassRefPtr<CSSFunctionValue> create(String name, PassRefPtr<CSSValueList> args)
44
    {
45
        return adoptRef(new CSSFunctionValue(name, args));
46
    }
47
43
    String customCssText() const;
48
    String customCssText() const;
44
49
45
    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
50
    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
46
51
47
private:
52
private:
48
    explicit CSSFunctionValue(CSSParserFunction*);
53
    explicit CSSFunctionValue(CSSParserFunction*);
54
    CSSFunctionValue(String, PassRefPtr<CSSValueList>);
49
55
50
    String m_name;
56
    String m_name;
51
    RefPtr<CSSValueList> m_args;
57
    RefPtr<CSSValueList> m_args;
- a/Source/WebCore/css/CSSParser.cpp -2 / +19 lines
Lines 4537-4544 bool CSSParser::parseGridTrackMinMax(CSSValueList* values) a/Source/WebCore/css/CSSParser.cpp_sec1
4537
{
4537
{
4538
    CSSParserValue* currentValue = m_valueList->current();
4538
    CSSParserValue* currentValue = m_valueList->current();
4539
    if (currentValue->id == CSSValueAuto) {
4539
    if (currentValue->id == CSSValueAuto) {
4540
        RefPtr<CSSPrimitiveValue> autoValue = cssValuePool().createIdentifierValue(CSSValueAuto);
4540
        values->append(cssValuePool().createIdentifierValue(CSSValueAuto));
4541
        values->append(autoValue.release());
4541
        return true;
4542
    }
4543
4544
    if (currentValue->unit == CSSParserValue::Function && equalIgnoringCase(currentValue->function->name, "minmax(")) {
4545
        // The spec defines the following grammar: minmax( <track-breadth> , <track-breadth> )
4546
        CSSParserValueList* arguments = currentValue->function->args.get();
4547
        if (!arguments || arguments->size() != 3 || !isComma(arguments->valueAt(1)))
4548
            return false;
4549
4550
        RefPtr<CSSPrimitiveValue> minTrackBreadth = parseGridBreadth(arguments->valueAt(0));
4551
        if (!minTrackBreadth)
4552
            return false;
4553
4554
        RefPtr<CSSPrimitiveValue> maxTrackBreadth = parseGridBreadth(arguments->valueAt(2));
4555
        if (!maxTrackBreadth)
4556
            return false;
4557
4558
        values->append(createPrimitiveValuePair(minTrackBreadth, maxTrackBreadth));
4542
        return true;
4559
        return true;
4543
    }
4560
    }
4544
4561
- a/Source/WebCore/css/StyleResolver.cpp -3 / +14 lines
Lines 2688-2698 static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, StyleResol a/Source/WebCore/css/StyleResolver.cpp_sec1
2688
2688
2689
static bool createGridTrackMinMax(CSSPrimitiveValue* primitiveValue, StyleResolver* selector, GridTrackSize& trackSize)
2689
static bool createGridTrackMinMax(CSSPrimitiveValue* primitiveValue, StyleResolver* selector, GridTrackSize& trackSize)
2690
{
2690
{
2691
    Length workingLength;
2691
    Pair* minMaxTrackBreadth = primitiveValue->getPairValue();
2692
    if (!createGridTrackBreadth(primitiveValue, selector, workingLength))
2692
    if (!minMaxTrackBreadth) {
2693
        Length workingLength;
2694
        if (!createGridTrackBreadth(primitiveValue, selector, workingLength))
2695
            return false;
2696
2697
        trackSize.setLength(workingLength);
2698
        return true;
2699
    }
2700
2701
    Length minTrackBreadth;
2702
    Length maxTrackBreadth;
2703
    if (!createGridTrackBreadth(minMaxTrackBreadth->first(), selector, minTrackBreadth) || !createGridTrackBreadth(minMaxTrackBreadth->second(), selector, maxTrackBreadth))
2693
        return false;
2704
        return false;
2694
2705
2695
    trackSize.setLength(workingLength);
2706
    trackSize.setMinMax(minTrackBreadth, maxTrackBreadth);
2696
    return true;
2707
    return true;
2697
}
2708
}
2698
2709
- a/Source/WebCore/rendering/RenderGrid.cpp -6 / +14 lines
Lines 141-153 void RenderGrid::computedUsedBreadthOfGridTracks(TrackSizingDirection direction, a/Source/WebCore/rendering/RenderGrid.cpp_sec1
141
    const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style()->gridColumns() : style()->gridRows();
141
    const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style()->gridColumns() : style()->gridRows();
142
    for (size_t i = 0; i < trackStyles.size(); ++i) {
142
    for (size_t i = 0; i < trackStyles.size(); ++i) {
143
        GridTrack track;
143
        GridTrack track;
144
        Length trackLength = trackStyles[i].length();
144
        switch (trackStyles[i].type()) {
145
        // FIXME: we stil need to support calc() here (bug 103761)
145
        case LengthTrackSizing: {
146
        if (trackLength.isFixed() || trackLength.isPercent() || trackLength.isViewportPercentage())
146
            Length trackLength = trackStyles[i].length();
147
            track.m_usedBreadth = valueForLength(trackLength, direction == ForColumns ? logicalWidth() : computeContentLogicalHeight(MainOrPreferredSize, style()->logicalHeight()), view());
147
            // FIXME: we stil need to support calc() here (bug 103761)
148
        else
148
            if (trackLength.isFixed() || trackLength.isPercent() || trackLength.isViewportPercentage())
149
                track.m_usedBreadth = valueForLength(trackLength, direction == ForColumns ? logicalWidth() : computeContentLogicalHeight(MainOrPreferredSize, style()->logicalHeight()), view());
150
            else
151
                notImplemented();
152
153
            break;
154
        }
155
        case MinMaxTrackSizing:
156
            // FIXME: Implement support for minmax track sizing (bug 103311).
149
            notImplemented();
157
            notImplemented();
150
158
        }
151
        tracks.append(track);
159
        tracks.append(track);
152
    }
160
    }
153
}
161
}
- a/Source/WebCore/rendering/style/GridTrackSize.h -7 / +33 lines
Lines 36-75 a/Source/WebCore/rendering/style/GridTrackSize.h_sec1
36
namespace WebCore {
36
namespace WebCore {
37
37
38
enum GridTrackSizeType {
38
enum GridTrackSizeType {
39
    LengthTrackSizing
39
    LengthTrackSizing,
40
    MinMaxTrackSizing
40
};
41
};
41
42
42
class GridTrackSize {
43
class GridTrackSize {
43
public:
44
public:
44
    GridTrackSize()
45
    GridTrackSize()
45
        : m_type(LengthTrackSizing)
46
        : m_type(LengthTrackSizing)
46
        , m_length(Undefined)
47
        , m_minTrackBreadth(Undefined)
48
        , m_maxTrackBreadth(Undefined)
47
    {
49
    {
48
    }
50
    }
49
51
50
    const Length& length() const
52
    const Length& length() const
51
    {
53
    {
52
        ASSERT(m_type == LengthTrackSizing);
54
        ASSERT(m_type == LengthTrackSizing);
53
        ASSERT(!m_length.isUndefined());
55
        ASSERT(!m_minTrackBreadth.isUndefined());
54
        return m_length;
56
        ASSERT(m_minTrackBreadth == m_maxTrackBreadth);
57
        return m_minTrackBreadth;
55
    }
58
    }
56
59
57
    void setLength(const Length& length)
60
    void setLength(const Length& length)
58
    {
61
    {
59
        m_type = LengthTrackSizing;
62
        m_type = LengthTrackSizing;
60
        m_length = length;
63
        m_minTrackBreadth = length;
64
        m_maxTrackBreadth = length;
65
    }
66
67
    const Length& minTrackBreadth() const
68
    {
69
        ASSERT(m_type == MinMaxTrackSizing);
70
        ASSERT(!m_minTrackBreadth.isUndefined());
71
        return m_minTrackBreadth;
72
    }
73
74
    const Length& maxTrackBreadth() const
75
    {
76
        ASSERT(m_type == MinMaxTrackSizing);
77
        ASSERT(!m_maxTrackBreadth.isUndefined());
78
        return m_maxTrackBreadth;
79
    }
80
81
    void setMinMax(const Length& minTrackBreadth, const Length& maxTrackBreadth)
82
    {
83
        m_type = MinMaxTrackSizing;
84
        m_minTrackBreadth = minTrackBreadth;
85
        m_maxTrackBreadth = maxTrackBreadth;
61
    }
86
    }
62
87
63
    GridTrackSizeType type() const { return m_type; }
88
    GridTrackSizeType type() const { return m_type; }
64
89
65
    bool operator==(const GridTrackSize& other) const
90
    bool operator==(const GridTrackSize& other) const
66
    {
91
    {
67
        return m_type == other.m_type && m_length == other.m_length;
92
        return m_type == other.m_type && m_minTrackBreadth == other.m_minTrackBreadth && m_maxTrackBreadth == m_maxTrackBreadth;
68
    }
93
    }
69
94
70
private:
95
private:
71
    GridTrackSizeType m_type;
96
    GridTrackSizeType m_type;
72
    Length m_length;
97
    Length m_minTrackBreadth;
98
    Length m_maxTrackBreadth;
73
};
99
};
74
100
75
} // namespace WebCore
101
} // namespace WebCore
- a/LayoutTests/ChangeLog +15 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-12-04  Julien Chaffraix  <jchaffraix@webkit.org>
2
3
        [CSS Grid Layout] Implement CSS parsing and handling for <track-minmax>
4
        https://bugs.webkit.org/show_bug.cgi?id=103799
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * fast/css-grid-layout/grid-columns-rows-get-set-expected.txt:
9
        * fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt:
10
        * fast/css-grid-layout/grid-columns-rows-get-set-multiple.html:
11
        * fast/css-grid-layout/grid-columns-rows-get-set.html:
12
        * fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js:
13
        * fast/css-grid-layout/resources/grid-columns-rows-get-set.js:
14
        Extended the following tests to cover the new grammar.
15
1
2012-12-04  Roger Fong  <roger_fong@apple.com>
16
2012-12-04  Roger Fong  <roger_fong@apple.com>
2
17
3
        Unreviewed. Skip flaky "fake mouse move tests" on Windows port.
18
        Unreviewed. Skip flaky "fake mouse move tests" on Windows port.
- a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt +17 lines
Lines 16-21 PASS getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-colu a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt_sec1
16
PASS getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-rows') is '150px'
16
PASS getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-rows') is '150px'
17
PASS getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-columns') is '64px'
17
PASS getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-columns') is '64px'
18
PASS getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-rows') is '60px'
18
PASS getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-rows') is '60px'
19
PASS getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-columns') is 'minmax(10%, 15px)'
20
PASS getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-rows') is 'minmax(20px, 50%)'
21
19
Test getting wrong values for -webkit-grid-columns and -webkit-grid-rows through CSS (they should resolve to the default: 'none')
22
Test getting wrong values for -webkit-grid-columns and -webkit-grid-rows through CSS (they should resolve to the default: 'none')
20
PASS getComputedStyle(gridWithFitContentElement, '').getPropertyValue('-webkit-grid-columns') is 'none'
23
PASS getComputedStyle(gridWithFitContentElement, '').getPropertyValue('-webkit-grid-columns') is 'none'
21
PASS getComputedStyle(gridWithFitContentElement, '').getPropertyValue('-webkit-grid-rows') is 'none'
24
PASS getComputedStyle(gridWithFitContentElement, '').getPropertyValue('-webkit-grid-rows') is 'none'
Lines 35-40 PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is ' a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt_sec2
35
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'auto'
38
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'auto'
36
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '80px'
39
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '80px'
37
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is '150px'
40
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is '150px'
41
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'minmax(55%, 45px)'
42
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'minmax(30px, 40%)'
43
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'minmax(220px, 48px)'
44
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'minmax(80px, 50px)'
45
46
Test setting grid-columns and grid-rows to bad minmax value through JS
47
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
48
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
49
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
50
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
51
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
52
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
53
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
54
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
38
55
39
Test setting grid-columns and grid-rows back to 'none' through JS
56
Test setting grid-columns and grid-rows back to 'none' through JS
40
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '18px'
57
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '18px'
- a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt +6 lines
Lines 18-23 PASS getComputedStyle(gridWithPercentAndViewportPercent, '').getPropertyValue('- a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt_sec1
18
PASS getComputedStyle(gridWithPercentAndViewportPercent, '').getPropertyValue('-webkit-grid-rows') is '35% 168px'
18
PASS getComputedStyle(gridWithPercentAndViewportPercent, '').getPropertyValue('-webkit-grid-rows') is '35% 168px'
19
PASS getComputedStyle(gridWithFitContentAndFitAvailable, '').getPropertyValue('-webkit-grid-columns') is 'none'
19
PASS getComputedStyle(gridWithFitContentAndFitAvailable, '').getPropertyValue('-webkit-grid-columns') is 'none'
20
PASS getComputedStyle(gridWithFitContentAndFitAvailable, '').getPropertyValue('-webkit-grid-rows') is 'none'
20
PASS getComputedStyle(gridWithFitContentAndFitAvailable, '').getPropertyValue('-webkit-grid-rows') is 'none'
21
PASS getComputedStyle(gridWithMinMaxAndFixed, '').getPropertyValue('-webkit-grid-columns') is 'minmax(45px, 30%) 15px'
22
PASS getComputedStyle(gridWithMinMaxAndFixed, '').getPropertyValue('-webkit-grid-rows') is '120px minmax(35%, 10px)'
21
23
22
Test the initial value
24
Test the initial value
23
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
25
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
Lines 32-37 PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is ' a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt_sec2
32
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'auto auto'
34
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'auto auto'
33
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'auto 160px 22px'
35
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'auto 160px 22px'
34
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is '56% 100px auto'
36
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is '56% 100px auto'
37
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '160px minmax(16px, 20px)'
38
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'minmax(10%, 15%) auto'
35
39
36
Test getting wrong values set from CSS
40
Test getting wrong values set from CSS
37
PASS getComputedStyle(gridWithNoneAndAuto, '').getPropertyValue('-webkit-grid-columns') is 'none'
41
PASS getComputedStyle(gridWithNoneAndAuto, '').getPropertyValue('-webkit-grid-columns') is 'none'
Lines 54-59 PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is ' a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt_sec3
54
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is '5% 510px'
58
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is '5% 510px'
55
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
59
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
56
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
60
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
61
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
62
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
57
PASS successfullyParsed is true
63
PASS successfullyParsed is true
58
64
59
TEST COMPLETE
65
TEST COMPLETE
- a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple.html +7 lines
Lines 54-59 if (window.testRunner) a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple.html_sec1
54
    -webkit-grid-columns: -webkit-content-available;
54
    -webkit-grid-columns: -webkit-content-available;
55
    -webkit-grid-rows: -webkit-fitcontent -webkit-fit-available;
55
    -webkit-grid-rows: -webkit-fitcontent -webkit-fit-available;
56
}
56
}
57
.gridWithMinMaxAndFixed {
58
    display: -webkit-grid;
59
    -webkit-grid-columns: minmax(45px, 30%) 15px;
60
    -webkit-grid-rows: 12em minmax(35%, 10px);
61
    font: 10px Ahem;
62
}
57
</style>
63
</style>
58
<script src="../js/resources/js-test-pre.js"></script>
64
<script src="../js/resources/js-test-pre.js"></script>
59
</head>
65
</head>
Lines 67-72 if (window.testRunner) a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple.html_sec2
67
<div class="gridWithThreeItems" id="gridWithThreeItems"></div>
73
<div class="gridWithThreeItems" id="gridWithThreeItems"></div>
68
<div class="gridWithPercentAndViewportPercent" id="gridWithPercentAndViewportPercent"></div>
74
<div class="gridWithPercentAndViewportPercent" id="gridWithPercentAndViewportPercent"></div>
69
<div class="gridWithFitContentAndFitAvailable" id="gridWithFitContentAndFitAvailable"></div>
75
<div class="gridWithFitContentAndFitAvailable" id="gridWithFitContentAndFitAvailable"></div>
76
<div class="gridWithMinMaxAndFixed" id="gridWithMinMaxAndFixed"></div>
70
<script src="resources/grid-columns-rows-get-set-multiple.js"></script>
77
<script src="resources/grid-columns-rows-get-set-multiple.js"></script>
71
<script src="../js/resources/js-test-post.js"></script>
78
<script src="../js/resources/js-test-post.js"></script>
72
</body>
79
</body>
- a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set.html +5 lines
Lines 42-47 if (window.testRunner) a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set.html_sec1
42
    -webkit-grid-columns: -webkit-fit-available;
42
    -webkit-grid-columns: -webkit-fit-available;
43
    -webkit-grid-rows: -webkit-fit-available;
43
    -webkit-grid-rows: -webkit-fit-available;
44
}
44
}
45
.gridWithMinMax {
46
    -webkit-grid-columns: minmax(10%, 15px);
47
    -webkit-grid-rows: minmax(20px, 50%);
48
}
45
</style>
49
</style>
46
<script src="../js/resources/js-test-pre.js"></script>
50
<script src="../js/resources/js-test-pre.js"></script>
47
</head>
51
</head>
Lines 54-59 if (window.testRunner) a/LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set.html_sec2
54
<div class="grid gridWithViewPortPercentage" id="gridWithViewPortPercentageElement"></div>
58
<div class="grid gridWithViewPortPercentage" id="gridWithViewPortPercentageElement"></div>
55
<div class="grid gridWithFitContent" id="gridWithFitContentElement"></div>
59
<div class="grid gridWithFitContent" id="gridWithFitContentElement"></div>
56
<div class="grid gridWithFitAvailable" id="gridWithFitAvailableElement"></div>
60
<div class="grid gridWithFitAvailable" id="gridWithFitAvailableElement"></div>
61
<div class="grid gridWithMinMax" id="gridWithMinMax"></div>
57
<script src="resources/grid-columns-rows-get-set.js"></script>
62
<script src="resources/grid-columns-rows-get-set.js"></script>
58
<script src="../js/resources/js-test-post.js"></script>
63
<script src="../js/resources/js-test-post.js"></script>
59
</body>
64
</body>
- a/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js +19 lines
Lines 29-34 var gridWithFitContentAndFitAvailable = document.getElementById("gridWithFitCont a/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js_sec1
29
shouldBe("getComputedStyle(gridWithFitContentAndFitAvailable, '').getPropertyValue('-webkit-grid-columns')", "'none'");
29
shouldBe("getComputedStyle(gridWithFitContentAndFitAvailable, '').getPropertyValue('-webkit-grid-columns')", "'none'");
30
shouldBe("getComputedStyle(gridWithFitContentAndFitAvailable, '').getPropertyValue('-webkit-grid-rows')", "'none'");
30
shouldBe("getComputedStyle(gridWithFitContentAndFitAvailable, '').getPropertyValue('-webkit-grid-rows')", "'none'");
31
31
32
var gridWithMinMaxAndFixed = document.getElementById("gridWithMinMaxAndFixed");
33
shouldBe("getComputedStyle(gridWithMinMaxAndFixed, '').getPropertyValue('-webkit-grid-columns')", "'minmax(45px, 30%) 15px'");
34
shouldBe("getComputedStyle(gridWithMinMaxAndFixed, '').getPropertyValue('-webkit-grid-rows')", "'120px minmax(35%, 10px)'");
35
32
debug("");
36
debug("");
33
debug("Test the initial value");
37
debug("Test the initial value");
34
var element = document.createElement("div");
38
var element = document.createElement("div");
Lines 65-70 element.style.webkitGridRows = "56% 10em auto"; a/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js_sec2
65
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'auto 160px 22px'");
69
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'auto 160px 22px'");
66
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'56% 100px auto'");
70
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'56% 100px auto'");
67
71
72
element = document.createElement("div");
73
document.body.appendChild(element);
74
element.style.font = "10px Ahem";
75
element.style.webkitGridColumns = "16em minmax(16px, 20px)";
76
element.style.webkitGridRows = "minmax(10%, 15%) auto";
77
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'160px minmax(16px, 20px)'");
78
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'minmax(10%, 15%) auto'");
79
68
debug("");
80
debug("");
69
debug("Test getting wrong values set from CSS");
81
debug("Test getting wrong values set from CSS");
70
var gridWithNoneAndAuto = document.getElementById("gridWithNoneAndAuto");
82
var gridWithNoneAndAuto = document.getElementById("gridWithNoneAndAuto");
Lines 125-127 element.style.webkitGridColumns = "-webkit-fit-content -webkit-fit-content"; a/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js_sec3
125
element.style.webkitGridRows = "-webkit-fit-available -webkit-fit-available";
137
element.style.webkitGridRows = "-webkit-fit-available -webkit-fit-available";
126
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
138
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
127
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
139
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
140
141
element = document.createElement("div");
142
document.body.appendChild(element);
143
element.style.webkitGridColumns = "auto minmax(16px, auto)";
144
element.style.webkitGridRows = "minmax(auto, 15%) 10vw";
145
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
146
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
- a/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js +57 lines
Lines 25-30 var gridWithViewPortPercentageElement = document.getElementById("gridWithViewPor a/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js_sec1
25
shouldBe("getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-columns')", "'64px'");
25
shouldBe("getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-columns')", "'64px'");
26
shouldBe("getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-rows')", "'60px'");
26
shouldBe("getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-rows')", "'60px'");
27
27
28
var gridWithMinMax = document.getElementById("gridWithMinMax");
29
shouldBe("getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-columns')", "'minmax(10%, 15px)'");
30
shouldBe("getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-rows')", "'minmax(20px, 50%)'");
31
32
debug("");
28
debug("Test getting wrong values for -webkit-grid-columns and -webkit-grid-rows through CSS (they should resolve to the default: 'none')");
33
debug("Test getting wrong values for -webkit-grid-columns and -webkit-grid-rows through CSS (they should resolve to the default: 'none')");
29
var gridWithFitContentElement = document.getElementById("gridWithFitContentElement");
34
var gridWithFitContentElement = document.getElementById("gridWithFitContentElement");
30
shouldBe("getComputedStyle(gridWithFitContentElement, '').getPropertyValue('-webkit-grid-columns')", "'none'");
35
shouldBe("getComputedStyle(gridWithFitContentElement, '').getPropertyValue('-webkit-grid-columns')", "'none'");
Lines 69-74 element.style.webkitGridRows = "25vh"; a/LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js_sec2
69
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'80px'");
74
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'80px'");
70
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'150px'");
75
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'150px'");
71
76
77
element = document.createElement("div");
78
document.body.appendChild(element);
79
element.style.webkitGridColumns = "minmax(55%, 45px)";
80
element.style.webkitGridRows = "minmax(30px, 40%)";
81
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'minmax(55%, 45px)'");
82
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'minmax(30px, 40%)'");
83
84
element = document.createElement("div");
85
document.body.appendChild(element);
86
element.style.font = "10px Ahem";
87
element.style.webkitGridColumns = "minmax(22em, 8vh)";
88
element.style.webkitGridRows = "minmax(10vw, 5em)";
89
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'minmax(220px, 48px)'");
90
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'minmax(80px, 50px)'");
91
92
debug("");
93
debug("Test setting grid-columns and grid-rows to bad minmax value through JS");
94
element = document.createElement("div");
95
document.body.appendChild(element);
96
// No comma.
97
element.style.webkitGridColumns = "minmax(10px 20px)";
98
// Only 1 argument provided.
99
element.style.webkitGridRows = "minmax(10px)";
100
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
101
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
102
103
element = document.createElement("div");
104
document.body.appendChild(element);
105
// Nested minmax.
106
element.style.webkitGridColumns = "minmax(minmax(10px, 20px), 20px)";
107
// Only 2 arguments are allowed.
108
element.style.webkitGridRows = "minmax(10px, 20px, 30px)";
109
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
110
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
111
112
element = document.createElement("div");
113
document.body.appendChild(element);
114
// No breadth value.
115
element.style.webkitGridColumns = "minmax()";
116
// No comma.
117
element.style.webkitGridRows = "minmax(30px 30% 30em)";
118
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
119
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
120
121
element = document.createElement("div");
122
document.body.appendChild(element);
123
// Auto is not allowed inside minmax.
124
element.style.webkitGridColumns = "minmax(auto, 8vh)";
125
element.style.webkitGridRows = "minmax(10vw, auto)";
126
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
127
shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
128
72
debug("");
129
debug("");
73
debug("Test setting grid-columns and grid-rows back to 'none' through JS");
130
debug("Test setting grid-columns and grid-rows back to 'none' through JS");
74
element.style.webkitGridColumns = "18px";
131
element.style.webkitGridColumns = "18px";

Return to Bug 103799