<!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>[204370] trunk</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/204370">204370</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-08-10 20:35:01 -0700 (Wed, 10 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Should be able to Edit Node Attributes and Styles for non-UserAgent Shadow DOM nodes
https://bugs.webkit.org/show_bug.cgi?id=160762
<rdar://problem/27798271>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-08-10
Reviewed by Ryosuke Niwa.
Source/WebCore:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::assertEditableNode):
(WebCore::InspectorDOMAgent::assertEditableElement):
* inspector/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::addInspectedNode):
Allow editing shadow DOM nodes as long as they are not in a UserAgent shadow tree.
Source/WebInspectorUI:
* UserInterface/Models/DOMNode.js:
(WebInspector.DOMNode.prototype.isInUserAgentShadowTree):
(WebInspector.DOMNode.prototype.isShadowRoot):
(WebInspector.DOMNode.prototype.isUserAgentShadowRoot):
(WebInspector.DOMNode.prototype.ancestorShadowRoot):
(WebInspector.DOMNode.prototype.ancestorShadowHost):
Add methods for determining the shadow root, host, and easily
checking the type of shadow tree a node is in.
* UserInterface/Models/CSSStyleDeclaration.js:
(WebInspector.CSSStyleDeclaration.prototype.get editable):
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype.get editable):
(WebInspector.DOMTreeElement.prototype._startEditingTarget):
(WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonClicked):
* UserInterface/Views/VisualStyleSelectorSection.js:
(WebInspector.VisualStyleSelectorSection.prototype._addNewRule):
Allow editing shadow DOM nodes as long as they are not in a UserAgent shadow tree.
* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline.prototype._populateContextMenu):
Disallow "Log Element" on UserAgent shadow tree nodes.
LayoutTests:
* inspector/dom/shadowRootType-expected.txt:
* inspector/dom/shadowRootType.html:
Add tests for DOMNode.prototype.isInUserAgentShadowTree.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectordomshadowRootTypeexpectedtxt">trunk/LayoutTests/inspector/dom/shadowRootType-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordomshadowRootTypehtml">trunk/LayoutTests/inspector/dom/shadowRootType.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageConsoleAgentcpp">trunk/Source/WebCore/inspector/PageConsoleAgent.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsCSSStyleDeclarationjs">trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.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="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinejs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorSectionjs">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/LayoutTests/ChangeLog        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-08-10 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Should be able to Edit Node Attributes and Styles for non-UserAgent Shadow DOM nodes
+ https://bugs.webkit.org/show_bug.cgi?id=160762
+ <rdar://problem/27798271>
+
+ Reviewed by Ryosuke Niwa.
+
+ * inspector/dom/shadowRootType-expected.txt:
+ * inspector/dom/shadowRootType.html:
+ Add tests for DOMNode.prototype.isInUserAgentShadowTree.
+
</ins><span class="cx"> 2016-08-10 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Optimization in Node.insertBefore() is not spec-compliant
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomshadowRootTypeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/shadowRootType-expected.txt (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/shadowRootType-expected.txt        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/LayoutTests/inspector/dom/shadowRootType-expected.txt        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -5,14 +5,17 @@
</span><span class="cx"> -- Running test case: ShadowRootType.UserAgent
</span><span class="cx"> PASS: DOMNode has a single shadow root.
</span><span class="cx"> PASS: DOMNode has UserAgent shadow root type.
</span><ins>+PASS: DOMNode is in a UserAgent shadow tree.
</ins><span class="cx">
</span><span class="cx"> -- Running test case: ShadowRootType.Closed
</span><span class="cx"> PASS: DOMNode has a single shadow root.
</span><span class="cx"> PASS: DOMNode has Closed shadow root type.
</span><ins>+PASS: DOMNode is not in a UserAgent shadow tree.
</ins><span class="cx">
</span><span class="cx"> -- Running test case: ShadowRootType.Open
</span><span class="cx"> PASS: DOMNode has a single shadow root.
</span><span class="cx"> PASS: DOMNode has Open shadow root type.
</span><ins>+PASS: DOMNode is not in a UserAgent shadow tree.
</ins><span class="cx">
</span><span class="cx"> -- Running test case: NoShadowRootType
</span><span class="cx"> PASS: DOMNode has no shadow roots.
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomshadowRootTypehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/dom/shadowRootType.html (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/shadowRootType.html        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/LayoutTests/inspector/dom/shadowRootType.html        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -17,6 +17,7 @@
</span><span class="cx"> InspectorTest.assert(domNode, "Got DOMNode for #host-user-agent");
</span><span class="cx"> InspectorTest.expectThat(domNode.shadowRoots().length === 1, "DOMNode has a single shadow root.");
</span><span class="cx"> InspectorTest.expectThat(domNode.shadowRoots()[0].shadowRootType() === WebInspector.DOMNode.ShadowRootType.UserAgent, "DOMNode has UserAgent shadow root type.");
</span><ins>+ InspectorTest.expectThat(domNode.shadowRoots()[0].isInUserAgentShadowTree(), "DOMNode is in a UserAgent shadow tree.");
</ins><span class="cx"> resolve();
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="lines">@@ -30,6 +31,7 @@
</span><span class="cx"> InspectorTest.assert(domNode, "Got DOMNode for #host-closed");
</span><span class="cx"> InspectorTest.expectThat(domNode.shadowRoots().length === 1, "DOMNode has a single shadow root.");
</span><span class="cx"> InspectorTest.expectThat(domNode.shadowRoots()[0].shadowRootType() === WebInspector.DOMNode.ShadowRootType.Closed, "DOMNode has Closed shadow root type.");
</span><ins>+ InspectorTest.expectThat(!domNode.shadowRoots()[0].isInUserAgentShadowTree(), "DOMNode is not in a UserAgent shadow tree.");
</ins><span class="cx"> resolve();
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="lines">@@ -43,6 +45,7 @@
</span><span class="cx"> InspectorTest.assert(domNode, "Got DOMNode for #host-open");
</span><span class="cx"> InspectorTest.expectThat(domNode.shadowRoots().length === 1, "DOMNode has a single shadow root.");
</span><span class="cx"> InspectorTest.expectThat(domNode.shadowRoots()[0].shadowRootType() === WebInspector.DOMNode.ShadowRootType.Open, "DOMNode has Open shadow root type.");
</span><ins>+ InspectorTest.expectThat(!domNode.shadowRoots()[0].isInUserAgentShadowTree(), "DOMNode is not in a UserAgent shadow tree.");
</ins><span class="cx"> resolve();
</span><span class="cx"> });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebCore/ChangeLog        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-08-10 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Should be able to Edit Node Attributes and Styles for non-UserAgent Shadow DOM nodes
+ https://bugs.webkit.org/show_bug.cgi?id=160762
+ <rdar://problem/27798271>
+
+ Reviewed by Ryosuke Niwa.
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::assertEditableNode):
+ (WebCore::InspectorDOMAgent::assertEditableElement):
+ * inspector/PageConsoleAgent.cpp:
+ (WebCore::PageConsoleAgent::addInspectedNode):
+ Allow editing shadow DOM nodes as long as they are not in a UserAgent shadow tree.
+
</ins><span class="cx"> 2016-08-10 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Optimization in Node.insertBefore() is not spec-compliant
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -395,8 +395,8 @@
</span><span class="cx"> Node* node = assertNode(errorString, nodeId);
</span><span class="cx"> if (!node)
</span><span class="cx"> return nullptr;
</span><del>- if (node->isInShadowTree()) {
- errorString = ASCIILiteral("Cannot edit nodes from shadow trees");
</del><ins>+ if (node->isInUserAgentShadowTree()) {
+ errorString = ASCIILiteral("Cannot edit nodes in user agent shadow trees");
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> if (node->isPseudoElement()) {
</span><span class="lines">@@ -411,8 +411,8 @@
</span><span class="cx"> Element* element = assertElement(errorString, nodeId);
</span><span class="cx"> if (!element)
</span><span class="cx"> return nullptr;
</span><del>- if (element->isInShadowTree()) {
- errorString = ASCIILiteral("Cannot edit elements from shadow trees");
</del><ins>+ if (element->isInUserAgentShadowTree()) {
+ errorString = ASCIILiteral("Cannot edit elements in user agent shadow trees");
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> if (element->isPseudoElement()) {
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageConsoleAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageConsoleAgent.cpp (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageConsoleAgent.cpp        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebCore/inspector/PageConsoleAgent.cpp        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> void PageConsoleAgent::addInspectedNode(ErrorString& errorString, int nodeId)
</span><span class="cx"> {
</span><span class="cx"> Node* node = m_inspectorDOMAgent->nodeForId(nodeId);
</span><del>- if (!node || node->isInShadowTree()) {
</del><ins>+ if (!node || node->isInUserAgentShadowTree()) {
</ins><span class="cx"> errorString = ASCIILiteral("nodeId is not valid");
</span><span class="cx"> return;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-08-10 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Should be able to Edit Node Attributes and Styles for non-UserAgent Shadow DOM nodes
+ https://bugs.webkit.org/show_bug.cgi?id=160762
+ <rdar://problem/27798271>
+
+ Reviewed by Ryosuke Niwa.
+
+ * UserInterface/Models/DOMNode.js:
+ (WebInspector.DOMNode.prototype.isInUserAgentShadowTree):
+ (WebInspector.DOMNode.prototype.isShadowRoot):
+ (WebInspector.DOMNode.prototype.isUserAgentShadowRoot):
+ (WebInspector.DOMNode.prototype.ancestorShadowRoot):
+ (WebInspector.DOMNode.prototype.ancestorShadowHost):
+ Add methods for determining the shadow root, host, and easily
+ checking the type of shadow tree a node is in.
+
+ * UserInterface/Models/CSSStyleDeclaration.js:
+ (WebInspector.CSSStyleDeclaration.prototype.get editable):
+ * UserInterface/Views/DOMTreeElement.js:
+ (WebInspector.DOMTreeElement.prototype.get editable):
+ (WebInspector.DOMTreeElement.prototype._startEditingTarget):
+ (WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
+ * UserInterface/Views/RulesStyleDetailsPanel.js:
+ (WebInspector.RulesStyleDetailsPanel.prototype.newRuleButtonClicked):
+ * UserInterface/Views/VisualStyleSelectorSection.js:
+ (WebInspector.VisualStyleSelectorSection.prototype._addNewRule):
+ Allow editing shadow DOM nodes as long as they are not in a UserAgent shadow tree.
+
+ * UserInterface/Views/DOMTreeOutline.js:
+ (WebInspector.DOMTreeOutline.prototype._populateContextMenu):
+ Disallow "Log Element" on UserAgent shadow tree nodes.
+
</ins><span class="cx"> 2016-08-10 Nikita Vasilyev <nvasilyev@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Can't click on the lower half of "S" icon in JavaScript Allocations timeline
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsCSSStyleDeclarationjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSStyleDeclaration.js        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> return this._ownerRule && this._ownerRule.editable;
</span><span class="cx">
</span><span class="cx"> if (this._type === WebInspector.CSSStyleDeclaration.Type.Inline)
</span><del>- return !this._node.isInShadowTree();
</del><ins>+ return !this._node.isInUserAgentShadowTree();
</ins><span class="cx">
</span><span class="cx"> return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -258,6 +258,38 @@
</span><span class="cx"> return this._isInShadowTree;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ isInUserAgentShadowTree()
+ {
+ return this._isInShadowTree && this.ancestorShadowRoot().isUserAgentShadowRoot();
+ }
+
+ isShadowRoot()
+ {
+ return !!this._shadowRootType;
+ }
+
+ isUserAgentShadowRoot()
+ {
+ return this._shadowRootType === WebInspector.DOMNode.ShadowRootType.UserAgent;
+ }
+
+ ancestorShadowRoot()
+ {
+ if (!this._isInShadowTree)
+ return null;
+
+ let node = this;
+ while (node && !node.isShadowRoot())
+ node = node.parentNode;
+ return node;
+ }
+
+ ancestorShadowHost()
+ {
+ let shadowRoot = this.ancestorShadowRoot();
+ return shadowRoot ? shadowRoot.parentNode : null;
+ }
+
</ins><span class="cx"> isPseudoElement()
</span><span class="cx"> {
</span><span class="cx"> return this._pseudoType !== undefined;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -175,9 +175,11 @@
</span><span class="cx">
</span><span class="cx"> get editable()
</span><span class="cx"> {
</span><del>- var node = this.representedObject;
- if (node.isInShadowTree())
</del><ins>+ let node = this.representedObject;
+
+ if (node.isShadowRoot() || node.isInUserAgentShadowTree())
</ins><span class="cx"> return false;
</span><ins>+
</ins><span class="cx"> if (node.isPseudoElement())
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -615,9 +617,12 @@
</span><span class="cx"> if (this.treeOutline.selectedDOMNode() !== this.representedObject)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (this.representedObject.isInShadowTree() || this.representedObject.isPseudoElement())
</del><ins>+ if (this.representedObject.isShadowRoot() || this.representedObject.isInUserAgentShadowTree())
</ins><span class="cx"> return false;
</span><span class="cx">
</span><ins>+ if (this.representedObject.isPseudoElement())
+ return false;
+
</ins><span class="cx"> if (this.representedObject.nodeType() !== Node.ELEMENT_NODE && this.representedObject.nodeType() !== Node.TEXT_NODE)
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -639,7 +644,7 @@
</span><span class="cx"> _populateTagContextMenu(contextMenu, event)
</span><span class="cx"> {
</span><span class="cx"> var node = this.representedObject;
</span><del>- if (!node.isInShadowTree()) {
</del><ins>+ if (!node.isInUserAgentShadowTree()) {
</ins><span class="cx"> var attribute = event.target.enclosingNodeOrSelfWithClass("html-attribute");
</span><span class="cx">
</span><span class="cx"> // Add attribute-related actions.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -523,7 +523,8 @@
</span><span class="cx"> if (!this._excludeRevealElementContextMenu)
</span><span class="cx"> contextMenu.appendItem(WebInspector.UIString("Reveal in DOM Tree"), revealElement);
</span><span class="cx">
</span><del>- contextMenu.appendItem(WebInspector.UIString("Log Element"), logElement);
</del><ins>+ if (!domNode.isInUserAgentShadowTree())
+ contextMenu.appendItem(WebInspector.UIString("Log Element"), logElement);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _showShadowDOMSettingChanged(event)
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsRulesStyleDetailsPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -380,7 +380,7 @@
</span><span class="cx">
</span><span class="cx"> newRuleButtonClicked()
</span><span class="cx"> {
</span><del>- if (this.nodeStyles.node.isInShadowTree())
</del><ins>+ if (this.nodeStyles.node.isInUserAgentShadowTree())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> for (let existingRule of this.nodeStyles.rulesForSelector()) {
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorSectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js (204369 => 204370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js        2016-08-11 03:26:55 UTC (rev 204369)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorSection.js        2016-08-11 03:35:01 UTC (rev 204370)
</span><span class="lines">@@ -259,7 +259,7 @@
</span><span class="cx">
</span><span class="cx"> _addNewRule(event)
</span><span class="cx"> {
</span><del>- if (!this._nodeStyles || this._nodeStyles.node.isInShadowTree())
</del><ins>+ if (!this._nodeStyles || this._nodeStyles.node.isInUserAgentShadowTree())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> let selector = this.currentStyle().selectorText;
</span></span></pre>
</div>
</div>
</body>
</html>