blob: cd7d447955c8924a18a248813d7163273375e41b [file] [log] [blame]
Test that setting and getting grid-template-columns and grid-template-rows works as expected
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Test getting grid-template-columns and grid-template-rows set through CSS
PASS window.getComputedStyle(gridWithNoneElement, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(gridWithNoneElement, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(gridWithFixedElement, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
PASS window.getComputedStyle(gridWithFixedElement, '').getPropertyValue('-webkit-grid-template-rows') is "15px"
PASS window.getComputedStyle(gridWithPercentElement, '').getPropertyValue('-webkit-grid-template-columns') is "53%"
PASS window.getComputedStyle(gridWithPercentElement, '').getPropertyValue('-webkit-grid-template-rows') is "27%"
PASS window.getComputedStyle(gridWithAutoElement, '').getPropertyValue('-webkit-grid-template-columns') is "auto"
PASS window.getComputedStyle(gridWithAutoElement, '').getPropertyValue('-webkit-grid-template-rows') is "auto"
PASS window.getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-template-columns') is "100px"
PASS window.getComputedStyle(gridWithEMElement, '').getPropertyValue('-webkit-grid-template-rows') is "150px"
PASS window.getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-template-columns') is "64px"
PASS window.getComputedStyle(gridWithViewPortPercentageElement, '').getPropertyValue('-webkit-grid-template-rows') is "60px"
PASS window.getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-template-columns') is "minmax(10%, 15px)"
PASS window.getComputedStyle(gridWithMinMax, '').getPropertyValue('-webkit-grid-template-rows') is "minmax(20px, 50%)"
PASS window.getComputedStyle(gridWithMinContent, '').getPropertyValue('-webkit-grid-template-columns') is "-webkit-min-content"
PASS window.getComputedStyle(gridWithMinContent, '').getPropertyValue('-webkit-grid-template-rows') is "-webkit-min-content"
PASS window.getComputedStyle(gridWithMaxContent, '').getPropertyValue('-webkit-grid-template-columns') is "-webkit-max-content"
PASS window.getComputedStyle(gridWithMaxContent, '').getPropertyValue('-webkit-grid-template-rows') is "-webkit-max-content"
PASS window.getComputedStyle(gridWithFraction, '').getPropertyValue('-webkit-grid-template-columns') is "1fr"
PASS window.getComputedStyle(gridWithFraction, '').getPropertyValue('-webkit-grid-template-rows') is "2fr"
PASS window.getComputedStyle(gridWithCalc, '').getPropertyValue('-webkit-grid-template-columns') is "150px"
PASS window.getComputedStyle(gridWithCalc, '').getPropertyValue('-webkit-grid-template-rows') is "75px"
PASS window.getComputedStyle(gridWithCalcComplex, '').getPropertyValue('-webkit-grid-template-columns') is "calc(50% + 150px)"
PASS window.getComputedStyle(gridWithCalcComplex, '').getPropertyValue('-webkit-grid-template-rows') is "calc(65% + 75px)"
PASS window.getComputedStyle(gridWithCalcInsideMinMax, '').getPropertyValue('-webkit-grid-template-columns') is "minmax(10%, 15px)"
PASS window.getComputedStyle(gridWithCalcInsideMinMax, '').getPropertyValue('-webkit-grid-template-rows') is "minmax(20px, 50%)"
PASS window.getComputedStyle(gridWithCalcComplexInsideMinMax, '').getPropertyValue('-webkit-grid-template-columns') is "minmax(10%, calc(50% + 15px))"
PASS window.getComputedStyle(gridWithCalcComplexInsideMinMax, '').getPropertyValue('-webkit-grid-template-rows') is "minmax(calc(20px + 10%), 50%)"
Test getting wrong values for grid-template-columns and grid-template-rows through CSS (they should resolve to the default: 'none')
PASS window.getComputedStyle(gridWithFitContentElement, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(gridWithFitContentElement, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(gridWithFitAvailableElement, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(gridWithFitAvailableElement, '').getPropertyValue('-webkit-grid-template-rows') is "none"
Test the initial value
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is 'none'
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is 'none'
Test getting and setting grid-template-columns and grid-template-rows through JS
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "18px"
PASS element.style.webkitGridTemplateColumns is "18px"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "66px"
PASS element.style.webkitGridTemplateRows is "66px"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "55%"
PASS element.style.webkitGridTemplateColumns is "55%"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "40%"
PASS element.style.webkitGridTemplateRows is "40%"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "auto"
PASS element.style.webkitGridTemplateColumns is "auto"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "auto"
PASS element.style.webkitGridTemplateRows is "auto"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "80px"
PASS element.style.webkitGridTemplateColumns is "10vw"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "150px"
PASS element.style.webkitGridTemplateRows is "25vh"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "-webkit-min-content"
PASS element.style.webkitGridTemplateColumns is "-webkit-min-content"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "-webkit-min-content"
PASS element.style.webkitGridTemplateRows is "-webkit-min-content"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "-webkit-max-content"
PASS element.style.webkitGridTemplateColumns is "-webkit-max-content"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "-webkit-max-content"
PASS element.style.webkitGridTemplateRows is "-webkit-max-content"
Test getting and setting grid-template-columns and grid-template-rows to minmax() values through JS
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "minmax(55%, 45px)"
PASS element.style.webkitGridTemplateColumns is "minmax(55%, 45px)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "minmax(30px, 40%)"
PASS element.style.webkitGridTemplateRows is "minmax(30px, 40%)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "minmax(220px, 48px)"
PASS element.style.webkitGridTemplateColumns is "minmax(22em, 8vh)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "minmax(80px, 50px)"
PASS element.style.webkitGridTemplateRows is "minmax(10vw, 5em)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "minmax(-webkit-min-content, 48px)"
PASS element.style.webkitGridTemplateColumns is "minmax(-webkit-min-content, 8vh)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "minmax(80px, -webkit-min-content)"
PASS element.style.webkitGridTemplateRows is "minmax(10vw, -webkit-min-content)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "minmax(220px, -webkit-max-content)"
PASS element.style.webkitGridTemplateColumns is "minmax(22em, -webkit-max-content)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "minmax(-webkit-max-content, 50px)"
PASS element.style.webkitGridTemplateRows is "minmax(-webkit-max-content, 5em)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "minmax(-webkit-min-content, -webkit-max-content)"
PASS element.style.webkitGridTemplateColumns is "minmax(-webkit-min-content, -webkit-max-content)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "minmax(-webkit-max-content, -webkit-min-content)"
PASS element.style.webkitGridTemplateRows is "minmax(-webkit-max-content, -webkit-min-content)"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "3600fr"
PASS element.style.webkitGridTemplateColumns is "3600fr"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "154fr"
PASS element.style.webkitGridTemplateRows is "154fr"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "3.1459fr"
PASS element.style.webkitGridTemplateColumns is "3.1459fr"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "2.718fr"
PASS element.style.webkitGridTemplateRows is "2.718fr"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "3fr"
PASS element.style.webkitGridTemplateColumns is "3fr"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "4fr"
PASS element.style.webkitGridTemplateRows is "4fr"
Test setting grid-template-columns and grid-template-rows to bad values through JS
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
Test setting grid-template-columns and grid-template-rows back to 'none' through JS
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "18px"
PASS element.style.webkitGridTemplateColumns is "18px"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "66px"
PASS element.style.webkitGridTemplateRows is "66px"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
PASS element.style.webkitGridTemplateColumns is "none"
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
PASS element.style.webkitGridTemplateRows is "none"
Test setting grid-template-columns and grid-template-rows to 'inherit' through JS
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is '50px (last)'
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is '(first) 101%'
Test setting grid-template-columns and grid-template-rows to 'initial' through JS
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is '150% (last)'
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is '(first) 1fr'
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is 'none'
PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is 'none'
PASS successfullyParsed is true
TEST COMPLETE