Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
restore an unintentionally changed range in last merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottjehl committed Sep 30, 2015
1 parent b3f0ee3 commit 1173c13
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions loadCSS.js
Expand Up @@ -18,13 +18,15 @@ Licensed MIT
if( before ){
ref = before;
}
else if( doc.querySelectorAll ){
var refs = doc.querySelectorAll("style,link[rel=stylesheet],script");
// No need to check length. This script has a parent element, at least
ref = refs[ refs.length - 1];
}
else {
ref = doc.getElementsByTagName( "script" )[ 0 ];
var refs;
if( doc.querySelectorAll ){
refs = doc.querySelectorAll( "style,link[rel=stylesheet],script" );
}
else {
refs = ( doc.body || doc.getElementsByTagName( "head" )[ 0 ] ).childNodes;
}
ref = refs[ refs.length - 1];
}

var sheets = doc.styleSheets;
Expand Down

0 comments on commit 1173c13

Please sign in to comment.