Source/WebCore/ChangeLog

 12012-11-30 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 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
1612012-11-30 Beth Dakin <bdakin@apple.com>
262
363 https://bugs.webkit.org/show_bug.cgi?id=103790

Source/WebCore/css/CSSComputedStyleDeclaration.cpp

3030#include "CSSAspectRatioValue.h"
3131#include "CSSBasicShapes.h"
3232#include "CSSBorderImage.h"
 33#include "CSSFunctionValue.h"
3334#include "CSSLineBoxContainValue.h"
3435#include "CSSParser.h"
3536#include "CSSPrimitiveValue.h"

@@PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForFilter(const RenderObj
983984}
984985#endif
985986
986 static PassRefPtr<CSSValue> valueForGridTrackBreadth(const GridTrackSize& trackSize, const RenderStyle* style)
 987static PassRefPtr<CSSValue> valueForGridTrackBreadth(const Length& trackBreadth, const RenderStyle* style)
987988{
988  if (trackSize.length().isPercent())
989  return cssValuePool().createValue(trackSize.length());
990  if (trackSize.length().isAuto())
 989 if (trackBreadth.isPercent())
 990 return cssValuePool().createValue(trackBreadth);
 991 if (trackBreadth.isAuto())
991992 return cssValuePool().createIdentifierValue(CSSValueAuto);
992  return zoomAdjustedPixelValue(trackSize.length().value(), style);
 993 return zoomAdjustedPixelValue(trackBreadth.value(), style);
993994}
994995
995996static PassRefPtr<CSSValue> valueForGridTrackMinMax(const GridTrackSize& trackSize, const RenderStyle* style)
996997{
997  return valueForGridTrackBreadth(trackSize, style);
 998 switch (trackSize.type()) {
 999 case LengthTrackSizing:
 1000 return valueForGridTrackBreadth(trackSize.length(), style);
 1001 case MinMaxTrackSizing:
 1002 RefPtr<CSSValueList> minMaxTrackBreadths = CSSValueList::createCommaSeparated();
 1003 minMaxTrackBreadths->append(valueForGridTrackBreadth(trackSize.minTrackBreadth(), style));
 1004 minMaxTrackBreadths->append(valueForGridTrackBreadth(trackSize.maxTrackBreadth(), style));
 1005 return CSSFunctionValue::create("minmax(", minMaxTrackBreadths);
 1006 }
 1007 ASSERT_NOT_REACHED();
 1008 return 0;
9981009}
9991010
10001011static PassRefPtr<CSSValue> valueForGridTrackGroup(const Vector<GridTrackSize>& trackSizes, const RenderStyle* style)

Source/WebCore/css/CSSFunctionValue.cpp

@@CSSFunctionValue::CSSFunctionValue(CSSParserFunction* function)
4242 m_args = CSSValueList::createFromParserValueList(function->args.get());
4343}
4444
 45CSSFunctionValue::CSSFunctionValue(String name, PassRefPtr<CSSValueList> args)
 46 : CSSValue(FunctionClass)
 47 , m_name(name)
 48 , m_args(args)
 49{
 50}
 51
4552String CSSFunctionValue::customCssText() const
4653{
4754 StringBuilder result;

Source/WebCore/css/CSSFunctionValue.h

@@public:
4040 return adoptRef(new CSSFunctionValue(function));
4141 }
4242
 43 static PassRefPtr<CSSFunctionValue> create(String name, PassRefPtr<CSSValueList> args)
 44 {
 45 return adoptRef(new CSSFunctionValue(name, args));
 46 }
 47
4348 String customCssText() const;
4449
4550 void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
4651
4752private:
4853 explicit CSSFunctionValue(CSSParserFunction*);
 54 explicit CSSFunctionValue(String, PassRefPtr<CSSValueList>);
4955
5056 String m_name;
5157 RefPtr<CSSValueList> m_args;

Source/WebCore/css/CSSParser.cpp

@@bool CSSParser::parseGridTrackMinMax(CSSValueList* values)
45344534 RefPtr<CSSPrimitiveValue> autoValue = cssValuePool().createIdentifierValue(CSSValueAuto);
45354535 values->append(autoValue.release());
45364536 return true;
 4537 } else if (currentValue->unit == CSSParserValue::Function && equalIgnoringCase(currentValue->function->name, "minmax(")) {
 4538 // We only accept the following grammar: minmax( <track-breadth> , <track-breadth> )
 4539 CSSParserValueList* arguments = currentValue->function->args.get();
 4540 if (!arguments || arguments->size() != 3 || !isComma(arguments->valueAt(1)))
 4541 return false;
 4542
 4543 RefPtr<CSSPrimitiveValue> minTrackBreadth = parseGridBreadth(arguments->valueAt(0));
 4544 if (!minTrackBreadth)
 4545 return false;
 4546
 4547 RefPtr<CSSPrimitiveValue> maxTrackBreadth = parseGridBreadth(arguments->valueAt(2));
 4548 if (!maxTrackBreadth)
 4549 return false;
 4550
 4551 values->append(createPrimitiveValuePair(minTrackBreadth, maxTrackBreadth));
 4552 return true;
45374553 }
45384554
45394555 if (PassRefPtr<CSSPrimitiveValue> trackBreadth = parseGridBreadth(currentValue)) {

Source/WebCore/css/StyleResolver.cpp

@@static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, StyleResol
26732673
26742674static bool createGridTrackMinMax(CSSPrimitiveValue* primitiveValue, StyleResolver* selector, GridTrackSize& trackSize)
26752675{
2676  Length workingLength;
2677  if (!createGridTrackBreadth(primitiveValue, selector, workingLength))
 2676 Pair* minMaxTrackBreadth = primitiveValue->getPairValue();
 2677 if (!minMaxTrackBreadth) {
 2678 Length workingLength;
 2679 if (!createGridTrackBreadth(primitiveValue, selector, workingLength))
 2680 return false;
 2681
 2682 trackSize.setLength(workingLength);
 2683 return true;
 2684 }
 2685
 2686 Length minTrackBreadth;
 2687 Length maxTrackBreadth;
 2688 if (!createGridTrackBreadth(minMaxTrackBreadth->first(), selector, minTrackBreadth) || !createGridTrackBreadth(minMaxTrackBreadth->second(), selector, maxTrackBreadth))
26782689 return false;
26792690
2680  trackSize.setLength(workingLength);
 2691 trackSize.setMinMax(minTrackBreadth, maxTrackBreadth);
26812692 return true;
26822693}
26832694

Source/WebCore/rendering/RenderGrid.cpp

@@void RenderGrid::computedUsedBreadthOfGridTracks(TrackSizingDirection direction,
141141 const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style()->gridColumns() : style()->gridRows();
142142 for (size_t i = 0; i < trackStyles.size(); ++i) {
143143 GridTrack track;
144  if (trackStyles[i].length().isFixed())
145  track.m_usedBreadth = trackStyles[i].length().getFloatValue();
146  else
 144 switch (trackStyles[i].type()) {
 145 case LengthTrackSizing:
 146 if (trackStyles[i].length().isFixed())
 147 track.m_usedBreadth = trackStyles[i].length().getFloatValue();
 148 else
 149 notImplemented();
 150
 151 break;
 152 case MinMaxTrackSizing:
 153 // FIXME: Implement support for minmax track sizing (bug 103311).
147154 notImplemented();
148 
 155 }
149156 tracks.append(track);
150157 }
151158}

Source/WebCore/rendering/style/GridTrackSize.h

3636namespace WebCore {
3737
3838enum GridTrackSizeType {
39  LengthTrackSizing
 39 LengthTrackSizing,
 40 MinMaxTrackSizing
4041};
4142
4243class GridTrackSize {
4344public:
4445 GridTrackSize()
4546 : m_type(LengthTrackSizing)
46  , m_length(Undefined)
 47 , m_minTrackBreadth(Undefined)
 48 , m_maxTrackBreadth(Undefined)
4749 {
4850 }
4951
5052 const Length& length() const
5153 {
5254 ASSERT(m_type == LengthTrackSizing);
53  ASSERT(!m_length.isUndefined());
54  return m_length;
 55 ASSERT(!m_minTrackBreadth.isUndefined());
 56 ASSERT(m_minTrackBreadth == m_maxTrackBreadth);
 57 return m_minTrackBreadth;
5558 }
5659
5760 void setLength(const Length& length)
5861 {
5962 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;
6186 }
6287
6388 GridTrackSizeType type() const { return m_type; }
6489
6590 bool operator==(const GridTrackSize& other) const
6691 {
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;
6893 }
6994
7095private:
7196 GridTrackSizeType m_type;
72  Length m_length;
 97 Length m_minTrackBreadth;
 98 Length m_maxTrackBreadth;
7399};
74100
75101} // namespace WebCore

LayoutTests/ChangeLog

 12012-11-30 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
1162012-11-30 Jer Noble <jer.noble@apple.com>
217
318 Add support for the 'unpause()' method on MediaController.

LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-expected.txt

@@PASS getComputedStyle(gridWithAutoElement, '').getPropertyValue('-webkit-grid-co
1414PASS getComputedStyle(gridWithAutoElement, '').getPropertyValue('-webkit-grid-rows') is 'auto'
1515PASS getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-columns') is '100px'
1616PASS getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-rows') is '150px'
 17PASS getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-columns') is 'minmax(10%, 15px)'
 18PASS getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-rows') is 'minmax(20px, 50%)'
1719
1820Test the initial value
1921PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'

@@PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '
2628PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is '40%'
2729PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'auto'
2830PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'auto'
 31PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'minmax(55%, 45px)'
 32PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'minmax(30px, 40%)'
 33
 34Test setting grid-columns and grid-rows back to bad minmax value through JS
 35PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
 36PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
 37PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
 38PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
 39PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'
 40PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'none'
2941
3042Test setting grid-columns and grid-rows back to 'none' through JS
3143PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '18px'

LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple-expected.txt

@@PASS getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-colu
1414PASS getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-rows') is '150px 170px'
1515PASS getComputedStyle(gridWithThreeItems, '').getPropertyValue('-webkit-grid-columns') is '15px auto 100px'
1616PASS getComputedStyle(gridWithThreeItems, '').getPropertyValue('-webkit-grid-rows') is '120px 18px auto'
 17PASS getComputedStyle(gridWithMinMaxAndFixed, '').getPropertyValue('-webkit-grid-columns') is 'minmax(45px, 30%) 15px'
 18PASS getComputedStyle(gridWithMinMaxAndFixed, '').getPropertyValue('-webkit-grid-rows') is '120px minmax(35%, 10px)'
1719
1820Test the initial value
1921PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'none'

@@PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '
2830PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'auto auto'
2931PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is 'auto 160px 22px'
3032PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is '56% 100px auto'
 33PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns') is '160px minmax(16px, 20px)'
 34PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows') is 'minmax(10%, 15%) auto'
3135
3236Test getting wrong values set from CSS
3337PASS getComputedStyle(gridWithNoneAndAuto, '').getPropertyValue('-webkit-grid-columns') is 'none'

LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set-multiple.html

@@if (window.testRunner)
4444 -webkit-grid-rows: 12em 18px auto;
4545 font: 10px Ahem;
4646}
 47.gridWithMinMaxAndFixed {
 48 display: -webkit-grid;
 49 -webkit-grid-columns: minmax(45px, 30%) 15px;
 50 -webkit-grid-rows: 12em minmax(35%, 10px);
 51 font: 10px Ahem;
 52}
 53
4754</style>
4855<script src="../js/resources/js-test-pre.js"></script>
4956</head>

@@if (window.testRunner)
5562<div class="gridWithNoneAndAuto" id="gridWithNoneAndAuto"></div>
5663<div class="gridWithNoneAndFixed" id="gridWithNoneAndFixed"></div>
5764<div class="gridWithThreeItems" id="gridWithThreeItems"></div>
 65<div class="gridWithMinMaxAndFixed" id="gridWithMinMaxAndFixed"></div>
5866<script src="resources/grid-columns-rows-get-set-multiple.js"></script>
5967<script src="../js/resources/js-test-post.js"></script>
6068</body>

LayoutTests/fast/css-grid-layout/grid-columns-rows-get-set.html

@@if (window.testRunner)
3232 -webkit-grid-rows: 15em;
3333 font: 10px Ahem;
3434}
 35
 36.gridWithMinMax {
 37 display: -webkit-grid;
 38 -webkit-grid-columns: minmax(10%, 15px);
 39 -webkit-grid-rows: minmax(20px, 50%);
 40};
 41
