-
Notifications
You must be signed in to change notification settings - Fork 712
Everybody wants to be -webkit-
#6108
Comments
Prefix-free finds prefixed properties, then counts all prefixes and picks the more frequently encountered prefix as the current browser's. Perhaps it should try all of them, now that multiple prefixes are becoming common... |
In this case, actually, it is a false alarm. Quoting myself in the Bugzilla thread:
More generally, I agree that testing for all prefixes would be more robust and future proof. |
The problem is that in many cases, it will be wasted resources, as browsers have many weird prefixes (e.g. |
There's a related problem with Edge. The majority prefix is |
Hmm maybe we should check for specific prefixes then and get rid of the detection… I'm pretty sure there are many standards track |
IE 9-11 are correctly detected as Here's what a modified detector finds in Edge 13 for properties... tl;dr, the only property that exists only in More checks are needed for selectors and values, though, but it is a good start. Edit: I moved the results here, and, good news, in Edge 14, Here's the detection code: function detectPrefix() {
var allStyles = getComputedStyle(document.documentElement, null);
var styleAttr = document.createElement("div").style;
function supportedProperty(property) {
return property in styleAttr;
}
var properties = {};
// There's a length in Edge no need to do the usual dance
for (var i = 0; i < allStyles.length; i++) {
properties[allStyles[i].replace(/^-\w+\-/, "")] = [];
}
for (var prop in properties) [ "", "-ms-", "-webkit-" ].forEach(function(prefix) {
if (supportedProperty(prefix + prop)) properties[prop].push(prefix || "bare");
});
return properties;
} |
-webkit-
We won't get away that easily :-(
There's a fishy thing with the detector code, because Still, not good. The detector is live (See the JSON at the bottom of the page) Cleaned up output can be found in an updated version of the previous gist. The detector code is here (current tip of the |
And Mozilla has some http://caniuse.com/#search=text-fill-color |
Digging deeper, the whatwg specifies various CSS things that must be supported with a webkit prefix |
Worse still, |
https://bugzilla.mozilla.org/show_bug.cgi?id=1170789
Mozilla is in the process of adding
-webkit-
prefix support, which, depending on how it's implemented, may break the way PrefixFree detects plugins, either as soon as they release the change, or once-moz
is outnumbered by-webkit
as-moz
is gradually retired.If it does break it could probably be worked around, but older PrefixFree versions in the wild would break.
The Mozillian in charge of the issue asked me for concrete examples of PrefixFree deployments in the wild, but I'm not using it yet [†], and don't know of any beside the PrefixFree home page...
† I'm in the process of adapting PrefixFree as a plugin for my CSS in JS thing, hence my interest in it.
The text was updated successfully, but these errors were encountered: