Web Inspector: Uncaught Exception: null is not an object (evaluating 'selector.specif...
authornvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Nov 2017 23:31:50 +0000 (23:31 +0000)
committernvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Nov 2017 23:31:50 +0000 (23:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=179225
<rdar://problem/35329019>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
selector.specificity may not exist when the selector is dynamic and doesn't match the selected element.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224441 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js

index 2ed1d5a..25344f1 100644 (file)
@@ -1,3 +1,15 @@
+2017-11-03  Nikita Vasilyev  <nvasilyev@apple.com>
+
+        Web Inspector: Uncaught Exception: null is not an object (evaluating 'selector.specificity.map') (at SpreadsheetCSSStyleDeclarationSection.js:199:51)
+        https://bugs.webkit.org/show_bug.cgi?id=179225
+        <rdar://problem/35329019>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
+        (WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
+        selector.specificity may not exist when the selector is dynamic and doesn't match the selected element.
+
 2017-11-03  Ross Kirsling  <ross.kirsling@sony.com>
 
         Web Inspector: Move Show Compositing Borders/Paint Flashing buttons from Elements tab to Layers tab
index 21028ff..ff2e3da 100644 (file)
@@ -196,8 +196,8 @@ WI.SpreadsheetCSSStyleDeclarationSection = class SpreadsheetCSSStyleDeclarationS
             if (matched)
                 selectorElement.classList.add(WI.SpreadsheetCSSStyleDeclarationSection.MatchedSelectorElementStyleClassName);
 
-            let specificity = selector.specificity.map((number) => number.toLocaleString());
-            if (specificity) {
+            if (selector.specificity) {
+                let specificity = selector.specificity.map((number) => number.toLocaleString());
                 let tooltip = WI.UIString("Specificity: (%d, %d, %d)").format(...specificity);
                 if (selector.dynamic) {
                     tooltip += "\n";