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

False positive for @font-face on WP7 #538

Closed
thany opened this issue Mar 29, 2012 · 8 comments
Closed

False positive for @font-face on WP7 #538

thany opened this issue Mar 29, 2012 · 8 comments
Labels
change requested pr has open changerequests that need to be adressed false result

Comments

@thany
Copy link

thany commented Mar 29, 2012

I've found a false positive for @font-face on Windows Phone 7 (including 7.5). Modernizr says font-face is available, but it isn't supported at all by the platform.

This is with Modernizr 2.5.3 custom build (which includes font-face detection, obviously) on the latest release & update of the Windows Phone SDK emulator. I don't have an actual device to test this on.

@paulirish
Copy link
Member

yup.

looks like a false positive.. MSFT has written about it here:
http://blogs.msdn.com/b/thebeebs/archive/2011/12/14/font-face-isn-t-working-on-ie9-inside-of-windows-phone-7.aspx

:(

we can filter out the FP with some other detect or ignore it because of
marketshare concerns..

@addyosmani
Copy link
Contributor

My vote is for ignore down to marketshare. Could increase though!

@thany
Copy link
Author

thany commented Apr 1, 2012

Indeed in my country WP7 has a marketshare of about 1%. But that's not the issue I think. The issue is that Modernizr seems to falsely detect @font-face, so this problem might also exist on other browsers - not just WP7.

@chriscoyier
Copy link
Contributor

Just for anyone else finding this... you can conditional comment for WP7 in case that helps... e.g.

<!--[if IEMobile]> 
   <style>[data-icon]:before { display: none; }</style>
<![endif]--> 

@peteboere
Copy link

Conditional comments like mentioned by @chriscoyier are borked in the current edition of Windows Mobile (7.5).

They are removed completely in IE 10 in upcoming WM 8 so this particular technique is for the dustbin I think.

This leaves us with UA sniffing:

var ieMobile
    = ( !!window.ActiveXObject && +( /IEMobile\/(\d+\.?(\d+)?)/.exec( navigator.userAgent )[1] ) ) || NaN;

if ( ! ieMobile || ieMobile >= 10 ) {
    document.documentElement.className += ' webfonts';
}

@ryanseddon
Copy link
Member

Microsoft actually do the following on their new redesign to handle this bug.

/(Windows Phone)|(XBLWP)|(ZuneWP)/.test(navigator.userAgent)&&$("html").removeClass("fontface")

@jalbertbowden
Copy link

conditional comments are borked in ie10 but conditional compilation is not; without actually trying it, i bet there's a way to detect ie mobile versions using @_cc....maybe via jscript detection. i could be way off...but @_cc is available to be abused by your local neighborhood user agents.

@wilddeer
Copy link
Contributor

Seems to be fixed in wp7.8 emulator; now returns false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change requested pr has open changerequests that need to be adressed false result
Projects
None yet
Development

No branches or pull requests

8 participants