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

Side by Side Diff: LayoutTests/compositing/repaint/fixed-pos-with-composited-child.html

Issue 403843002: Convert some layout tests to text-based-repaint tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase tests (due to removal of <pre>) Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 3
4 <head> 4 <head>
5 <script src="../../resources/run-after-display.js"></script> 5 <script src="../../fast/repaint/resources/text-based-repaint.js"></script>
6 <style> 6 <style>
7 7
8 .fixedContainer { 8 .fixedContainer {
9 position: fixed; 9 position: fixed;
10 overflow:hidden; 10 overflow:hidden;
11 background-color: #a0a0a0; 11 background-color: #a0a0a0;
12 bottom: 0px; 12 bottom: 0px;
13 left: 0px; 13 left: 0px;
14 width:400px; 14 width:400px;
15 height: 100px; 15 height: 100px;
16 } 16 }
17 17
18 #foo { 18 #foo {
19 width:200px; 19 width:200px;
20 height: 100px; 20 height: 100px;
21 background-color: #00a0a0; 21 background-color: #00a0a0;
22 -webkit-transform:translateZ(0); 22 -webkit-transform:translateZ(0);
23 } 23 }
24 </style> 24 </style>
25 25
26 <script> 26 <script>
27 if (window.testRunner) {
28 testRunner.dumpAsText();
29 testRunner.waitUntilDone();
30 }
31
32 if (window.internals) { 27 if (window.internals) {
33 /* Note carefully, compositing for fixed position is _disabled_ here */ 28 /* Note carefully, compositing for fixed position is _disabled_ here */
34 internals.settings.setAcceleratedCompositingForFixedPositionEnabled(fals e); 29 internals.settings.setAcceleratedCompositingForFixedPositionEnabled(fals e);
35 } 30 }
36 31
37 function test() 32 function repaintTest()
38 { 33 {
39 runAfterDisplay(function() { 34 window.scrollTo(0, 100);
40 if (window.internals)
41 window.internals.startTrackingRepaints(document);
42
43 window.scrollTo(0, 100);
44
45 runAfterDisplay(function() {
46 if (window.internals)
47 document.getElementById('layers').textContent = window.interna ls.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
48
49 if (window.testRunner)
50 testRunner.notifyDone();
51 });
52 });
53 } 35 }
54 </script> 36 </script>
55 </head> 37 </head>
56 38
57 <body style="height:4000px;" onload="test()"> 39 <body style="height:4000px;" onload="runRepaintTest()">
58 <!-- 40 <!--
59 Among other duplicate bugs: https://code.google.com/p/chromium/issues/det ail?id=151734 41 Among other duplicate bugs: https://code.google.com/p/chromium/issues/det ail?id=151734
60 42
61 In the current code, a layer may actually be composited, but not have its own backing store. 43 In the current code, a layer may actually be composited, but not have its own backing store.
62 In these cases, the layer paints into its composited ancestor with a back ing store. 44 In these cases, the layer paints into its composited ancestor with a back ing store.
63 For fixed-position elements, however, this goes wrong because no other co de 45 For fixed-position elements, however, this goes wrong because no other co de
64 realizes that there is a software-painted fixed-position element. As a r esult, 46 realizes that there is a software-painted fixed-position element. As a r esult,
65 the composited parent does not receive repaint invalidations, and the fix ed-position 47 the composited parent does not receive repaint invalidations, and the fix ed-position
66 element incorrectly appears to be fixed to the composited element rather than the viewport. 48 element incorrectly appears to be fixed to the composited element rather than the viewport.
67 49
68 The scenario that reproduces this: A fixed position element that has an overflow-clip with 50 The scenario that reproduces this: A fixed position element that has an overflow-clip with
69 a composited child. In this case, the fixed-position element needs to be composited. 51 a composited child. In this case, the fixed-position element needs to be composited.
70 However, this is one of the few reasons that does not require that the co mposited layer needs 52 However, this is one of the few reasons that does not require that the co mposited layer needs
71 its own backing store. 53 its own backing store.
72 --> 54 -->
73 55
74 <!-- Scrolling should not cause either div to move around on the viewport. --> 56 <!-- Scrolling should not cause either div to move around on the viewport. -->
75 <div class="fixedContainer"> 57 <div class="fixedContainer">
76 <div id="foo"></div> 58 <div id="foo"></div>
77 </div> 59 </div>
78
79 <pre id="layers"></pre>
80 </body> 60 </body>
81 61
82 </html> 62 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698