Permalink
Browse files

Merge pull request #39 from jacobrask/master

Ignore alternate stylesheets
  • Loading branch information...
2 parents 809cd65 + d1f3131 commit d8173b2eefc42ea29fb604b68fcd8291fb8af1e1 @LeaVerou committed Jan 21, 2012
Showing with 6 additions and 14 deletions.
  1. +5 −4 prefixfree.js
  2. +1 −10 prefixfree.min.js
View
@@ -13,7 +13,8 @@ if(!window.addEventListener) {
var self = window.StyleFix = {
link: function(link) {
try {
- if(!/\bstylesheet\b/i.test(link.rel) || !link.sheet.cssRules) {
+ // Ignore stylesheets with data-noprefix attribute as well as alternate stylesheets
+ if(link.rel !== 'stylesheet' || !link.sheet.cssRules || link.hasAttribute('data-noprefix')) {
return;
}
}
@@ -85,7 +86,7 @@ var self = window.StyleFix = {
process: function() {
// Linked stylesheets
- $('link[rel~="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link);
+ $('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link);
// Inline stylesheets
$('style').forEach(StyleFix.styleElement);
@@ -121,7 +122,7 @@ var self = window.StyleFix = {
**************************************/
(function(){
setTimeout(function(){
- $('link[rel~="stylesheet"]').forEach(StyleFix.link);
+ $('link[rel="stylesheet"]').forEach(StyleFix.link);
}, 10);
document.addEventListener('DOMContentLoaded', StyleFix.process, false);
@@ -415,4 +416,4 @@ root.className += ' ' + self.prefix;
StyleFix.register(self.prefixCSS);
-})(document.documentElement);
+})(document.documentElement);
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit d8173b2

Please sign in to comment.