Changeset 295166 in webkit
- Timestamp:
- Jun 2, 2022, 6:31:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/UserInterface/Views/LayoutDetailsSidebarPanel.js
r294695 r295166 32 32 this._flexNodeSet = null; 33 33 this._gridNodeSet = null; 34 this._nodeStyles = null;35 34 this.element.classList.add("layout-panel"); 36 }37 38 // Public39 40 inspect(objects)41 {42 // Layout panel doesn't show when hasDOMNode is false.43 let hasDOMNode = super.inspect(objects);44 if (!hasDOMNode)45 return false;46 47 let stylesForNode = WI.cssManager.stylesForNode(this.domNode);48 stylesForNode.refreshIfNeeded().then((nodeStyles) => {49 if (nodeStyles === this._nodeStyles)50 return;51 52 if (this._nodeStyles) {53 this._nodeStyles.removeEventListener(WI.DOMNodeStyles.Event.Refreshed, this._nodeStylesRefreshed, this);54 this._nodeStyles.removeEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._nodeStylesNeedsRefreshed, this);55 }56 57 this._nodeStyles = nodeStyles;58 59 if (this._nodeStyles) {60 this._nodeStyles.addEventListener(WI.DOMNodeStyles.Event.Refreshed, this._nodeStylesRefreshed, this);61 this._nodeStyles.addEventListener(WI.DOMNodeStyles.Event.NeedsRefresh, this._nodeStylesNeedsRefreshed, this);62 }63 64 this.needsLayout();65 });66 67 return hasDOMNode;68 }69 70 supportsDOMNode(nodeToInspect)71 {72 return nodeToInspect.nodeType() === Node.ELEMENT_NODE;73 35 } 74 36 … … 191 153 } 192 154 193 _nodeStylesRefreshed()194 {195 if (this.isAttached)196 this.needsLayout();197 }198 199 _nodeStylesNeedsRefreshed()200 {201 if (this.isAttached)202 this._nodeStyles?.refresh();203 }204 205 155 _removeNodeFromNodeSets(domNode) 206 156 {
Note:
See TracChangeset
for help on using the changeset viewer.