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

Comments

@thany
Copy link

@thany 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

@paulirish paulirish commented Mar 29, 2012

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

@addyosmani addyosmani commented Mar 30, 2012

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

@thany
Copy link
Author

@thany 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

@chriscoyier chriscoyier commented Sep 11, 2012

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

@peteboere peteboere commented Oct 3, 2012

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

@ryanseddon ryanseddon commented Oct 4, 2012

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

@jalbertbowden jalbertbowden commented Jun 26, 2013

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

@wilddeer wilddeer commented Aug 26, 2013

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.