New issue
Advanced search Search tips

Issue 652626 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

getBoundingClientRect returns incorrect values with a button containing an icon

Reported by lingta...@gmail.com, Oct 4 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:49.0) Gecko/20100101 Firefox/49.0

Steps to reproduce the problem:
I have a page with a "button" tag containing an "i" tag.
When I measure the width of the button (by taking a screenshot) I get a width of 144px, but if I use the getBoundingClientRect method in chrome 53/55, it returns 194.625px. 

The experiment above is described with greater details here:
https://github.com/lingtalfi/browsers-behaviours/blob/master/get-bounding-client-rect/bcr-icon.md

What is the expected behavior?
I expected that getBoundingClientRect's method would return an object with the actual/accurate width of the button on the screen.

What went wrong?
It seems to add 50px, I'm not sure why.

Did this work before? N/A 

Chrome version: 53  Channel: n/a
OS Version: OS X 10.11
Flash Version: Shockwave Flash 23.0 r0
 
Components: -Blink Blink>Layout
-> layout. Can't reproduce on ChromeOS, but I don't have a Mac available for testing.
 Issue 654260  has been merged into this issue.

Comment 3 by drott@chromium.org, Oct 10 2016

Labels: -Pri-2 Pri-3
Status: WontFix (was: Unconfirmed)
If you remove the Google fonts <link rel> tag, you get the larger result, since the box spells "favorite" instead of the heart icon. I'd suggest to fix the font load race condition in the bug, by using document.fonts.ready for example. Once the font is loaded, as in the http://codepen.io/lingtalfi/pen/dpmOPp issue, when touching any of the HTML and rerunning it in codepen, you will get the expected result of 144px. I don't see any issue in Chrome here. Please reopen if you have a new test case or still believe there is a bug.

Comment 4 by lingta...@gmail.com, Oct 11 2016

Oh, thanks. I was unaware of the browsers downloading font problem. 
That's indeed the problem.

Sign in to add a comment