blob: ff05fb93fb13ec57a7197115f1b93f35bdc187a7 [file] [log] [blame]
<!DOCTYPE html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<div id="testDiv"></div>
<script>
description("Tests assigning a calculated values to 'flex' CSS property.");
var testDiv = document.getElementById("testDiv");
shouldBeEmptyString("testDiv.style['flex']");
evalAndLog("testDiv.style['flex'] = 'calc(2 * 3) calc(2 * 3)'");
shouldBeEqualToString("testDiv.style['flex']", "6 6 0%");
shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('flex')", "6 6 0%");
evalAndLog("testDiv.style['flex'] = 'calc(2 * 3) calc(2 * 3) calc(10% * 2)'");
shouldBeEqualToString("testDiv.style['flex']", "6 6 calc(20%)");
shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('flex')", "6 6 20%");
evalAndLog("testDiv.style['flex'] = 'calc(2 * 3) calc(2 * 3) calc(3 - 3)'");
shouldBeEqualToString("testDiv.style['flex']", "6 6 0px");
shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('flex')", "6 6 0px");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>