| OLD | NEW |
| 1 description("This tests that page scaling and CSS transforms do not affect mouse
event pageX and pageY coordinates for " + | 1 description("This tests that page scaling and CSS transforms do not affect mouse
event pageX and pageY coordinates for " + |
| 2 "content embedded in an iframe."); | 2 "content embedded in an iframe."); |
| 3 | 3 |
| 4 var html = document.documentElement; | 4 var html = document.documentElement; |
| 5 | 5 |
| 6 var iframe = document.createElement("iframe"); | 6 var iframe = document.createElement("iframe"); |
| 7 iframe.style.border = "none"; | 7 iframe.style.border = "none"; |
| 8 iframe.style.width = "200px"; | 8 iframe.style.width = "200px"; |
| 9 iframe.style.height = "200px"; | 9 iframe.style.height = "200px"; |
| 10 iframe.style.background = "green"; | 10 iframe.style.background = "green"; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 html.style["-webkit-transform-origin"] = "0 0"; | 68 html.style["-webkit-transform-origin"] = "0 0"; |
| 69 testEvents(0, "CSS scale(0.5, 2.0)", "click(20, 5)"); | 69 testEvents(0, "CSS scale(0.5, 2.0)", "click(20, 5)"); |
| 70 | 70 |
| 71 window.internals.setPageScaleFactor(0.5, 0, 0); | 71 window.internals.setPageScaleFactor(0.5, 0, 0); |
| 72 testEvents(0, "setPageScale(0.5), CSS scale(0.5, 2.0)", "click(40, 10)"); | 72 testEvents(0, "setPageScale(0.5), CSS scale(0.5, 2.0)", "click(40, 10)"); |
| 73 } | 73 } |
| 74 | 74 |
| 75 finishJSTest(); | 75 finishJSTest(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 // Mouse events only work after an initial layout |
| 79 document.body.offsetLeft; |
| 80 |
| 78 // Add the iframe to the document. | 81 // Add the iframe to the document. |
| 79 iframe.src = "resources/page-scaled-mouse-click-iframe-inner.html"; | 82 iframe.src = "resources/page-scaled-mouse-click-iframe-inner.html"; |
| 80 document.body.insertBefore(iframe, document.body.firstChild); | 83 document.body.insertBefore(iframe, document.body.firstChild); |
| 81 | 84 |
| 82 window.jsTestIsAsync = true; | 85 window.jsTestIsAsync = true; |
| OLD | NEW |