diff options
author | Nivesh Rajbhandari | 2012-02-22 10:34:46 -0800 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-02-22 10:34:46 -0800 |
commit | 50bb05efbafc9a80f069dfde32988e5cd6826865 (patch) | |
tree | 64332f1c2f22b5c0a17f6df2f9a02d77f1c87274 /js/controllers/styles-controller.js | |
parent | a69c929602e64f10fb3903b89a2ca9e9ed2c8dfb (diff) | |
parent | 2f24dafec79583547fe663d5a387d8ef15aae3bf (diff) | |
download | ninja-50bb05efbafc9a80f069dfde32988e5cd6826865.tar.gz |
Merge branch 'refs/heads/ninja-internal' into ToolFixes
Diffstat (limited to 'js/controllers/styles-controller.js')
-rwxr-xr-x | js/controllers/styles-controller.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 44ca50e1..885d710f 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js | |||
@@ -571,6 +571,10 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
571 | rules = [], | 571 | rules = [], |
572 | win = element.ownerDocument.defaultView, | 572 | win = element.ownerDocument.defaultView, |
573 | self = this; | 573 | self = this; |
574 | |||
575 | if(!win) { | ||
576 | return null; | ||
577 | } | ||
574 | 578 | ||
575 | if(!omitPseudos) { | 579 | if(!omitPseudos) { |
576 | pseudos.concat(['link', 'visited', 'active', 'hover', 'focus', 'first-letter', | 580 | pseudos.concat(['link', 'visited', 'active', 'hover', 'focus', 'first-letter', |
@@ -674,8 +678,9 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
674 | } | 678 | } |
675 | 679 | ||
676 | var matchingElements, i; | 680 | var matchingElements, i; |
681 | |||
677 | for(i = 0; i < specArr.length; i++) { | 682 | for(i = 0; i < specArr.length; i++) { |
678 | matchingElements = win.document.querySelectorAll(specArr[i].selector); | 683 | matchingElements = element.ownerDocument.querySelectorAll(specArr[i].selector); |
679 | if(nj.toArray(matchingElements).indexOf(element) !== -1) { | 684 | if(nj.toArray(matchingElements).indexOf(element) !== -1) { |
680 | return specArr[i]; | 685 | return specArr[i]; |
681 | } | 686 | } |