Changeset 272976 in webkit
- Timestamp:
- Feb 16, 2021 7:47:18 PM (17 months ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Controllers/OverlayManager.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r272934 r272976 1 2021-02-16 Razvan Caliman <rcaliman@apple.com> 2 3 Web Inspector: Grids with overlays that disappear and reappear remain checked in Layout pane, toggling hits assertion 4 https://bugs.webkit.org/show_bug.cgi?id=221919 5 <rdar://problem/74363006> 6 7 Reviewed by Devin Rousso. 8 9 When a DOMNode's grid layout context changes to something else, 10 its corresponding shown grid overlay is automatically hidden on the backend. 11 The frontend needs to update its mapping of nodes to overlays and notify listeners of the change in state. 12 13 * UserInterface/Controllers/OverlayManager.js: 14 (WI.OverlayManager): 15 (WI.OverlayManager.prototype._handleLayoutContextTypeChanged): 16 1 17 2021-02-16 Razvan Caliman <rcaliman@apple.com> 2 18 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/OverlayManager.js
r272737 r272976 54 54 console.assert(domNode instanceof WI.DOMNode, domNode); 55 55 console.assert(!color || color instanceof WI.Color, color); 56 console.assert(domNode.layoutContextType === WI.DOMNode.LayoutContextType.Grid, domNode.layoutContextType); 56 57 57 58 color ||= WI.Color.fromString("magenta"); // fallback color … … 72 73 this._gridOverlayForNodeMap.set(domNode, overlay); 73 74 75 domNode.addEventListener(WI.DOMNode.Event.LayoutContextTypeChanged, this._handleLayoutContextTypeChanged, this); 74 76 this.dispatchEventToListeners(WI.OverlayManager.Event.GridOverlayShown, overlay); 75 77 } … … 79 81 console.assert(domNode instanceof WI.DOMNode, domNode); 80 82 console.assert(!domNode.destroyed, domNode); 83 console.assert(domNode.layoutContextType === WI.DOMNode.LayoutContextType.Grid, domNode.layoutContextType); 81 84 if (domNode.destroyed) 82 85 return; … … 89 92 target.DOMAgent.hideGridOverlay(domNode.id); 90 93 94 domNode.removeEventListener(WI.DOMNode.Event.LayoutContextTypeChanged, this._handleLayoutContextTypeChanged, this); 91 95 this.dispatchEventToListeners(WI.OverlayManager.Event.GridOverlayHidden, overlay); 92 96 } 93 97 94 98 // Private 99 100 _handleLayoutContextTypeChanged(event) 101 { 102 let domNode = event.target; 103 console.assert(domNode.layoutContextType !== WI.DOMNode.LayoutContextType.Grid, domNode); 104 105 domNode.removeEventListener(WI.DOMNode.Event.LayoutContextTypeChanged, this._handleLayoutContextTypeChanged, this); 106 107 // When the context type changes, the overlay is automatically hidden on the backend. Here, we only update the map and notify listeners. 108 let overlay = this._gridOverlayForNodeMap.take(domNode); 109 this.dispatchEventToListeners(WI.OverlayManager.Event.GridOverlayHidden, overlay); 110 } 95 111 96 112 _handleGridSettingChanged(event)
Note: See TracChangeset
for help on using the changeset viewer.