<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[244566] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/244566">244566</a></dd>
<dt>Author</dt> <dd>drousso@apple.com</dd>
<dt>Date</dt> <dd>2019-04-23 14:06:43 -0700 (Tue, 23 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier')
https://bugs.webkit.org/show_bug.cgi?id=196420
<rdar://problem/49444205>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:
Modify the existing `frameId` to represent the owner frame of the node, rather than the
frame it holds (in the case of an `<iframe>`).

Source/WebCore:

Modify the existing `frameId` to represent the owner frame of the node, rather than the
frame it holds (in the case of an `<iframe>`).

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):

Source/WebInspectorUI:

* UserInterface/Models/DOMNode.js:
(WI.DOMNode):
(WI.DOMNode.prototype.get frame): Added.
(WI.DOMNode.prototype.get frameIdentifier): Deleted.
Modify the existing `frameId` to represent the owner frame of the node, rather than the
frame it holds (in the case of an `<iframe>`).

* UserInterface/Controllers/DOMDebuggerManager.js:
(WI.DOMDebuggerManager.prototype.domBreakpointsForNode):
(WI.DOMDebuggerManager.prototype._detachDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
(WI.DOMDebuggerManager.prototype._nodeInserted):
(WI.DOMDebuggerManager.prototype._nodeRemoved):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._populateTagContextMenu):
(WI.DOMTreeElement.prototype._buildAttributeDOM):
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._selectExecutionContext):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._highlightNodesWithSelector):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolDOMjson">trunk/Source/JavaScriptCore/inspector/protocol/DOM.json</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectoragentsInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDOMDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMNodejs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsQuickConsolejs">trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsSpreadsheetCSSStyleDeclarationSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/JavaScriptCore/ChangeLog       2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2019-04-23  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier')
+        https://bugs.webkit.org/show_bug.cgi?id=196420
+        <rdar://problem/49444205>
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/protocol/DOM.json:
+        Modify the existing `frameId` to represent the owner frame of the node, rather than the
+        frame it holds (in the case of an `<iframe>`).
+
</ins><span class="cx"> 2019-04-23  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Remove DeprecatedOptional
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolDOMjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/DOM.json (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/DOM.json  2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/JavaScriptCore/inspector/protocol/DOM.json     2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">                 { "name": "nodeName", "type": "string", "description": "<code>Node</code>'s nodeName." },
</span><span class="cx">                 { "name": "localName", "type": "string", "description": "<code>Node</code>'s localName." },
</span><span class="cx">                 { "name": "nodeValue", "type": "string", "description": "<code>Node</code>'s nodeValue." },
</span><ins>+                { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Identifier of the containing frame." },
</ins><span class="cx">                 { "name": "childNodeCount", "type": "integer", "optional": true, "description": "Child count for <code>Container</code> nodes." },
</span><span class="cx">                 { "name": "children", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Child nodes of this node when requested with children." },
</span><span class="cx">                 { "name": "attributes", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Attributes of the <code>Element</code> node in the form of flat array <code>[name1, value1, name2, value2]</code>." },
</span><span class="lines">@@ -60,7 +61,6 @@
</span><span class="cx">                 { "name": "pseudoType", "$ref": "PseudoType", "optional": true, "description": "Pseudo element type for this node." },
</span><span class="cx">                 { "name": "shadowRootType", "$ref": "ShadowRootType", "optional": true, "description": "Shadow root type." },
</span><span class="cx">                 { "name": "customElementState", "$ref": "CustomElementState", "optional": true, "description": "Custom element state." },
</span><del>-                { "name": "frameId", "$ref": "Network.FrameId", "optional": true, "description": "Frame ID for frame owner elements." },
</del><span class="cx">                 { "name": "contentDocument", "$ref": "Node", "optional": true, "description": "Content document for frame owner elements." },
</span><span class="cx">                 { "name": "shadowRoots", "type": "array", "optional": true, "items": { "$ref": "Node" }, "description": "Shadow root list for given element host." },
</span><span class="cx">                 { "name": "templateContent", "$ref": "Node", "optional": true, "description": "Content document fragment for template elements" },
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/WebCore/ChangeLog      2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2019-04-23  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier')
+        https://bugs.webkit.org/show_bug.cgi?id=196420
+        <rdar://problem/49444205>
+
+        Reviewed by Timothy Hatcher.
+
+        Modify the existing `frameId` to represent the owner frame of the node, rather than the
+        frame it holds (in the case of an `<iframe>`).
+
+        * inspector/agents/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+
+2019-04-23  Devin Rousso  <drousso@apple.com>
+
</ins><span class="cx">         ContentSecurityPolicy::logToConsole should include line/column number and source location
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=114317
</span><span class="cx">         <rdar://problem/13614617>
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectoragentsInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp      2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp 2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameTree.h"
</span><ins>+#include "FrameView.h"
</ins><span class="cx"> #include "FullscreenManager.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "HTMLFrameOwnerElement.h"
</span><span class="lines">@@ -1561,19 +1562,16 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto* pageAgent = m_instrumentingAgents.inspectorPageAgent();
</span><ins>+    if (pageAgent) {
+        if (auto* frameView = node->document().view())
+            value->setFrameId(pageAgent->frameId(&frameView->frame()));
+    }
</ins><span class="cx"> 
</span><span class="cx">     if (is<Element>(*node)) {
</span><span class="cx">         Element& element = downcast<Element>(*node);
</span><span class="cx">         value->setAttributes(buildArrayForElementAttributes(&element));
</span><span class="cx">         if (is<HTMLFrameOwnerElement>(element)) {
</span><del>-            HTMLFrameOwnerElement& frameOwner = downcast<HTMLFrameOwnerElement>(element);
-            if (pageAgent) {
-                Frame* frame = frameOwner.contentFrame();
-                if (frame)
-                    value->setFrameId(pageAgent->frameId(frame));
-            }
-            Document* document = frameOwner.contentDocument();
-            if (document)
</del><ins>+            if (auto* document = downcast<HTMLFrameOwnerElement>(element).contentDocument())
</ins><span class="cx">                 value->setContentDocument(buildObjectForNode(document, 0, nodesMap));
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog    2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/WebInspectorUI/ChangeLog       2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2019-04-23  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><ins>+        Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier')
+        https://bugs.webkit.org/show_bug.cgi?id=196420
+        <rdar://problem/49444205>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Models/DOMNode.js:
+        (WI.DOMNode):
+        (WI.DOMNode.prototype.get frame): Added.
+        (WI.DOMNode.prototype.get frameIdentifier): Deleted.
+        Modify the existing `frameId` to represent the owner frame of the node, rather than the
+        frame it holds (in the case of an `<iframe>`).
+
+        * UserInterface/Controllers/DOMDebuggerManager.js:
+        (WI.DOMDebuggerManager.prototype.domBreakpointsForNode):
+        (WI.DOMDebuggerManager.prototype._detachDOMBreakpoint):
+        (WI.DOMDebuggerManager.prototype._resolveDOMBreakpoint):
+        (WI.DOMDebuggerManager.prototype._nodeInserted):
+        (WI.DOMDebuggerManager.prototype._nodeRemoved):
+        * UserInterface/Views/DOMTreeElement.js:
+        (WI.DOMTreeElement.prototype._populateTagContextMenu):
+        (WI.DOMTreeElement.prototype._buildAttributeDOM):
+        * UserInterface/Views/QuickConsole.js:
+        (WI.QuickConsole.prototype._selectExecutionContext):
+        * UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
+        (WI.SpreadsheetCSSStyleDeclarationSection.prototype._highlightNodesWithSelector):
+
+2019-04-23  Devin Rousso  <drousso@apple.com>
+
</ins><span class="cx">         Web Inspector: Canvas: no obvious way of switching to the overview when viewing an imported recording
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=197178
</span><span class="cx">         <rdar://problem/50106641>
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDOMDebuggerManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js      2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMDebuggerManager.js 2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -170,10 +170,10 @@
</span><span class="cx">     {
</span><span class="cx">         console.assert(node instanceof WI.DOMNode);
</span><span class="cx"> 
</span><del>-        if (!node)
</del><ins>+        if (!node || !node.frame)
</ins><span class="cx">             return [];
</span><span class="cx"> 
</span><del>-        let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(node.frameIdentifier);
</del><ins>+        let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(node.frame.id);
</ins><span class="cx">         if (!domBreakpointNodeIdentifierMap)
</span><span class="cx">             return [];
</span><span class="cx"> 
</span><span class="lines">@@ -397,10 +397,10 @@
</span><span class="cx">         let nodeIdentifier = breakpoint.domNodeIdentifier;
</span><span class="cx">         let node = WI.domManager.nodeForId(nodeIdentifier);
</span><span class="cx">         console.assert(node, "Missing DOM node for breakpoint.", breakpoint);
</span><del>-        if (!node)
</del><ins>+        if (!node || !node.frame)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        let frameIdentifier = node.frameIdentifier;
</del><ins>+        let frameIdentifier = node.frame.id;
</ins><span class="cx">         let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(frameIdentifier);
</span><span class="cx">         console.assert(domBreakpointNodeIdentifierMap, "Missing DOM breakpoints for node parent frame.", node);
</span><span class="cx">         if (!domBreakpointNodeIdentifierMap)
</span><span class="lines">@@ -457,10 +457,10 @@
</span><span class="cx">     {
</span><span class="cx">         let node = WI.domManager.nodeForId(nodeIdentifier);
</span><span class="cx">         console.assert(node, "Missing DOM node for nodeIdentifier.", nodeIdentifier);
</span><del>-        if (!node)
</del><ins>+        if (!node || !node.frame)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        let frameIdentifier = node.frameIdentifier;
</del><ins>+        let frameIdentifier = node.frame.id;
</ins><span class="cx">         let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(frameIdentifier);
</span><span class="cx">         if (!domBreakpointNodeIdentifierMap) {
</span><span class="cx">             domBreakpointNodeIdentifierMap = new Map;
</span><span class="lines">@@ -611,10 +611,10 @@
</span><span class="cx">     _nodeInserted(event)
</span><span class="cx">     {
</span><span class="cx">         let node = event.data.node;
</span><del>-        if (node.nodeType() !== Node.ELEMENT_NODE || !node.ownerDocument)
</del><ins>+        if (node.nodeType() !== Node.ELEMENT_NODE || !node.frame)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        let url = node.ownerDocument.documentURL;
</del><ins>+        let url = node.frame.url;
</ins><span class="cx">         let breakpoints = this._domBreakpointURLMap.get(url);
</span><span class="cx">         if (!breakpoints)
</span><span class="cx">             return;
</span><span class="lines">@@ -633,10 +633,10 @@
</span><span class="cx">     _nodeRemoved(event)
</span><span class="cx">     {
</span><span class="cx">         let node = event.data.node;
</span><del>-        if (node.nodeType() !== Node.ELEMENT_NODE || !node.ownerDocument)
</del><ins>+        if (node.nodeType() !== Node.ELEMENT_NODE || !node.frame)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(node.frameIdentifier);
</del><ins>+        let domBreakpointNodeIdentifierMap = this._domBreakpointFrameIdentifierMap.get(node.frame.id);
</ins><span class="cx">         if (!domBreakpointNodeIdentifierMap)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="lines">@@ -647,7 +647,7 @@
</span><span class="cx">         domBreakpointNodeIdentifierMap.delete(node.id);
</span><span class="cx"> 
</span><span class="cx">         if (!domBreakpointNodeIdentifierMap.size)
</span><del>-            this._domBreakpointFrameIdentifierMap.delete(node.frameIdentifier);
</del><ins>+            this._domBreakpointFrameIdentifierMap.delete(node.frame.id);
</ins><span class="cx"> 
</span><span class="cx">         for (let breakpoint of breakpoints)
</span><span class="cx">             breakpoint.domNodeIdentifier = null;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js      2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js 2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -56,6 +56,17 @@
</span><span class="cx">         else
</span><span class="cx">             this.ownerDocument = doc;
</span><span class="cx"> 
</span><ins>+        this._frame = null;
+
+        // COMPATIBILITY (iOS 12.2): DOM.Node.frameId was changed to represent the owner frame, not the content frame.
+        if (InspectorBackend.domains.Timeline && !InspectorBackend.domains.Timeline.hasEvent("programmaticCaptureStarted")) {
+            if (payload.frameId)
+                this._frame = WI.networkManager.frameForIdentifier(payload.frameId);
+        }
+
+        if (!this._frame && this.ownerDocument)
+            this._frame = WI.networkManager.frameForIdentifier(this.ownerDocument.frameIdentifier);
+
</ins><span class="cx">         this._attributes = [];
</span><span class="cx">         this._attributesMap = new Map;
</span><span class="cx">         if (payload.attributes)
</span><span class="lines">@@ -116,9 +127,6 @@
</span><span class="cx">             this._renumber();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (payload.frameId)
-            this._frameIdentifier = payload.frameId;
-
</del><span class="cx">         if (this._nodeType === Node.ELEMENT_NODE) {
</span><span class="cx">             // HTML and BODY from internal iframes should not overwrite top-level ones.
</span><span class="cx">             if (this.ownerDocument && !this.ownerDocument.documentElement && this._nodeName === "HTML")
</span><span class="lines">@@ -178,21 +186,10 @@
</span><span class="cx"> 
</span><span class="cx">     // Public
</span><span class="cx"> 
</span><ins>+    get frame() { return this._frame; }
</ins><span class="cx">     get domEvents() { return this._domEvents; }
</span><span class="cx">     get lowPowerRanges() { return this._lowPowerRanges; }
</span><span class="cx"> 
</span><del>-    get frameIdentifier()
-    {
-        return this._frameIdentifier || this.ownerDocument.frameIdentifier;
-    }
-
-    get frame()
-    {
-        if (!this._frame)
-            this._frame = WI.networkManager.frameForIdentifier(this.frameIdentifier);
-        return this._frame;
-    }
-
</del><span class="cx">     get attached()
</span><span class="cx">     {
</span><span class="cx">         for (let node = this; node; node = node.parentNode) {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js   2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -736,11 +736,8 @@
</span><span class="cx">         let isNonShadowEditable = !node.isInUserAgentShadowTree() && this.editable;
</span><span class="cx">         let attached = node.attached;
</span><span class="cx"> 
</span><del>-        if (event.target && event.target.tagName === "A") {
-            let url = event.target.href;
-            let frame = WI.networkManager.frameForIdentifier(node.frameIdentifier);
-            WI.appendContextMenuItemsForURL(contextMenu, url, {frame});
-        }
</del><ins>+        if (event.target && event.target.tagName === "A")
+            WI.appendContextMenuItemsForURL(contextMenu, event.target.href, {frame: node.frame});
</ins><span class="cx"> 
</span><span class="cx">         contextMenu.appendSeparator();
</span><span class="cx"> 
</span><span class="lines">@@ -1276,7 +1273,7 @@
</span><span class="cx">             attrSpanElement.append("=\u200B\"");
</span><span class="cx"> 
</span><span class="cx">         if (name === "src" || /\bhref\b/.test(name)) {
</span><del>-            let baseURL = node.ownerDocument ? node.ownerDocument.documentURL : null;
</del><ins>+            let baseURL = node.frame ? node.frame.url : null;
</ins><span class="cx">             let rewrittenURL = absoluteURL(value, baseURL);
</span><span class="cx">             value = value.insertWordBreakCharacters();
</span><span class="cx">             if (!rewrittenURL) {
</span><span class="lines">@@ -1292,7 +1289,7 @@
</span><span class="cx">                 attrSpanElement.appendChild(attrValueElement);
</span><span class="cx">             }
</span><span class="cx">         } else if (name === "srcset") {
</span><del>-            let baseURL = node.ownerDocument ? node.ownerDocument.documentURL : null;
</del><ins>+            let baseURL = node.frame ? node.frame.url : null;
</ins><span class="cx">             attrValueElement = attrSpanElement.createChild("span", "html-attribute-value");
</span><span class="cx"> 
</span><span class="cx">             // Leading whitespace.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsQuickConsolejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js  2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js     2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -145,11 +145,10 @@
</span><span class="cx"> 
</span><span class="cx">         let inspectedNode = WI.domManager.inspectedNode;
</span><span class="cx">         if (inspectedNode) {
</span><del>-            let frame = inspectedNode.ownerDocument.frame;
</del><ins>+            let frame = inspectedNode.frame;
</ins><span class="cx">             if (frame) {
</span><span class="cx">                 if (this._shouldAutomaticallySelectExecutionContext)
</span><span class="cx">                     executionContext = frame.pageExecutionContext;
</span><del>-
</del><span class="cx">                 preferredName = this._preferredNameForFrame(frame);
</span><span class="cx">             }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsSpreadsheetCSSStyleDeclarationSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js (244565 => 244566)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js 2019-04-23 20:52:31 UTC (rev 244565)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js    2019-04-23 21:06:43 UTC (rev 244566)
</span><span class="lines">@@ -493,13 +493,18 @@
</span><span class="cx"> 
</span><span class="cx">     _highlightNodesWithSelector()
</span><span class="cx">     {
</span><ins>+        let node = this._style.node;
+
</ins><span class="cx">         if (!this._style.ownerRule) {
</span><del>-            WI.domManager.highlightDOMNode(this._style.node.id);
</del><ins>+            WI.domManager.highlightDOMNode(node.id);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         let selectorText = this._selectorElement.textContent.trim();
</span><del>-        WI.domManager.highlightSelector(selectorText, this._style.node.ownerDocument.frameIdentifier);
</del><ins>+        if (node.frame)
+            WI.domManager.highlightSelector(selectorText, node.frame.id);
+        else
+            WI.domManager.highlightSelector(selectorText);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     _hideDOMNodeHighlight()
</span></span></pre>
</div>
</div>

</body>
</html>