ie9+ don't support matchMedia #57

Closed
paulirish opened this Issue Aug 16, 2011 · 4 comments

Comments

Projects
None yet
3 participants
Collaborator

paulirish commented Aug 16, 2011

but your readme says so

:)

@scottjehl scottjehl closed this in e27112a Aug 16, 2011

Way late to the party, but... doesn't this mean the logic for respond.mediaQueriesSupported doesn't work as expected because IE9 supports media queries, but not window.matchMedia?

Owner

scottjehl commented Jul 10, 2012

No, matchMedia is just used as an immediate flag for mq support. If it's not there, mqs are manually tested.

Owner

scottjehl commented Jul 10, 2012

A better explanation, the matchMedia polyfill is included to normalize that. Then the following can determine native CSS3 Media Queries support:

respond.mediaQueriesSupported   = win.matchMedia && win.matchMedia( "only all" ).matches;

only is a media query function, and all is a general media type supported everywhere, so they can be combined to query for mq support in general.

I think I understand now. I had thought I was including a matchMedia polyfill via Modernizr, which it turns out wasn't there. Thanks.

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