OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
| 3 <!-- Test CSS clip and shadow with composited layers. Left and right sides |
| 4 should have the same shape. In old code where this caused a bug, |
| 5 crbug.com/246728, shadows cause a slightly different code path than |
| 6 clip.html without shadow. In this test, the clip is still larger than the |
| 7 shadow's extent; The composited layer should not clamp to the shadow's |
| 8 extent (1 pixel), it should include the full extent of the clip as well (5 |
| 9 pixels). --> |
| 10 |
3 <html> | 11 <html> |
4 <head> | 12 <head> |
5 <style type="text/css" media="screen"> | 13 <style type="text/css" media="screen"> |
6 | 14 |
7 .box { | 15 .box { |
8 position: absolute; | 16 position: absolute; |
9 width: 100px; | 17 width: 100px; |
10 height: 100px; | 18 height: 100px; |
11 top: 20px; | 19 top: 20px; |
12 left: 20px; | 20 left: 20px; |
13 background-color: gray; | 21 background-color: gray; |
| 22 -webkit-box-shadow: 1px 1px 1px 1px gray; |
14 clip: rect(-5px, 105px, 105px, -5px); | 23 clip: rect(-5px, 105px, 105px, -5px); |
15 } | 24 } |
16 | 25 |
17 .inner { | 26 .inner { |
18 position: relative; | 27 position: relative; |
19 width: 120px; | 28 width: 120px; |
20 height: 120px; | 29 height: 120px; |
21 top: -10px; | 30 top: -10px; |
22 left: -10px; | 31 left: -10px; |
23 background-color: rgba(0, 0, 0, 0.2); | 32 background-color: rgba(0, 0, 0, 0.2); |
24 } | 33 } |
25 | 34 |
26 .composited { | 35 .composited { |
27 -webkit-transform: translateZ(1px); | 36 -webkit-transform: translateZ(1px); |
28 } | 37 } |
29 | 38 |
30 p { | 39 p { |
31 margin-top: 140px; | 40 margin-top: 140px; |
32 } | 41 } |
33 </style> | 42 </style> |
34 <script type="text/javascript" charset="utf-8"> | 43 <script type="text/javascript" charset="utf-8"> |
35 if (window.testRunner) { | 44 if (window.testRunner) { |
36 testRunner.dumpAsText(); | 45 testRunner.dumpAsText(); |
37 testRunner.waitUntilDone(); | 46 testRunner.waitUntilDone(); |
38 } | 47 } |
39 | 48 |
40 function doTest() { | 49 function doTest() { |
41 if (window.testRunner) { | 50 if (window.testRunner) { |
42 document.getElementById('layers').innerText = window.internals.layerTree
AsText(document); | 51 document.getElementById('layers').innerText = window.internals.layerTree
AsText(document); |
43 testRunner.notifyDone(); | 52 testRunner.notifyDone(); |
44 } | 53 } |
45 } | 54 } |
46 window.addEventListener('load', doTest, false); | 55 window.addEventListener('load', doTest, false); |
47 </script> | 56 </script> |
48 </head> | 57 </head> |
49 <body> | 58 <body> |
50 | 59 |
51 <div class="composited box"> | 60 <div class="composited box"> |
52 <div class="inner"> | 61 <div class="inner"> |
53 </div> | 62 </div> |
54 </div> | 63 </div> |
55 | 64 |
56 <div class="box" style="left: 220px;"> | 65 <div class="box" style="left: 220px;"> |
57 <div class="composited inner"> | 66 <div class="composited inner"> |
58 </div> | 67 </div> |
59 </div> | 68 </div> |
60 | 69 |
61 <p>Test CSS clip with composited layers. Left and right sides should look the
same.</p> | |
62 <pre id="layers"> | 70 <pre id="layers"> |
63 In DRT, layer tree goes here. | 71 <!-- In DRT, layer tree goes here. --> |
64 </pre> | 72 </pre> |
65 </body> | 73 </body> |
66 </html> | 74 </html> |
OLD | NEW |