csstransform3d detect should prefer css conditionals - fixes #1512 #1513
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes #1512
There's several ways this could be done. This looked cleanest to me.
The root cause is that EdgeHTML looks a lot like webkit now. So it falls through the existing double-check for a old webkit bug (referenced in the code comments, also see #15) where css 3d transforms were sometimes not correctly detected due to GPU acceleration.
However, that double-check relies on the non-standard [at]media(transform-3d) media query. We've been discussing this with the W3C and consensus is that this media query should go away from browsers, but that's contingent on updating content relying on it (including Modernizr).
Context: http://lists.w3.org/Archives/Public/www-style/2014Oct/0390.html and https://code.google.com/p/chromium/issues/detail?id=426644
So my proposed fix here is to prefer the standardized CSS supports detection mechanism and only fall back to the [at]media rule when CSS at supports isn't available.
I've tested and validated this on IE (6-11 doc modes), Spartan, Chrome, Firefox, Opera (blink-based), and Safari (Mac and iOS).
Note that this fix won't work in the latest public EdgeHTML preview builds quite yet still because it doesn't have [at]supports. But I have special builds. :-) Coming soon to public preview builds.