[CB-2650] - Weinre style inspection breaks with normalize.css
https://issues.apache.org/jira/browse/CB-2650
diff --git a/weinre.doc/ChangeLog.body.html b/weinre.doc/ChangeLog.body.html
index 6a0b4b3..54b8e31 100644
--- a/weinre.doc/ChangeLog.body.html
+++ b/weinre.doc/ChangeLog.body.html
@@ -53,6 +53,7 @@
<li><a href="https://issues.apache.org/jira/browse/CB-1193">CB-1193</a> - add Windows Phone support
<li><a href="https://issues.apache.org/jira/browse/CB-1800">CB-1800</a> - remove references to "incubator"
<li><a href="https://issues.apache.org/jira/browse/CB-1494">CB-1494</a> - Supports running server behind a proxy, such as Heroku Cedar
+<li><a href="https://issues.apache.org/jira/browse/CB-2650">CB-2650</a> - Weinre style inspection breaks with normalize.css
<li><a href="https://issues.apache.org/jira/browse/CB-3319">CB-3319</a> - Chrome is setting window properties which now breaks Weinre
<li><a href="https://issues.apache.org/jira/browse/CB-3328">CB-3328</a> - chrome version >= 27 breaks flex-box usage
</ul>
diff --git a/weinre.web/modules/weinre/target/CSSStore.coffee b/weinre.web/modules/weinre/target/CSSStore.coffee
index 07c6017..158295b 100644
--- a/weinre.web/modules/weinre/target/CSSStore.coffee
+++ b/weinre.web/modules/weinre/target/CSSStore.coffee
@@ -54,16 +54,19 @@
getMatchedCSSRules: (node) ->
result = []
- for styleSheet in document.styleSheets
- continue unless styleSheet.cssRules
+ try
+ for styleSheet in document.styleSheets
+ continue unless styleSheet.cssRules
- for cssRule in styleSheet.cssRules
- continue unless _elementMatchesSelector(node, cssRule.selectorText)
- object = {}
- object.ruleId = @_getStyleRuleId(cssRule)
- object.selectorText = cssRule.selectorText
- object.style = @_buildMirrorForStyle(cssRule.style, true)
- result.push object
+ for cssRule in styleSheet.cssRules
+ continue unless _elementMatchesSelector(node, cssRule.selectorText)
+ object = {}
+ object.ruleId = @_getStyleRuleId(cssRule)
+ object.selectorText = cssRule.selectorText
+ object.style = @_buildMirrorForStyle(cssRule.style, true)
+ result.push object
+ catch err
+ return result
result