Changeset 244566 in webkit
- Timestamp:
- Apr 23, 2019, 2:06:43 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/inspector/protocol/DOM.json (modified) (2 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/inspector/agents/InspectorDOMAgent.cpp (modified) (3 diffs)
-
WebInspectorUI/ChangeLog (modified) (1 diff)
-
WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js (modified) (6 diffs)
-
WebInspectorUI/UserInterface/Models/DOMNode.js (modified) (3 diffs)
-
WebInspectorUI/UserInterface/Views/DOMTreeElement.js (modified) (3 diffs)
-
WebInspectorUI/UserInterface/Views/QuickConsole.js (modified) (1 diff)
-
WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r244558 r244566 1 2019-04-23 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier') 4 https://bugs.webkit.org/show_bug.cgi?id=196420 5 <rdar://problem/49444205> 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/protocol/DOM.json: 10 Modify the existing `frameId` to represent the owner frame of the node, rather than the 11 frame it holds (in the case of an `<iframe>`). 12 1 13 2019-04-23 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/Source/JavaScriptCore/inspector/protocol/DOM.json
r243244 r244566 48 48 { "name": "localName", "type": "string", "description": "<code>Node</code>'s localName." }, 49 49 { "name": "nodeValue", "type": "string", "description": "<code>Node</code>'s nodeValue." }, 50 { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Identifier of the containing frame." }, 50 51 { "name": "childNodeCount", "type": "integer", "optional": true, "description": "Child count for <code>Container</code> nodes." }, 51 52 { "name": "children", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Child nodes of this node when requested with children." }, … … 61 62 { "name": "shadowRootType", "$ref": "ShadowRootType", "optional": true, "description": "Shadow root type." }, 62 63 { "name": "customElementState", "$ref": "CustomElementState", "optional": true, "description": "Custom element state." }, 63 { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Frame ID for frame owner elements." },64 64 { "name": "contentDocument", "$ref": "Node", "optional": true, "description": "Content document for frame owner elements." }, 65 65 { "name": "shadowRoots", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Shadow root list for given element host." }, -
trunk/Source/WebCore/ChangeLog
r244563 r244566 1 2019-04-23 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier') 4 https://bugs.webkit.org/show_bug.cgi?id=196420 5 <rdar://problem/49444205> 6 7 Reviewed by Timothy Hatcher. 8 9 Modify the existing `frameId` to represent the owner frame of the node, rather than the 10 frame it holds (in the case of an `<iframe>`). 11 12 * inspector/agents/InspectorDOMAgent.cpp: 13 (WebCore::InspectorDOMAgent::buildObjectForNode): 14 1 15 2019-04-23 Devin Rousso <drousso@apple.com> 2 16 -
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
r244476 r244566 60 60 #include "Frame.h" 61 61 #include "FrameTree.h" 62 #include "FrameView.h" 62 63 #include "FullscreenManager.h" 63 64 #include "HTMLElement.h" … … 1562 1563 1563 1564 auto* pageAgent = m_instrumentingAgents.inspectorPageAgent(); 1565 if (pageAgent) { 1566 if (auto* frameView = node->document().view()) 1567 value->setFrameId(pageAgent->frameId(&frameView->frame())); 1568 } 1564 1569 1565 1570 if (is<Element>(*node)) { … … 1567 1572 value->setAttributes(buildArrayForElementAttributes(&element)); 1568 1573 if (is<HTMLFrameOwnerElement>(element)) { 1569 HTMLFrameOwnerElement& frameOwner = downcast<HTMLFrameOwnerElement>(element); 1570 if (pageAgent) { 1571 Frame* frame = frameOwner.contentFrame(); 1572 if (frame) 1573 value->setFrameId(pageAgent->frameId(frame)); 1574 } 1575 Document* document = frameOwner.contentDocument(); 1576 if (document) 1574 if (auto* document = downcast<HTMLFrameOwnerElement>(element).contentDocument()) 1577 1575 value->setContentDocument(buildObjectForNode(document, 0, nodesMap)); 1578 1576 } -
trunk/Source/WebInspectorUI/ChangeLog
r244560 r244566 1 2019-04-23 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier') 4 https://bugs.webkit.org/show_bug.cgi?id=196420 5 <rdar://problem/49444205> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Models/DOMNode.js: 10 (WI.DOMNode): 11 (WI.DOMNode.prototype.get frame): Added. 12 (WI.DOMNode.prototype.get frameIdentifier): Deleted. 13 Modify the existing `frameId` to represent the owner frame of the node, rather than the 14 frame it holds (in the case of an `<iframe>`). 15 16 * UserInterface/Controllers/DOMDebuggerManager.js: 17 (WI.DOMDebuggerManager.prototype.domBreakpointsForNode): 18 (WI.DOMDebuggerManager.prototype._detachDOMBreakpoint): 19 (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint): 20 (WI.DOMDebuggerManager.prototype._nodeInserted): 21 (WI.DOMDebuggerManager.prototype._nodeRemoved): 22 * UserInterface/Views/DOMTreeElement.js: 23 (WI.DOMTreeElement.prototype._populateTagContextMenu): 24 (WI.DOMTreeElement.prototype._buildAttributeDOM): 25 * UserInterface/Views/QuickConsole.js: 26 (WI.QuickConsole.prototype._selectExecutionContext): 27 * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js: 28 (WI.SpreadsheetCSSStyleDeclarationSection.prototype._highlightNodesWithSelector): 29 1 30 2019-04-23 Devin Rousso <drousso@apple.com> 2 31 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js
r244279 r244566 171 171 console.assert(node instanceof WI.DOMNode); 172 172 173 if (!node )173 if (!node || !node.frame) 174 174 return []; 175 175 176 let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(node.frame Identifier);176 let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(node.frame.id); 177 177 if (!domBreakpointNodeIdentifierMap) 178 178 return []; … … 398 398 let node = WI.domManager.nodeForId(nodeIdentifier); 399 399 console.assert(node, "Missing DOM node for breakpoint.", breakpoint); 400 if (!node )401 return; 402 403 let frameIdentifier = node.frame Identifier;400 if (!node || !node.frame) 401 return; 402 403 let frameIdentifier = node.frame.id; 404 404 let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(frameIdentifier); 405 405 console.assert(domBreakpointNodeIdentifierMap, "Missing DOM breakpoints for node parent frame.", node); … … 458 458 let node = WI.domManager.nodeForId(nodeIdentifier); 459 459 console.assert(node, "Missing DOM node for nodeIdentifier.", nodeIdentifier); 460 if (!node )461 return; 462 463 let frameIdentifier = node.frame Identifier;460 if (!node || !node.frame) 461 return; 462 463 let frameIdentifier = node.frame.id; 464 464 let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(frameIdentifier); 465 465 if (!domBreakpointNodeIdentifierMap) { … … 612 612 { 613 613 let node = event.data.node; 614 if (node.nodeType() !== Node.ELEMENT_NODE || !node. ownerDocument)615 return; 616 617 let url = node. ownerDocument.documentURL;614 if (node.nodeType() !== Node.ELEMENT_NODE || !node.frame) 615 return; 616 617 let url = node.frame.url; 618 618 let breakpoints = this._domBreakpointURLMap.get(url); 619 619 if (!breakpoints) … … 634 634 { 635 635 let node = event.data.node; 636 if (node.nodeType() !== Node.ELEMENT_NODE || !node. ownerDocument)637 return; 638 639 let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(node.frame Identifier);636 if (node.nodeType() !== Node.ELEMENT_NODE || !node.frame) 637 return; 638 639 let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(node.frame.id); 640 640 if (!domBreakpointNodeIdentifierMap) 641 641 return; … … 648 648 649 649 if (!domBreakpointNodeIdentifierMap.size) 650 this._domBreakpointFrameIdentifierMap.delete(node.frame Identifier);650 this._domBreakpointFrameIdentifierMap.delete(node.frame.id); 651 651 652 652 for (let breakpoint of breakpoints) -
trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js
r244267 r244566 57 57 this.ownerDocument = doc; 58 58 59 this._frame = null; 60 61 // COMPATIBILITY (iOS 12.2): DOM.Node.frameId was changed to represent the owner frame, not the content frame. 62 if (InspectorBackend.domains.Timeline && !InspectorBackend.domains.Timeline.hasEvent("programmaticCaptureStarted")) { 63 if (payload.frameId) 64 this._frame = WI.networkManager.frameForIdentifier(payload.frameId); 65 } 66 67 if (!this._frame && this.ownerDocument) 68 this._frame = WI.networkManager.frameForIdentifier(this.ownerDocument.frameIdentifier); 69 59 70 this._attributes = []; 60 71 this._attributesMap = new Map; … … 116 127 this._renumber(); 117 128 } 118 119 if (payload.frameId)120 this._frameIdentifier = payload.frameId;121 129 122 130 if (this._nodeType === Node.ELEMENT_NODE) { … … 179 187 // Public 180 188 189 get frame() { return this._frame; } 181 190 get domEvents() { return this._domEvents; } 182 191 get lowPowerRanges() { return this._lowPowerRanges; } 183 184 get frameIdentifier()185 {186 return this._frameIdentifier || this.ownerDocument.frameIdentifier;187 }188 189 get frame()190 {191 if (!this._frame)192 this._frame = WI.networkManager.frameForIdentifier(this.frameIdentifier);193 return this._frame;194 }195 192 196 193 get attached() -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
r244155 r244566 737 737 let attached = node.attached; 738 738 739 if (event.target && event.target.tagName === "A") { 740 let url = event.target.href; 741 let frame = WI.networkManager.frameForIdentifier(node.frameIdentifier); 742 WI.appendContextMenuItemsForURL(contextMenu, url, {frame}); 743 } 739 if (event.target && event.target.tagName === "A") 740 WI.appendContextMenuItemsForURL(contextMenu, event.target.href, {frame: node.frame}); 744 741 745 742 contextMenu.appendSeparator(); … … 1277 1274 1278 1275 if (name === "src" || /\bhref\b/.test(name)) { 1279 let baseURL = node. ownerDocument ? node.ownerDocument.documentURL: null;1276 let baseURL = node.frame ? node.frame.url : null; 1280 1277 let rewrittenURL = absoluteURL(value, baseURL); 1281 1278 value = value.insertWordBreakCharacters(); … … 1293 1290 } 1294 1291 } else if (name === "srcset") { 1295 let baseURL = node. ownerDocument ? node.ownerDocument.documentURL: null;1292 let baseURL = node.frame ? node.frame.url : null; 1296 1293 attrValueElement = attrSpanElement.createChild("span", "html-attribute-value"); 1297 1294 -
trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js
r243214 r244566 146 146 let inspectedNode = WI.domManager.inspectedNode; 147 147 if (inspectedNode) { 148 let frame = inspectedNode. ownerDocument.frame;148 let frame = inspectedNode.frame; 149 149 if (frame) { 150 150 if (this._shouldAutomaticallySelectExecutionContext) 151 151 executionContext = frame.pageExecutionContext; 152 153 152 preferredName = this._preferredNameForFrame(frame); 154 153 } -
trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js
r243264 r244566 494 494 _highlightNodesWithSelector() 495 495 { 496 let node = this._style.node; 497 496 498 if (!this._style.ownerRule) { 497 WI.domManager.highlightDOMNode( this._style.node.id);499 WI.domManager.highlightDOMNode(node.id); 498 500 return; 499 501 } 500 502 501 503 let selectorText = this._selectorElement.textContent.trim(); 502 WI.domManager.highlightSelector(selectorText, this._style.node.ownerDocument.frameIdentifier); 504 if (node.frame) 505 WI.domManager.highlightSelector(selectorText, node.frame.id); 506 else 507 WI.domManager.highlightSelector(selectorText); 503 508 } 504 509
Note:
See TracChangeset
for help on using the changeset viewer.