3542</style>
3643<script src="../js/resources/js-test-pre.js"></script>
3744</head>

@@if (window.testRunner)
4148<div class="gridWithPercent" id="gridWithPercentElement"></div>
4249<div class="gridWithAuto" id="gridWithAutoElement"></div>
4350<div class="gridWithEM" id="gridWithEMElement"></div>
 51<div class="gridWithMinMax" id="gridWithMinMax"></div>
4452<script src="resources/grid-columns-rows-get-set.js"></script>
4553<script src="../js/resources/js-test-post.js"></script>
4654</body>

LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js

@@var gridWithThreeItems = document.getElementById("gridWithThreeItems");
2121shouldBe("getComputedStyle(gridWithThreeItems, '').getPropertyValue('-webkit-grid-columns')", "'15px auto 100px'");
2222shouldBe("getComputedStyle(gridWithThreeItems, '').getPropertyValue('-webkit-grid-rows')", "'120px 18px auto'");
2323
 24var gridWithMinMaxAndFixed = document.getElementById("gridWithMinMaxAndFixed");
 25shouldBe("getComputedStyle(gridWithMinMaxAndFixed, '').getPropertyValue('-webkit-grid-columns')", "'minmax(45px, 30%) 15px'");
 26shouldBe("getComputedStyle(gridWithMinMaxAndFixed, '').getPropertyValue('-webkit-grid-rows')", "'120px minmax(35%, 10px)'");
 27
