Steps: 1. Open https://webkit.org 2. Inspect <body> 3. Open Computed panel in the right sidebar 4. Hover "background-color: rgb(0, 37, 61)" 5. Click on the arrow icon on the right. Expected: Styles panel open with "background-color" property selected. Actual: Styles panel open but no properties are selected. Notes: This must have regressed in the last 2 months.
<rdar://problem/51375503>
Broken in r244268 Web Inspector: sidebar panels shouldn't be added as subviews unless visible
After clicking the arrow icon: [Error] TypeError: null is not an object (evaluating 'this.parentSidebar.sidebarPanels') computedStyleDetailsPanelShowProperty (GeneralStyleDetailsSidebarPanel.js:75) spreadsheetCSSStyleDeclarationEditorShowProperty (ComputedStyleDetailsPanel.js:78) spreadsheetStylePropertyShowProperty (ComputedStyleSection.js:207) (anonymous function) (SpreadsheetStyleProperty.js:227)
Created attachment 371687 [details] Patch
Comment on attachment 371687 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=371687&action=review > Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:72 > + let parentSidebar = this.parentSidebar; Instead of saving a reference, why not reorder the operations in the function body? 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); } Also, this delegate method seems like it belongs in ComputedStyleDetailsPanel, not in a generic base class.
(In reply to Matt Baker from comment #5) > Comment on attachment 371687 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=371687&action=review > > > Source/WebInspectorUI/UserInterface/Views/GeneralStyleDetailsSidebarPanel.js:72 > > + let parentSidebar = this.parentSidebar; > > Instead of saving a reference, why not reorder the operations in the > function body? Makes sense. Also, I like how you didn't use a string identifier.
Created attachment 371772 [details] Patch
Comment on attachment 371772 [details] Patch r=me
Comment on attachment 371772 [details] Patch Clearing flags on attachment: 371772 Committed r246279: <https://trac.webkit.org/changeset/246279>
All reviewed patches have been landed. Closing bug.