| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <style> | 2 <style> |
| 3 #box { | 3 #box { |
| 4 position: absolute; | 4 position: absolute; |
| 5 left: 0; | 5 left: 0; |
| 6 top: 0; | 6 top: 0; |
| 7 width: 100px; | 7 width: 100px; |
| 8 height: 100px; | 8 height: 100px; |
| 9 background: green; | 9 background: green; |
| 10 box-shadow: 1.4px 1.4px blue; | 10 box-shadow: 1.4px 1.4px blue; |
| 11 } | 11 } |
| 12 </style> | 12 </style> |
| 13 <div id="box"></div> | 13 <div id="box"></div> |
| 14 <script src="../../resources/js-test.js"></script> | 14 <script src="../../fast/../resources/js-test.js"></script> |
| 15 <script src="../../resources/run-after-layout-and-paint.js"></script> | 15 <script src="../../fast/../resources/run-after-layout-and-paint.js"></script> |
| 16 <script> | 16 <script> |
| 17 var jsTestIsAsync = true; | 17 var jsTestIsAsync = true; |
| 18 description('Tests whether a repaint rect encompasses box-shadow with subpixel o
ffset when the shadow changes.'); | 18 description('Tests whether a repaint rect encompasses box-shadow with subpixel o
ffset when the shadow changes.'); |
| 19 | 19 |
| 20 // Accepts [x, y, width, height] rects. Checks if the first argument contains th
e second. | 20 // Accepts [x, y, width, height] rects. Checks if the first argument contains th
e second. |
| 21 function rectContainsRect(outer, inner) { | 21 function rectContainsRect(outer, inner) { |
| 22 return outer[0] <= inner[0] | 22 return outer[0] <= inner[0] |
| 23 && outer[1] <= inner[1] | 23 && outer[1] <= inner[1] |
| 24 && outer[0] + outer[2] >= inner[0] + inner[2] | 24 && outer[0] + outer[2] >= inner[0] + inner[2] |
| 25 && outer[1] + outer[3] >= inner[1] + inner[3]; | 25 && outer[1] + outer[3] >= inner[1] + inner[3]; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 else | 43 else |
| 44 testFailed('Subpixel shadow ' + JSON.stringify(shadowRect) + ' w
as not repainted. Repaint rects were ' + JSON.stringify(repaintRects) + '.'); | 44 testFailed('Subpixel shadow ' + JSON.stringify(shadowRect) + ' w
as not repainted. Repaint rects were ' + JSON.stringify(repaintRects) + '.'); |
| 45 | 45 |
| 46 internals.stopTrackingRepaints(document); | 46 internals.stopTrackingRepaints(document); |
| 47 box.remove(); | 47 box.remove(); |
| 48 finishJSTest(); | 48 finishJSTest(); |
| 49 }); | 49 }); |
| 50 }); | 50 }); |
| 51 } | 51 } |
| 52 </script> | 52 </script> |
| OLD | NEW |