Summary: | REGRESSION(r244268): Web Inspector: Styles: navigating from Computed to Styles doesn't work | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> | ||||||
Component: | Web Inspector | Assignee: | Nikita Vasilyev <nvasilyev> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, inspector-bugzilla-changes, mattbaker, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Nikita Vasilyev
2019-06-03 17:22:20 PDT
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. |