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

Comments

Projects
None yet
8 participants
@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

This comment has been minimized.

Show comment
Hide comment
@paulirish

paulirish Mar 29, 2012

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..

Member

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

This comment has been minimized.

Show comment
Hide comment
@addyosmani

addyosmani Mar 30, 2012

Contributor

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

Contributor

addyosmani commented Mar 30, 2012

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

@thany

This comment has been minimized.

Show comment
Hide comment
@thany

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

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

This comment has been minimized.

Show comment
Hide comment
@chriscoyier

chriscoyier Sep 11, 2012

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]--> 
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@peteboere

peteboere 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';
}

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

This comment has been minimized.

Show comment
Hide comment
@ryanseddon

ryanseddon Oct 4, 2012

Member

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

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

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

This comment has been minimized.

Show comment
Hide comment
@jalbertbowden

jalbertbowden 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.

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

This comment has been minimized.

Show comment
Hide comment
@wilddeer

wilddeer Aug 26, 2013

Contributor

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

Contributor

wilddeer commented Aug 26, 2013

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

patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment