OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <div id="log"></div> |
| 5 <div id="container"> |
| 6 <p id="description"> |
| 7 This tests that changing the container's position from fixed or relative to
absolute is safe,<br> |
| 8 when child container with fixed position is present.<br> |
| 9 PASS, if no crash or assert in debug. |
| 10 </p> |
| 11 </div> |
| 12 <script> |
| 13 var valueList = ["static", "relative", "absolute", "fixed"] |
| 14 for (var outerBeforeValue of valueList) { |
| 15 for (var innerValue of valueList) { |
| 16 for (var outerAfterValue of valueList) { |
| 17 if (outerBeforeValue === outerAfterValue) |
| 18 continue; |
| 19 var outerElement = document.createElement("div"); |
| 20 var innerElement = document.createElement("div"); |
| 21 outerElement.style.position = outerBeforeValue; |
| 22 innerElement.style.position = innerValue; |
| 23 outerElement.appendChild(innerElement); |
| 24 container.appendChild(outerElement); |
| 25 test(function () { |
| 26 document.body.offsetHeight; |
| 27 outerElement.style.position = outerAfterValue; |
| 28 // No assert() are needed, we just check layout hits no ASSERT n
or crash. |
| 29 document.body.offsetHeight; |
| 30 }, "position:" + outerBeforeValue + " with a " + innerValue + " chil
d to " + outerAfterValue); |
| 31 } |
| 32 } |
| 33 } |
| 34 </script> |
OLD | NEW |