OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- Difference between this test and should-not-repaint-composited-style.html i
s that | |
3 this test only changes styles that won't trigger layout to test the non-lay
out | |
4 path of composited layer repaint. --> | |
5 <style> | 2 <style> |
6 .spacer { | 3 #composited-box { |
7 width: 100px; | 4 backface-visibility: hidden; |
8 height: 100px; | 5 position: absolute; |
9 } | 6 background-color: green; |
10 .container { | 7 clip: rect(40px, 110px, 110px, 40px); |
11 -webkit-transform: translateZ(0); | 8 } |
12 position: relative; | 9 .child { |
13 left: 0; | 10 width: 50px; |
14 top: 0; | 11 height: 50px; |
15 height: 100px; | 12 background-color: green; |
16 overflow: hidden; | 13 } |
17 } | 14 .composited { |
18 .child { | 15 backface-visibility: hidden; |
19 position: absolute; | 16 } |
20 width: 150px; | |
21 height: 150px; | |
22 border: 1px black solid; | |
23 background-color: yellow; | |
24 } | |
25 .composited { | |
26 -webkit-transform: translateZ(0); | |
27 } | |
28 </style> | 17 </style> |
29 <style id="old-style"> | 18 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> |
30 .clip { clip: rect(200px, 100px, 100px, 200px); } | |
31 .position { position: relative; } | |
32 .zindex { z-index: 0; } | |
33 .opacity { opacity: 0.99; } | |
34 .transform { -webkit-transform: translateZ(10px); } | |
35 .filter { -webkit-filter: invert(70%); } | |
36 </style> | |
37 <style id="new-style"> | |
38 .clip { clip: rect(100px, 200px, 200px, 100px); } | |
39 .position { position: static; } | |
40 .zindex { z-index: 1; } | |
41 .opacity { opacity: 0.5; } | |
42 .transform { -webkit-transform: translateZ(20px); } | |
43 .filter { -webkit-filter: invert(100%); } | |
44 </style> | |
45 <script src="../../resources/run-after-display.js"></script> | |
46 <script> | 19 <script> |
47 var oldStyle = document.getElementById('old-style'); | 20 function repaintTest() { |
48 var newStyle = document.getElementById('new-style'); | 21 // This will cause a full layer repaint, but should not include the composit
ed child. |
49 newStyle.disabled = true; | 22 document.getElementById('composited-box').style.clip = 'rect(30px, 120px, 12
0px, 30px)'; |
50 | 23 } |
51 function doTest() { | 24 window.onload = runRepaintTest; |
52 internals.startTrackingRepaints(document); | |
53 newStyle.disabled = false; | |
54 oldStyle.disabled = true; | |
55 document.getElementById("console").textContent = internals.layerTreeAsTe
xt(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); | |
56 testRunner.notifyDone(); | |
57 } | |
58 | |
59 if (window.testRunner && window.internals) { | |
60 testRunner.dumpAsText(); | |
61 testRunner.waitUntilDone(); | |
62 runAfterDisplay(doTest); | |
63 } | |
64 </script> | 25 </script> |
65 <h1>position change with composited child</h1> | 26 <div id="composited-box"> |
66 <div class="spacer"><div class="container position"><div class="child composited
"></div></div></div> | 27 <div class="child"></div> |
67 <h1>position change with non-composited child</h1> | 28 <div class="composited child"></div> |
68 <div class="spacer"><div class="container position"><div class="child"></div></d
iv></div> | 29 </div> |
69 <h1>z-index change with composited child</h1> | |
70 <div class="spacer"><div class="container zindex"><div class="child composited">
</div></div></div> | |
71 <h1>z-index change with non-composited child</h1> | |
72 <div class="spacer"><div class="container zindex"><div class="child"></div></div
></div> | |
73 <h1>opacity change with composited child</h1> | |
74 <div class="spacer"><div class="container opacity"><div class="child composited"
></div></div></div> | |
75 <h1>opacity change with non-composited child</h1> | |
76 <div class="spacer"><div class="container opacity"><div class="child"></div></di
v></div> | |
77 <h1>transform change with composited child</h1> | |
78 <div class="spacer"><div class="container transform"><div class="child composite
d"></div></div></div> | |
79 <h1>transform change with non-composited child</h1> | |
80 <div class="spacer"><div class="container transform"><div class="child"></div></
div></div> | |
81 <h1>filter change with composited child</h1> | |
82 <div class="spacer"><div class="container filter"><div class="child composited">
</div></div></div> | |
83 <h1>filter change with non-composited child</h1> | |
84 <div class="spacer"><div class="container filter"><div class="child"></div></div
></div> | |
85 <h1>clip change with composited child</h1> | |
86 <div class="spacer"><div class="container clip"><div class="child composited"></
div></div></div> | |
87 <h1>clip change with non-composited child</h1> | |
88 <div class="spacer"><div class="container clip"><div class="child"></div></div><
/div> | |
89 <pre id="console"></pre> | |
OLD | NEW |