2428debug("");
2529debug("Test the initial value");
2630var element = document.createElement("div");

@@element.style.webkitGridRows = "56% 10em auto";
5761shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'auto 160px 22px'");
5862shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'56% 100px auto'");
5963
 64element = document.createElement("div");
 65document.body.appendChild(element);
 66element.style.font = "10px Ahem";
 67element.style.webkitGridColumns = "16em minmax(16px, 20px)";
 68element.style.webkitGridRows = "minmax(10%, 15%) auto";
 69shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'160px minmax(16px, 20px)'");
 70shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'minmax(10%, 15%) auto'");
 71
6072debug("");
6173debug("Test getting wrong values set from CSS");
6274var gridWithNoneAndAuto = document.getElementById("gridWithNoneAndAuto");

LayoutTests/fast/css-grid-layout/resources/grid-columns-rows-get-set.js

@@var gridWithEMElement = document.getElementById("gridWithEMElement");
2121shouldBe("getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-columns')", "'100px'");
2222shouldBe("getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-rows')", "'150px'");
2323
 24var gridWithMinMax = document.getElementById("gridWithMinMax");
 25shouldBe("getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-columns')", "'minmax(10%, 15px)'");
 26shouldBe("getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-rows')", "'minmax(20px, 50%)'");
 27
2428debug("");
2529debug("Test the initial value");
2630var element = document.createElement("div");

@@element.style.webkitGridRows = "auto";
4953shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'auto'");
5054shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'auto'");
5155
 56element = document.createElement("div");
 57document.body.appendChild(element);
 58element.style.webkitGridColumns = "minmax(55%, 45px)";
 59element.style.webkitGridRows = "minmax(30px, 40%)";
 60shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'minmax(55%, 45px)'");
 61shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'minmax(30px, 40%)'");
 62
 63debug("");
 64debug("Test setting grid-columns and grid-rows back to bad minmax value through JS");
 65element = document.createElement("div");
 66document.body.appendChild(element);
 67// No comma.
 68element.style.webkitGridColumns = "minmax(10px 20px)";
 69// Only 1 argument provided.
 70element.style.webkitGridRows = "minmax(10px)";
 71shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
 72shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
 73
 74element = document.createElement("div");
 75document.body.appendChild(element);
 76// Nested minmax.
 77element.style.webkitGridColumns = "minmax(minmax(10px, 20px), 20px)";
 78// Only 2 arguments are allowed.
 79element.style.webkitGridRows = "minmax(10px, 20px, 30px)";
 80shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
 81shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
 82
 83element = document.createElement("div");
 84document.body.appendChild(element);
 85// No breadth value.
 86element.style.webkitGridColumns = "minmax()";
 87// No comma.
 88element.style.webkitGridRows = "minmax(30px 30% 30em)";
 89shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-columns')", "'none'");
 90shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-rows')", "'none'");
 91
5292debug("");
5393debug("Test setting grid-columns and grid-rows back to 'none' through JS");
5494element.style.webkitGridColumns = "18px";