| <!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 0px"); | |
| shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('flex')", "6 6 0px"); | |
| 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> |