Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <script src="../resources/js-test.js"></script> | |
| 3 <script> | |
| 4 function test() { | |
| 5 // At bottom-left corner, outside the clip-path region. | |
| 6 shouldNotBe("document.elementFromPoint(25, 75).id", "'image'"); | |
| 7 | |
| 8 // At top-right corner, inside the clip-path region. | |
| 9 shouldBe("document.elementFromPoint(75, 25).id", "'image'"); | |
| 10 } | |
| 11 </script> | |
| 12 <style> | |
| 13 #image { | |
| 14 -webkit-clip-path: url(#clipPathTopLeft); | |
| 15 clip-path: url(#clipPathTopLeft); | |
|
Rick Byers
2015/12/11 16:02:51
So this test covers the 'ClipPathOperation:REFEREN
pdr.
2015/12/11 18:09:23
Good idea, done in the latest patch.
| |
| 16 width: 100px; | |
| 17 height: 100px; | |
| 18 position: absolute; | |
| 19 top: 0; | |
| 20 left: 0; | |
| 21 } | |
| 22 #image:hover { | |
| 23 background: green; | |
| 24 } | |
| 25 </style> | |
| 26 <body onload="test()"> | |
| 27 <p>Image hit testing should not include clipped-out regions.</p> | |
| 28 <svg width="100" height="0"> | |
| 29 <defs> | |
| 30 <clipPath id="clipPathTopLeft"> | |
| 31 <path id="path" d="M 0 0 L 100 100 L 100 0Z" /> | |
| 32 </clipPath> | |
| 33 </defs> | |
| 34 </svg> | |
| 35 <img id="image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFC AYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJgg g=="> | |
| 36 <div id="console"></div> | |
| 37 </body> | |
| OLD | NEW |