Changeset 246279 in webkit


Ignore:
Timestamp:
Jun 10, 2019 2:13:55 PM (5 years ago)
Author:
Nikita Vasilyev
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.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r246271 r246279  
     12019-06-10  Nikita Vasilyev  <nvasilyev@apple.com>
     2
     3        REGRESSION(r244268): Web Inspector: Styles: navigating from Computed to Styles doesn't work
     4        https://bugs.webkit.org/show_bug.cgi?id=198508
     5        <rdar://problem/51375503>
     6
     7        Reviewed by Matt Baker.
     8
     9        It didn't work because the detached sidebar panel tried to access its parent view (this.parentSidebar).
     10
     11        * UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
     12        (WI.ComputedStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Added.
     13        (WI.ComputedStyleDetailsSidebarPanel):
     14        * UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:
     15        (WI.GeneralStyleDetailsSidebarPanel.prototype.computedStyleDetailsPanelShowProperty): Deleted.
     16        Move computedStyleDetailsPanelShowProperty to ComputedStyleDetailsSidebarPanel since it's the only
     17        panel where it's needed.
     18
    1192019-06-10  Alexey Shvayka  <shvaikalesh@gmail.com>
    220
  • trunk/Source/WebInspectorUI/UserInterface/Views/ComputedStyleDetailsSidebarPanel.js

    r240691 r246279  
    3030        super("style-computed", WI.UIString("Computed"), WI.ComputedStyleDetailsPanel);
    3131    }
     32
     33    // ComputedStyleDetailsPanel delegate
     34
     35    computedStyleDetailsPanelShowProperty(property)
     36    {
     37        let styleRulesPanel = this.parentSidebar.sidebarPanels.find((panel) => panel instanceof WI.RulesStyleDetailsSidebarPanel);
     38        console.assert(styleRulesPanel, "Styles panel is missing.");
     39        if (!styleRulesPanel)
     40            return;
     41
     42        this.parentSidebar.selectedSidebarPanel = styleRulesPanel;
     43        styleRulesPanel.panel.scrollToSectionAndHighlightProperty(property);
     44    }
    3245};
  • trunk/Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js

    r244946 r246279  
    6868    }
    6969
    70     computedStyleDetailsPanelShowProperty(property)
    71     {
    72         this.parentSidebar.selectedSidebarPanel = "style-rules";
    73 
    74         let styleRulesPanel = null;
    75         for (let sidebarPanel of this.parentSidebar.sidebarPanels) {
    76             if (!(sidebarPanel instanceof WI.RulesStyleDetailsSidebarPanel))
    77                 continue;
    78 
    79             styleRulesPanel = sidebarPanel;
    80             break;
    81         }
    82 
    83         console.assert(styleRulesPanel, "Styles panel is missing.");
    84         styleRulesPanel.panel.scrollToSectionAndHighlightProperty(property);
    85     }
    86 
    8770    // StyleDetailsPanel delegate
    8871
Note: See TracChangeset for help on using the changeset viewer.