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
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.
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.
Running into this issue as well. Huge problem with sites in the healthcare industry as they love to zoom... Any news on a fix?
@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.
Ok haven't heard anything so created a new bug report http://crbug.com/608142
They've marked it as WONTFIX and have suggestd using getBoundingClientRect instead. I'll give that a go.
@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)
@ryanseddon Thanks for your help following up on this Ryan :thumbsup:
@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.
@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.

Most helpful comment
@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.