WebKit Bugzilla
Attachment 338891 Details for
Bug 185034
: getBoundingClientRect() x and y are divided by CSS zoom
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Small test case
zoom_test.html (text/html), 597 bytes, created by
Juan Pablo Ugarte
on 2018-04-26 10:51:53 PDT
(
hide
)
Description:
Small test case
Filename:
MIME Type:
Creator:
Juan Pablo Ugarte
Created:
2018-04-26 10:51:53 PDT
Size:
597 bytes
patch
obsolete
><html> > <h1>getBoundingClientRect() x and y are multiplied by 1/zoom</h1> > <canvas id="test"></canvas> ><script type="text/javascript"> > >function printBoundingClientRect (e) { > let rect = e.getBoundingClientRect(); > console.log(`${e.id}: Position: ${rect.left}x${rect.top}, size: ${rect.width}x${rect.height}, scrollY=${window.scrollY}`); >} > >window.onload = function () { > let canvas = window.document.getElementById('test'); > > printBoundingClientRect (canvas); > > canvas.style.background = 'red'; > canvas.style.zoom = 0.5; > > printBoundingClientRect (canvas); >}; > ></script> ></html>
<html> <h1>getBoundingClientRect() x and y are multiplied by 1/zoom</h1> <canvas id="test"></canvas> <script type="text/javascript"> function printBoundingClientRect (e) { let rect = e.getBoundingClientRect(); console.log(`${e.id}: Position: ${rect.left}x${rect.top}, size: ${rect.width}x${rect.height}, scrollY=${window.scrollY}`); } window.onload = function () { let canvas = window.document.getElementById('test'); printBoundingClientRect (canvas); canvas.style.background = 'red'; canvas.style.zoom = 0.5; printBoundingClientRect (canvas); }; </script> </html>
View Attachment As Raw
Actions:
View
Attachments on
bug 185034
: 338891 |
339011
|
339432
|
339444
|
339451
|
339464
|
339466
|
339476
|
339502