Title: [246279] trunk/Source/WebInspectorUI
Revision
246279
Author
[email protected]
Date
2019-06-10 14:13:55 -0700 (Mon, 10 Jun 2019)

Log Message

REGRESSION(r244268): Web Inspector: Styles: navigating from Computed to Styles doesn't work
https://bugs.webkit.org/show_bug.cgi?id=198508
<rdar://problem/51375503>

Reviewed by Matt Baker.

It didn't work because the detached sidebar panel tried to access its parent view (this.parentSidebar).

* UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
(WI.ComputedStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Added.
(WI.ComputedStyleDetailsSidebarPanel):
* UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
(WI.GeneralStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Deleted.
Move computedStyleDetailsPanelShowProperty to ComputedStyleDetailsSidebarPanel since it's the only
panel where it's needed.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (246278 => 246279)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-06-10 20:43:17 UTC (rev 246278)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-06-10 21:13:55 UTC (rev 246279)
@@ -1,3 +1,21 @@
+2019-06-10  Nikita Vasilyev  <[email protected]>
+
+        REGRESSION(r244268): Web Inspector: Styles: navigating from Computed to Styles doesn't work
+        https://bugs.webkit.org/show_bug.cgi?id=198508
+        <rdar://problem/51375503>
+
+        Reviewed by Matt Baker.
+
+        It didn't work because the detached sidebar panel tried to access its parent view (this.parentSidebar).
+
+        * UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
+        (WI.ComputedStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Added.
+        (WI.ComputedStyleDetailsSidebarPanel):
+        * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
+        (WI.GeneralStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Deleted.
+        Move computedStyleDetailsPanelShowProperty to ComputedStyleDetailsSidebarPanel since it's the only
+        panel where it's needed.
+
 2019-06-10  Alexey Shvayka  <[email protected]>
 
         Web Inspector: "Copy Path to Property" doesn't work with multiline keys

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js (246278 => 246279)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js	2019-06-10 20:43:17 UTC (rev 246278)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js	2019-06-10 21:13:55 UTC (rev 246279)
@@ -29,4 +29,17 @@
     {
         super("style-computed", WI.UIString("Computed"), WI.ComputedStyleDetailsPanel);
     }
+
+    // ComputedStyleDetailsPanel delegate
+
+    computedStyleDetailsPanelShowProperty(property)
+    {
+        let styleRulesPanel = this.parentSidebar.sidebarPanels.find((panel) => panel instanceof WI.RulesStyleDetailsSidebarPanel);
+        console.assert(styleRulesPanel, "Styles panel is missing.");
+        if (!styleRulesPanel)
+            return;
+
+        this.parentSidebar.selectedSidebarPanel = styleRulesPanel;
+        styleRulesPanel.panel.scrollToSectionAndHighlightProperty(property);
+    }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js (246278 => 246279)


--- trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js	2019-06-10 20:43:17 UTC (rev 246278)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js	2019-06-10 21:13:55 UTC (rev 246279)
@@ -67,23 +67,6 @@
         this._panel.markAsNeedsRefresh(this.domNode);
     }
 
-    computedStyleDetailsPanelShowProperty(property)
-    {
-        this.parentSidebar.selectedSidebarPanel = "style-rules";
-
-        let styleRulesPanel = null;
-        for (let sidebarPanel of this.parentSidebar.sidebarPanels) {
-            if (!(sidebarPanel instanceof WI.RulesStyleDetailsSidebarPanel))
-                continue;
-
-            styleRulesPanel = sidebarPanel;
-            break;
-        }
-
-        console.assert(styleRulesPanel, "Styles panel is missing.");
-        styleRulesPanel.panel.scrollToSectionAndHighlightProperty(property);
-    }
-
     // StyleDetailsPanel delegate
 
     styleDetailsPanelFocusLastPseudoClassCheckbox(styleDetailsPanel)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to