Title: [206081] trunk/Source/WebInspectorUI
Revision
206081
Author
commit-qu...@webkit.org
Date
2016-09-18 10:36:31 -0700 (Sun, 18 Sep 2016)

Log Message

Uncaught Exception: null is not an object (evaluating 'this.listItemElement.classList')
https://bugs.webkit.org/show_bug.cgi?id=162123
<rdar://problem/28352900>

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-09-18
Reviewed by Matt Baker.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype.onexpand):
If not attached yet, don't update title. We will update title
when attaching, so this avoids work and avoids doing that
work when the tree element is not fully setup.

(WebInspector.DOMTreeElement.prototype._startEditing):
(WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
(WebInspector.DOMTreeElement.prototype._nodePseudoClassesDidChange):
Switch to the public name instead of the private name.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (206080 => 206081)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-09-18 15:10:39 UTC (rev 206080)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-09-18 17:36:31 UTC (rev 206081)
@@ -1,3 +1,22 @@
+2016-09-18  Joseph Pecoraro  <pecor...@apple.com>
+
+        Uncaught Exception: null is not an object (evaluating 'this.listItemElement.classList')
+        https://bugs.webkit.org/show_bug.cgi?id=162123
+        <rdar://problem/28352900>
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/DOMTreeElement.js:
+        (WebInspector.DOMTreeElement.prototype.onexpand):
+        If not attached yet, don't update title. We will update title
+        when attaching, so this avoids work and avoids doing that
+        work when the tree element is not fully setup.
+
+        (WebInspector.DOMTreeElement.prototype._startEditing):
+        (WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
+        (WebInspector.DOMTreeElement.prototype._nodePseudoClassesDidChange):
+        Switch to the public name instead of the private name.
+
 2016-09-16  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Implement Copy CSS Selector and Copy Xpath Selector context menus

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (206080 => 206081)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2016-09-18 15:10:39 UTC (rev 206080)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2016-09-18 17:36:31 UTC (rev 206081)
@@ -503,6 +503,9 @@
         if (this._elementCloseTag)
             return;
 
+        if (!this.listItemElement)
+            return;
+
         this.updateTitle();
     }
 
@@ -747,7 +750,7 @@
         if (!this.editable)
             return false;
 
-        var listItem = this._listItemNode;
+        var listItem = this.listItemElement;
 
         if (this._canAddAttributes) {
             var attribute = listItem.getElementsByClassName("html-attribute")[0];
@@ -1253,13 +1256,13 @@
                 var fragmentElement = info.titleDOM.createChild("span", "html-fragment");
                 if (node.shadowRootType()) {
                     fragmentElement.textContent = WebInspector.UIString("Shadow Content (%s)").format(WebInspector.DOMTreeElement.shadowRootTypeDisplayName(node.shadowRootType()));
-                    this._listItemNode.classList.add("shadow");
+                    this.listItemElement.classList.add("shadow");
                 } else if (node.parentNode && node.parentNode.templateContent() === node) {
                     fragmentElement.textContent = WebInspector.UIString("Template Content");
-                    this._listItemNode.classList.add("template");
+                    this.listItemElement.classList.add("template");
                 } else {
                     fragmentElement.textContent = WebInspector.UIString("Document Fragment");
-                    this._listItemNode.classList.add("fragment");
+                    this.listItemElement.classList.add("fragment");
                 }
                 break;
 
@@ -1591,7 +1594,7 @@
             return;
 
         this.updateSelectionArea();
-        this._listItemNode.classList.toggle("pseudo-class-enabled", !!this.representedObject.enabledPseudoClasses.length);
+        this.listItemElement.classList.toggle("pseudo-class-enabled", !!this.representedObject.enabledPseudoClasses.length);
     }
 
     _fireDidChange()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to