Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side 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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 outerValue of valueList) {
15 for (var innerValue of valueList) {
16 for (var afterValue of valueList) {
17 if (outerValue !== afterValue) {
18 test(function () {
19 var outerElement = document.createElement("div");
20 var innerElement = document.createElement("div");
21 outerElement.style.position = outerValue;
22 innerElement.style.position = innerValue;
23 outerElement.appendChild(innerElement);
24 container.appendChild(outerElement);
25 document.body.offsetHeight;
26
27 outerElement.style.position = afterValue;
28 // No assert() are needed, we just check layout hits no ASSE RT nor crash.
29 document.body.offsetHeight;
30 }, "position:" + outerValue + " with a " + innerValue + " child to " + afterValue);
31 test(function () {
32 var outerElement = document.createElement("div");
33 var innerElement = document.createElement("div");
34 outerElement.style.position = outerValue;
35 outerElement.style.transform = "rotate(3deg)";
36 innerElement.style.position = innerValue;
37 outerElement.appendChild(innerElement);
38 container.appendChild(outerElement);
39 document.body.offsetHeight;
40
41 outerElement.style.position = afterValue;
42 // No assert() are needed, we just check layout hits no ASSE RT nor crash.
43 document.body.offsetHeight;
44 }, "position:" + outerValue + " with a " + innerValue + " child to " + afterValue);
45 test(function () {
46 var outerElement = document.createElement("div");
47 var innerElement = document.createElement("div");
48 outerElement.style.position = outerValue;
49 outerElement.style.transform = "rotate(3deg)";
50 innerElement.style.position = innerValue;
51 outerElement.appendChild(innerElement);
52 container.appendChild(outerElement);
53 document.body.offsetHeight;
54
55 outerElement.style.position = afterValue;
56 outerElement.style.transform = "none";
57 innerElement.style.width = "50%";
58 // No assert() are needed, we just check layout hits no ASSE RT nor crash.
59 document.body.offsetHeight;
60 }, "position:" + outerValue + " and transform with a " + innerVa lue + " child to " + afterValue + " without transform");
61 }
62 test(function () {
63 var outerElement = document.createElement("div");
64 var midElement = document.createElement("div");
65 var innerElement = document.createElement("div");
66 outerElement.style.position = outerValue;
67 innerElement.style.position = innerValue;
68 outerElement.appendChild(midElement);
69 midElement.appendChild(innerElement);
70 container.appendChild(outerElement);
71 document.body.offsetHeight;
72
73 midElement.style.position = afterValue;
74 innerElement.style.width = "50%";
75 // No assert() are needed, we just check layout hits no ASSERT n or crash.
76 document.body.offsetHeight;
77 }, "position:" + outerValue + " and transform with a " + innerValue + " child to " + afterValue + " without transform");
78 test(function () {
79 var outerElement = document.createElement("div");
80 var midElement = document.createElement("div");
81 var innerElement = document.createElement("div");
82 outerElement.style.position = outerValue;
83 innerElement.style.position = innerValue;
84 outerElement.appendChild(midElement);
85 midElement.appendChild(innerElement);
86 container.appendChild(outerElement);
87 document.body.offsetHeight;
88
89 midElement.style.transform = "translateX(0)";
90 innerElement.style.width = "50%";
91 // No assert() are needed, we just check layout hits no ASSERT n or crash.
92 document.body.offsetHeight;
93 }, "position:" + outerValue + " and transform with a " + innerValue + " child to " + afterValue + " without transform");
94 test(function () {
95 var outerElement = document.createElement("div");
96 var midElement = document.createElement("div");
97 var innerElement = document.createElement("div");
98 outerElement.style.position = outerValue;
99 midElement.style.transform = "translateX(0)";
100 innerElement.style.position = innerValue;
101 outerElement.appendChild(midElement);
102 midElement.appendChild(innerElement);
103 container.appendChild(outerElement);
104 document.body.offsetHeight;
105
106 midElement.style.transform = "none";
107 innerElement.style.width = "50%";
108 // No assert() are needed, we just check layout hits no ASSERT n or crash.
109 document.body.offsetHeight;
110 }, "position:" + outerValue + " and transform with a " + innerValue + " child to " + afterValue + " without transform");
111 }
112 test(function () {
113 var outerElement = document.createElement("div");
114 var innerElement = document.createElement("div");
115 outerElement.style.position = outerValue;
116 innerElement.style.position = innerValue;
117 outerElement.appendChild(innerElement);
118 container.appendChild(outerElement);
119 document.body.offsetHeight;
120
121 outerElement.style.transform = "rotate(3deg)";
122 innerElement.style.width = "50%";
123 // No assert() are needed, we just check layout hits no ASSERT nor c rash.
124 document.body.offsetHeight;
125 }, "Add transform position:" + outerValue + " with a " + innerValue + " child");
126 //if (outerValue != "relative" || innerValue != "fixed") continue;
127 test(function () {
128 var outerElement = document.createElement("div");
129 var innerElement = document.createElement("div");
130 outerElement.style.position = outerValue;
131 outerElement.style.transform = "rotate(3deg)";
132 innerElement.style.position = innerValue;
133 outerElement.appendChild(innerElement);
134 container.appendChild(outerElement);
135 document.body.offsetHeight;
136
137 outerElement.style.transform = "none";
138 innerElement.style.width = "50%";
139 // No assert() are needed, we just check layout hits no ASSERT nor c rash.
140 document.body.offsetHeight;
141 }, "Remove transform from position:" + outerValue + " and transform with a " + innerValue + " child");
142 }
143 }
144 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698