Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generatedcontent + chrome + zoom #1935

Closed
MariuszGorzoch opened this issue Mar 22, 2016 · 9 comments
Closed

generatedcontent + chrome + zoom #1935

MariuszGorzoch opened this issue Mar 22, 2016 · 9 comments

Comments

@MariuszGorzoch
Copy link

We have notice that "generatedcontent" test on modernizer is giving us false in case of chrome when user will use "zoom" feature.

You can simply reproduce problem by going to:
https://www.browserleaks.com/modernizr
changing zoom to 125% and refreshing page.

Doing above even if you were getting "Modernizr.generatedcontent" = true for 100% zoom, then in 125% you will get false.

Can you advice how to fix that?

Chrome = 49.0.2623.87 m
Modernizr = v3.3.1

@anthonycosgrave
Copy link

I've noticed Users having a similar issue on the generated content test when at 90% and 125% zoom in Chrome (version 49.0.2623.87 m).

The version of Modernizr we're using is 2.8.3.

I can see in the CSS generated content detection test that when the zoom is 90% or 125% the node.offsetHeight is 2 and not >=3.

@ryanseddon
Copy link
Member

This has come up in a few other tests too where page zoom returns the wrong results, chrome fixed it for scrollHeight and scrollWidth but weirdly didn't fix offsetWidth/Height.

@tramirez89
Copy link

Running into this issue as well. Huge problem with sites in the healthcare industry as they love to zoom... Any news on a fix?

@ryanseddon
Copy link
Member

@tramirez89 I've left a comment on the chromium bug report page that looks like a similar issue to what we're seeing here. I'll see what comes out of that.

@ryanseddon
Copy link
Member

Ok haven't heard anything so created a new bug report http://crbug.com/608142

@ryanseddon
Copy link
Member

They've marked it as WONTFIX and have suggestd using getBoundingClientRect instead. I'll give that a go.

@stucox
Copy link
Member

stucox commented May 27, 2016

@anthonycosgrave are you using an old version of Modernizr? The generatedcontent detect checks for offsetHeight >=7, not 3 (I believe it changed a while ago because of similar bugs)

I presume it's a rounding error... can't we just increase the tolerance? Use a font size of 20px or something (and still check for >= 7)

@anthonycosgrave
Copy link

@ryanseddon Thanks for your help following up on this Ryan 👍

@stucox yep, the system was released with version 2.8.3 and it was testing a very small number of features during a transitional phase from an "older browser" supporting system to a newer system.

At the moment we're trialing a rough workaround using devicePixelRatio and a bit of UA sniffing for Chrome. Fragile and not ideal I know but so far it appears to be doing the job.

@ryanseddon
Copy link
Member

@stucox yeah we could just change the current detect to check for >=6 as when chrome is zoomed the value gets rounded down to 6.

Tried getBoundingClientRect and it doesn't give stable numbers when zoomed either.

screen shot 2016-05-28 at 3 13 14 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants