Chromium Code Reviews

Unified Diff: LayoutTests/fast/dynamic/position-change-to-absolute-with-positioned-child-crash.html

Issue 1181983002: Ensure that positioned objects' list is always in parent first order (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaseline one repaint order change for https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/66793/layout-test-results/results.html Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
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>

Powered by Google App Engine