-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Incorrect false for generated content on Android 4.0 #738
Comments
Wow bizarro, Android has some interesting behaviour. Any font-size less than 5px will not affect the height of the test element and return 0 on testing the Will get a fix in real soon. Thanks. |
@thany can you run this testcase and let me know if this alerts true http://jsfiddle.net/kSrqy/28/ |
Very cool :) /edit |
I'm not too worried about Safari 3.2 since it's not on our radar for testing, plus the fact that browserstack doesn't even go that far back for Safari versions I have no way to test it. If you can find a fix yourself I'll add it in otherwise I won't worry. |
I get my old browsers from here: But thanks again for the fix for Android. I'll look forward to the next release. |
@thany feel free to do a pull request if you find a fix for Safari 3.2 otherwise I'll leave it as a known issue. |
* 'master' of github.com:Modernizr/Modernizr: Fixed false positive of 3d transforms if test element inherits margin, padding or border, fixes Modernizr#740 Fix false negative in Android 4, fixes Modernizr#738 Update feature-detects/exif-orientation.js Trim trailing whitespace and insert final newlines
Did this make it into the build as I'm running on Android 4.0.3 (Stock browser version 4.0.2215272349.382087) and Modernizr 2.7.1 and it's still flagging incorrectly? |
If you look at the changes you'll see the size of the element to check on has been increased to 7px... Perhaps you encountered a situation where the minimum size that makes M report correctly on Android is larger? |
Is there are reason it was set to 7px? What's the logic behind it? |
Or, if you are using a font on the entire site that does not include glyphs for ":" and ")" characters, it also wouldn't work. One hell of an edge case, but it could theoretically happen ;) Anyway, I think @ryanseddon would know the answer to your question ;) |
Hmmm that might be the cause. I'm using an Icomoon font set for icons. I'm using the icomoon font on my menu items and falling back to a png for browsers that don't support it. I'm seeing both in Android. Do I take it that if I added ':' or ')' to my set it might start working? |
@jeepstone hard to say what exactly is happening. Are you able to create a small testcase that reproduces this issue? |
@ryanseddon The only thing I have is a fully built site (currently in test). Is that any use? I'd prefer not to post the link on here. Where should I send it (if it's any use)? |
I've used BrowserStack to identify that it only affects Android browsers running on Android 4.0. I have checked the following: Working correctly: Samsung Galaxy S (2.2), Samsung Galaxy S2 (2.3), Samsung Galaxy S3 (4.1), LG Nexus 4 (4.2) Failing: Samsung Galaxy Nexus (4.0), HTC Evo 3D (4.0), HTC Sensation XE (4.0) I've also added both the : and ) to the Icomoon font with no joy |
We’ve seen rounding issues with this kind of test when browser windows are zoomed. The rules for mobile browser zooming are a bit funny, so even if you don’t think it’s zoomed this might be worth trying anyway. As a quick hack test, could you find |
Hi @stucox I could only find s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}) in custom build 2.7.1. Changing the offsetHeight doesn't have an effect. Does the font:3px also need changing? |
Ah, I’m guessing the fix above was merged after we released v2.6.2. In which case, we probably don’t have a stable build which includes this yet (sorry…). Releases since v2.6.2 have just been emergency backport fixes. If we ask @patrickkettner nicely he might do a v2.7.2 with this fix in it… But for now, you could try changing the code to |
Sadly no joy :( with the bug fix. I've heard that @patrickkettner is a lovely human though...... |
What does it report if you change |
0 in Stock android |
Sorry, just noticed above I should have said the code should be But if that doesn’t work, what’s |
Bingo! 7px returns 7 for both Chrome and stock Android and now works and returns the correct value for generated content! Many thanks! |
Yeah from my testing 7px was the magic number which I mention above. #738 (comment) |
Thanks @ryanseddon makes sense now. |
* 'master' of github.com:Modernizr/Modernizr: Fixed false positive of 3d transforms if test element inherits margin, padding or border, fixes Modernizr#740 Fix false negative in Android 4, fixes Modernizr#738 Update feature-detects/exif-orientation.js Trim trailing whitespace and insert final newlines
Generated content is falsely undetected (meaning it is available) on the standard browser in Android 4.0.4 (in my case, CyanogenMod version "9-20120716-UNOFFICAL-ville" on an HTC One S).
The circumstances by which the bug can be reproduced are exactly the same as mentioned in this issue:
#665
The text was updated successfully, but these errors were encountered: