| Index: LayoutTests/fast/dynamic/position-change-to-absolute-with-positioned-child-crash.html
|
| diff --git a/LayoutTests/fast/dynamic/position-change-to-absolute-with-positioned-child-crash.html b/LayoutTests/fast/dynamic/position-change-to-absolute-with-positioned-child-crash.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fb00acadf5c3c3ed9b7e91b603e43e332903952a
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/dynamic/position-change-to-absolute-with-positioned-child-crash.html
|
| @@ -0,0 +1,144 @@
|
| +<!DOCTYPE HTML>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<div id="log"></div>
|
| +<div id="container">
|
| +<p id="description">
|
| + This tests that changing the container's position from fixed or relative to absolute is safe,<br>
|
| + when child container with fixed position is present.<br>
|
| + PASS, if no crash or assert in debug.
|
| +</p>
|
| +</div>
|
| +<script>
|
| +var valueList = ["static", "relative", "absolute", "fixed"]
|
| +for (var outerValue of valueList) {
|
| + for (var innerValue of valueList) {
|
| + for (var afterValue of valueList) {
|
| + if (outerValue !== afterValue) {
|
| + test(function () {
|
| + var outerElement = document.createElement("div");
|
| + var innerElement = document.createElement("div");
|
| + outerElement.style.position = outerValue;
|
| + innerElement.style.position = innerValue;
|
| + outerElement.appendChild(innerElement);
|
| + container.appendChild(outerElement);
|
| + document.body.offsetHeight;
|
| +
|
| + outerElement.style.position = afterValue;
|
| + // No assert() are needed, we just check layout hits no ASSERT nor crash.
|
| + document.body.offsetHeight;
|
| + }, "position:" + outerValue + " with a " + innerValue + " child to " + afterValue);
|
| + test(function () {
|
| + var outerElement = document.createElement("div");
|
| + var innerElement = document.createElement("div");
|
| + outerElement.style.position = outerValue;
|
| + outerElement.style.transform = "rotate(3deg)";
|
| + innerElement.style.position = innerValue;
|
| + outerElement.appendChild(innerElement);
|
| + container.appendChild(outerElement);
|
| + document.body.offsetHeight;
|
| +
|
| + outerElement.style.position = afterValue;
|
| + // No assert() are needed, we just check layout hits no ASSERT nor crash.
|
| + document.body.offsetHeight;
|
| + }, "position:" + outerValue + " with a " + innerValue + " child to " + afterValue);
|
| + test(function () {
|
| + var outerElement = document.createElement("div");
|
| + var innerElement = document.createElement("div");
|
| + outerElement.style.position = outerValue;
|
| + outerElement.style.transform = "rotate(3deg)";
|
| + innerElement.style.position = innerValue;
|
| + outerElement.appendChild(innerElement);
|
| + container.appendChild(outerElement);
|
| + document.body.offsetHeight;
|
| +
|
| + outerElement.style.position = afterValue;
|
| + outerElement.style.transform = "none";
|
| + innerElement.style.width = "50%";
|
| + // No assert() are needed, we just check layout hits no ASSERT nor crash.
|
| + document.body.offsetHeight;
|
| + }, "position:" + outerValue + " and transform with a " + innerValue + " child to " + afterValue + " without transform");
|
| + }
|
| + test(function () {
|
| + var outerElement = document.createElement("div");
|
| + var midElement = document.createElement("div");
|
| + var innerElement = document.createElement("div");
|
| + outerElement.style.position = outerValue;
|
| + innerElement.style.position = innerValue;
|
| + outerElement.appendChild(midElement);
|
| + midElement.appendChild(innerElement);
|
| + container.appendChild(outerElement);
|
| + document.body.offsetHeight;
|
| +
|
| + midElement.style.position = afterValue;
|
| + innerElement.style.width = "50%";
|
| + // No assert() are needed, we just check layout hits no ASSERT nor crash.
|
| + document.body.offsetHeight;
|
| + }, "position:" + outerValue + " and transform with a " + innerValue + " child to " + afterValue + " without transform");
|
| + test(function () {
|
| + var outerElement = document.createElement("div");
|
| + var midElement = document.createElement("div");
|
| + var innerElement = document.createElement("div");
|
| + outerElement.style.position = outerValue;
|
| + innerElement.style.position = innerValue;
|
| + outerElement.appendChild(midElement);
|
| + midElement.appendChild(innerElement);
|
| + container.appendChild(outerElement);
|
| + document.body.offsetHeight;
|
| +
|
| + midElement.style.transform = "translateX(0)";
|
| + innerElement.style.width = "50%";
|
| + // No assert() are needed, we just check layout hits no ASSERT nor crash.
|
| + document.body.offsetHeight;
|
| + }, "position:" + outerValue + " and transform with a " + innerValue + " child to " + afterValue + " without transform");
|
| + test(function () {
|
| + var outerElement = document.createElement("div");
|
| + var midElement = document.createElement("div");
|
| + var innerElement = document.createElement("div");
|
| + outerElement.style.position = outerValue;
|
| + midElement.style.transform = "translateX(0)";
|
| + innerElement.style.position = innerValue;
|
| + outerElement.appendChild(midElement);
|
| + midElement.appendChild(innerElement);
|
| + container.appendChild(outerElement);
|
| + document.body.offsetHeight;
|
| +
|
| + midElement.style.transform = "none";
|
| + innerElement.style.width = "50%";
|
| + // No assert() are needed, we just check layout hits no ASSERT nor crash.
|
| + document.body.offsetHeight;
|
| + }, "position:" + outerValue + " and transform with a " + innerValue + " child to " + afterValue + " without transform");
|
| + }
|
| + test(function () {
|
| + var outerElement = document.createElement("div");
|
| + var innerElement = document.createElement("div");
|
| + outerElement.style.position = outerValue;
|
| + innerElement.style.position = innerValue;
|
| + outerElement.appendChild(innerElement);
|
| + container.appendChild(outerElement);
|
| + document.body.offsetHeight;
|
| +
|
| + outerElement.style.transform = "rotate(3deg)";
|
| + innerElement.style.width = "50%";
|
| + // No assert() are needed, we just check layout hits no ASSERT nor crash.
|
| + document.body.offsetHeight;
|
| + }, "Add transform position:" + outerValue + " with a " + innerValue + " child");
|
| +//if (outerValue != "relative" || innerValue != "fixed") continue;
|
| + test(function () {
|
| + var outerElement = document.createElement("div");
|
| + var innerElement = document.createElement("div");
|
| + outerElement.style.position = outerValue;
|
| + outerElement.style.transform = "rotate(3deg)";
|
| + innerElement.style.position = innerValue;
|
| + outerElement.appendChild(innerElement);
|
| + container.appendChild(outerElement);
|
| + document.body.offsetHeight;
|
| +
|
| + outerElement.style.transform = "none";
|
| + innerElement.style.width = "50%";
|
| + // No assert() are needed, we just check layout hits no ASSERT nor crash.
|
| + document.body.offsetHeight;
|
| + }, "Remove transform from position:" + outerValue + " and transform with a " + innerValue + " child");
|
| + }
|
| +}
|
| +</script>
|
|
|