Skip to content

Commit

Permalink
Merge pull request LeaVerou#39 from jacobrask/master
Browse files Browse the repository at this point in the history
Ignore alternate stylesheets
  • Loading branch information
LeaVerou committed Jan 21, 2012
2 parents 809cd65 + d1f3131 commit d8173b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
9 changes: 5 additions & 4 deletions prefixfree.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -415,4 +416,4 @@ root.className += ' ' + self.prefix;
StyleFix.register(self.prefixCSS);


})(document.documentElement);
})(document.documentElement);
11 changes: 1 addition & 10 deletions prefixfree.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d8173b2

Please sign in to comment.