blob: b34cf6693c6f083b2446a9c8e7a1159be43b8050 [file] [log] [blame]
Tests parsing of various valid and invalid calc expressions.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
testDiv.style["width"] = "calc(100px)"
PASS testDiv.style['width'] is "calc(100px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "100px"
testDiv.style["width"] = "max(100px + 200px)"
PASS testDiv.style['width'] is "max(300px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "300px"
testDiv.style["width"] = "max(100px , 200px)"
PASS testDiv.style['width'] is "max(200px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "200px"
testDiv.style["width"] = "max(100px,200px)"
PASS testDiv.style['width'] is "max(200px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "200px"
testDiv.style["width"] = "clamp(100px,123px,200px)"
PASS testDiv.style['width'] is "clamp(100px, 123px, 200px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "123px"
testDiv.style["width"] = "clamp(100px,300px,200px)"
PASS testDiv.style['width'] is "clamp(100px, 300px, 200px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "200px"
testDiv.style["width"] = "clamp(200px,300px,100px)"
PASS testDiv.style['width'] is "clamp(200px, 300px, 100px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "200px"
testDiv.style["width"] = "clamp((50px + 50px),40px,200px)"
PASS testDiv.style['width'] is "clamp(100px, 40px, 200px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "100px"
testDiv.style["width"] = "clamp(50px + 50px,40px,200px)"
PASS testDiv.style['width'] is "clamp(100px, 40px, 200px)"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "100px"
testDiv.style["width"] = "calc(100px, 200px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "calc(100px 200px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "calc(100px ( 200px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "min(100px 200px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "max(100px 200px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "max(100px,, 200px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "max(100px, , 200px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "max(100px, 200px,)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "clamp(200px,300px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "clamp(200px,300px,)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "clamp(200px,,300px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "clamp((),,300px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
testDiv.style["width"] = "clamp(1px,2px,2px,4px)"
PASS testDiv.style['width'] is "999px"
PASS window.getComputedStyle(testDiv).getPropertyValue('width') is "999px"
PASS successfullyParsed is true
TEST COMPLETE