OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 <style> |
| 6 span { |
| 7 background-color: lightgray; |
| 8 border-radius: 2em; |
| 9 padding: 1em; |
| 10 line-height: 4em; |
| 11 } |
| 12 |
| 13 label { |
| 14 padding: 2em; |
| 15 background-color: lightgreen; |
| 16 border-radius: 2em; |
| 17 } |
| 18 |
| 19 div { |
| 20 margin: 2em; |
| 21 } |
| 22 </style> |
| 23 </head> |
| 24 <body> |
| 25 <div> |
| 26 <span id="A"> |
| 27 Two lines with <br/>a hard line break. |
| 28 </span> |
| 29 </div> |
| 30 <div> |
| 31 <span id="B">B<label id="C">C</label></span> |
| 32 </div> |
| 33 <div> |
| 34 <span id="D" style="padding: 2em;">D<label id="E" style="padding: 1em;">E</label
></span> |
| 35 </div> |
| 36 <div id="console"></div> |
| 37 </body> |
| 38 <script> |
| 39 description('If this test passes, area outside border radius is body element.'); |
| 40 |
| 41 var rects = document.getElementById('A').getClientRects(); |
| 42 var elementInTopLeftCorner = document.elementFromPoint(rects[0].left, rects[0].t
op); |
| 43 shouldBeEqualToString('elementInTopLeftCorner.nodeName', 'DIV'); |
| 44 elementInTopLeftCorner = document.elementFromPoint(rects[1].left, rects[1].top); |
| 45 shouldBeEqualToString('elementInTopLeftCorner.nodeName', 'SPAN'); |
| 46 |
| 47 var rect = document.getElementById('B').getBoundingClientRect(); |
| 48 elementInTopLeftCorner = document.elementFromPoint(rect.left, rect.top); |
| 49 shouldBeEqualToString('elementInTopLeftCorner.nodeName', 'DIV'); |
| 50 |
| 51 rect = document.getElementById('C').getBoundingClientRect(); |
| 52 elementInTopLeftCorner = document.elementFromPoint(rect.left, rect.top); |
| 53 shouldBeEqualToString('elementInTopLeftCorner.nodeName', 'BODY'); |
| 54 |
| 55 rect = document.getElementById('D').getBoundingClientRect(); |
| 56 elementInTopLeftCorner = document.elementFromPoint(rect.left, rect.top); |
| 57 shouldBeEqualToString('elementInTopLeftCorner.nodeName', 'BODY'); |
| 58 |
| 59 rect = document.getElementById('E').getBoundingClientRect(); |
| 60 elementInTopLeftCorner = document.elementFromPoint(rect.left, rect.top); |
| 61 shouldBeEqualToString('elementInTopLeftCorner.nodeName', 'SPAN'); |
| 62 </script> |
| 63 </html> |
OLD | NEW |