OLD | NEW |
(Empty) | |
| 1 <style> |
| 2 div { |
| 3 display: flex; |
| 4 font-family: 'Helvetica Neue', sans-serif; |
| 5 zoom: 150%; |
| 6 } |
| 7 |
| 8 </style> |
| 9 <div> |
| 10 <span>Drag from behind of button to this text.</span> |
| 11 <button></button> |
| 12 </div> |
| 13 <script> |
| 14 function applyZoom(rect, zoom) |
| 15 { |
| 16 var newRect = { |
| 17 left : rect.left * zoom, |
| 18 top : rect.top * zoom, |
| 19 width : rect.width * zoom, |
| 20 height : rect.height * zoom |
| 21 }; |
| 22 return newRect; |
| 23 }; |
| 24 |
| 25 var zoom = getComputedStyle(document.querySelector('div')).getPropertyValue('zoo
m'); |
| 26 var buttonRect = applyZoom(document.querySelector('button').getBoundingClientRec
t(), zoom); |
| 27 var spanRect = applyZoom(document.querySelector('span').getBoundingClientRect(),
zoom); |
| 28 |
| 29 if (window.testRunner) { |
| 30 eventSender.mouseMoveTo(buttonRect.left + buttonRect.width * 2, buttonRect.top
+ buttonRect.height / 2); |
| 31 eventSender.mouseDown(); |
| 32 eventSender.leapForward(100); |
| 33 eventSender.mouseMoveTo(spanRect.left + spanRect.width / 2, spanRect.top + spa
nRect.height / 2); |
| 34 eventSender.mouseUp(); |
| 35 } |
| 36 </script> |
OLD | NEW |