New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 429140 link

Starred by 5 users

Issue metadata

Status: WontFix
Owner:
Closed: May 2015
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

JS getBoundingClientRect().width not returing correct value if zoomed

Reported by h.jo...@samsung.com, Oct 31 2014

Issue description

Version: TOT
OS: All

What steps will reproduce the problem?
1. Open attached test case in Chrome
2. String "World" overlaps with "Hello"
3.

What is the expected output? What do you see instead?
String should not overlap

Please use labels and text to provide additional information.

 
zoomElementPosition.html
537 bytes View Download

Comment 1 by h.jo...@samsung.com, Oct 31 2014

Labels: Cr-Blink-CSS
Value returned by "getBoundingClientRect().width" is same when zoom value is 1 or > 1

Comment 2 by vivekg@chromium.org, Oct 31 2014

Cc: vivekg@chromium.org
Labels: -Cr-Blink-JavaScript

Comment 4 by tkent@chromium.org, Nov 6 2014

Labels: Cr-Blink-PageZoom
Summary: JS getBoundingClientRect().width not returing correct value if zoomed (was: JS getBoundingClientRect().width not returing correct value)

Comment 5 by dtrebbien@gmail.com, Nov 14 2014

Related:  Issue 431146 

Comment 6 by timloh@chromium.org, Nov 14 2014

 Issue 431146  has been merged into this issue.
Owner: alancutter@chromium.org
Status: WontFix
Jsfiddle version of test case: http://jsfiddle.net/9r0nhfw8/

As there is no spec for CSS Zoom it's not clear how it should interact with getBoundingClientRect().

Personally I disagree that zoom should affect the value returned by getBoundingClientRect(). When the browser is zoomed (using Ctrl-Plus/Minus) it does not affect getBoundingClientRect() because these values are typically reused to position/size elements on the page. If they were affected by zoom then things would get double zoomed and pages would break for those that require browser zoom for accessibility.
Usually you use measurements within the same coordinate space. Example: http://jsfiddle.net/exwt1jwd/

When you create separate coordinate spaces using zoom on sub elements on the page you should be responsible as the developer for managing the conversion of measurements between them.

Sign in to add a comment