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

Side by Side Diff: LayoutTests/fast/repaint/position-change-keeping-geometry.html

Issue 253313005: Strip anonymous blocks when change in style removes need for them (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 1 month 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 <script src="resources/text-based-repaint.js"></script> 2 <script src="resources/text-based-repaint.js"></script>
3 <script> 3 <script>
4 function changePositionKeepingGeometry(id, newPosition) { 4 function changePositionKeepingGeometry(id, newPosition) {
5 var target = document.getElementById(id); 5 var target = document.getElementById(id);
6 var originalTop = target.offsetTop; 6 var originalTop = target.offsetTop;
7 var originalLeft = target.offsetLeft; 7 var originalLeft = target.offsetLeft;
8 target.style.position = newPosition; 8 target.style.position = newPosition;
9 target.style.top = originalTop + 'px'; 9 target.style.top = originalTop + 'px';
10 target.style.left = originalLeft + 'px'; 10 target.style.left = originalLeft + 'px';
(...skipping 10 matching lines...) Expand all
21 <style> 21 <style>
22 body { 22 body {
23 margin: 0; 23 margin: 0;
24 } 24 }
25 div { 25 div {
26 width: 100px; 26 width: 100px;
27 height: 100px; 27 height: 100px;
28 top: 20px; 28 top: 20px;
29 background-color: blue; 29 background-color: blue;
30 } 30 }
31 #target0 {
32 left: 20px;
33 position: relative;
34 }
31 #target1 { 35 #target1 {
32 left: 20px; 36 left: 20px;
33 position: relative; 37 position: relative;
34 } 38 }
35 #target2 { 39 #target2 {
36 left: 220px; 40 left: 220px;
37 position: fixed; 41 position: fixed;
38 z-index: 0; 42 z-index: 0;
39 } 43 }
40 #target3 { 44 #target3 {
41 left: 420px; 45 left: 420px;
42 position: absolute; 46 position: absolute;
43 z-index: 0; 47 z-index: 0;
44 } 48 }
45 </style> 49 </style>
46 There should be no invalildations on change of position without actual change of position and size. 50 There should be no invalildations on change of position without actual change of position and size.
51 <!-- target0 ensures we don't strip anonymous wrappers (and trigger a layout) wh en the other elements change position. -->
52 <div id="target0"></div>
47 <div id="target1"></div> 53 <div id="target1"></div>
48 <div id="target2"></div> 54 <div id="target2"></div>
49 <div id="target3"></div> 55 <div id="target3"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698