diff options
author | Eric Guzman | 2012-02-22 23:19:45 -0800 |
---|---|---|
committer | Eric Guzman | 2012-02-22 23:19:45 -0800 |
commit | 9e8cd4448a6d0f809a55c3bdea8b45ed75339794 (patch) | |
tree | c7b5105153f17aedecd0669c611dbea44be7374c /js/controllers/styles-controller.js | |
parent | a5ee11857f923d3e49b44c0a8c480e9d0b026d5b (diff) | |
parent | 2afef244a3f8124f8a049e504e9782c05904ce23 (diff) | |
download | ninja-9e8cd4448a6d0f809a55c3bdea8b45ed75339794.tar.gz |
Merge branch 'refs/heads/master' into CSSPanelUpdates
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 aa5a4e7f..e78c1ef1 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js | |||
@@ -578,6 +578,10 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
578 | rules = [], | 578 | rules = [], |
579 | win = element.ownerDocument.defaultView, | 579 | win = element.ownerDocument.defaultView, |
580 | self = this; | 580 | self = this; |
581 | |||
582 | if(!win) { | ||
583 | return null; | ||
584 | } | ||
581 | 585 | ||
582 | if(!omitPseudos) { | 586 | if(!omitPseudos) { |
583 | pseudos.concat(['link', 'visited', 'active', 'hover', 'focus', 'first-letter', | 587 | pseudos.concat(['link', 'visited', 'active', 'hover', 'focus', 'first-letter', |
@@ -681,8 +685,9 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
681 | } | 685 | } |
682 | 686 | ||
683 | var matchingElements, i; | 687 | var matchingElements, i; |
688 | |||
684 | for(i = 0; i < specArr.length; i++) { | 689 | for(i = 0; i < specArr.length; i++) { |
685 | matchingElements = win.document.querySelectorAll(specArr[i].selector); | 690 | matchingElements = element.ownerDocument.querySelectorAll(specArr[i].selector); |
686 | if(nj.toArray(matchingElements).indexOf(element) !== -1) { | 691 | if(nj.toArray(matchingElements).indexOf(element) !== -1) { |
687 | return specArr[i]; | 692 | return specArr[i]; |
688 | } | 693 | } |