<!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>[202634] 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/202634">202634</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-29 11:36:29 -0700 (Wed, 29 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Show Shadow Root type in DOM Tree
https://bugs.webkit.org/show_bug.cgi?id=159236
&lt;rdar://problem/27068521&gt;

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2016-06-29
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:
Include optional shadowRootType property for DOMNodes.

Source/WebCore:

Test: inspector/dom/shadowRootType.html

* inspector/InspectorDOMAgent.cpp:
(WebCore::shadowRootType):
(WebCore::InspectorDOMAgent::buildObjectForNode):
Set the shadowRootType property when a node is a ShadowRoot.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
&quot;Shadow Content (type)&quot; string.

* UserInterface/Models/DOMNode.js:
(WebInspector.DOMNode):
(WebInspector.DOMNode.prototype.shadowRoots):
(WebInspector.DOMNode.prototype.shadowRootType):
Initialize state and add accessors.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.shadowRootTypeDisplayName):
(WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
Better string when an element is a Shadow Root.

* UserInterface/Views/DOMTreeElementPathComponent.js:
(WebInspector.DOMTreeElementPathComponent):
Better to check the Shadow Root type.

* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom .html-fragment.shadow):
Opacity looks poor when there is a selection. Switch to gray.

LayoutTests:

* inspector/dom/shadowRootType-expected.txt: Added.
* inspector/dom/shadowRootType.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<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="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.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="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementPathComponentjs">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinecss">trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/LayoutTests/ChangeLog        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-06-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Show Shadow Root type in DOM Tree
+        https://bugs.webkit.org/show_bug.cgi?id=159236
+        &lt;rdar://problem/27068521&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/dom/shadowRootType-expected.txt: Added.
+        * inspector/dom/shadowRootType.html: Added.
+
</ins><span class="cx"> 2016-06-29  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC] Fix small issues of TypedArray prototype
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordomshadowRootTypeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/shadowRootType-expected.txt (0 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/shadowRootType-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/shadowRootType-expected.txt        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test for DOMNode.shadowRootType.
+
+
+== Running test suite: DOMNode.shadowRootType
+-- Running test case: ShadowRootType.UserAgent
+PASS: DOMNode has a single shadow root.
+PASS: DOMNode has UserAgent shadow root type.
+
+-- Running test case: ShadowRootType.Closed
+PASS: DOMNode has a single shadow root.
+PASS: DOMNode has Closed shadow root type.
+
+-- Running test case: ShadowRootType.Open
+PASS: DOMNode has a single shadow root.
+PASS: DOMNode has Open shadow root type.
+
+-- Running test case: NoShadowRootType
+PASS: DOMNode has no shadow roots.
+PASS: DOMNode has no shadow root type.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordomshadowRootTypehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/dom/shadowRootType.html (0 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/dom/shadowRootType.html                                (rev 0)
+++ trunk/LayoutTests/inspector/dom/shadowRootType.html        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    let documentNode;
+
+    let suite = InspectorTest.createAsyncSuite(&quot;DOMNode.shadowRootType&quot;);
+
+    suite.addTestCase({
+        name: &quot;ShadowRootType.UserAgent&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.domTreeManager.querySelector(documentNode.id, &quot;#host-user-agent&quot;, (nodeId) =&gt; {
+                let domNode = WebInspector.domTreeManager.nodeForId(nodeId);
+                InspectorTest.assert(domNode, &quot;Got DOMNode for #host-user-agent&quot;);
+                InspectorTest.expectThat(domNode.shadowRoots().length === 1, &quot;DOMNode has a single shadow root.&quot;);
+                InspectorTest.expectThat(domNode.shadowRoots()[0].shadowRootType() === WebInspector.DOMNode.ShadowRootType.UserAgent, &quot;DOMNode has UserAgent shadow root type.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ShadowRootType.Closed&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.domTreeManager.querySelector(documentNode.id, &quot;#host-closed&quot;, (nodeId) =&gt; {
+                let domNode = WebInspector.domTreeManager.nodeForId(nodeId);
+                InspectorTest.assert(domNode, &quot;Got DOMNode for #host-closed&quot;);
+                InspectorTest.expectThat(domNode.shadowRoots().length === 1, &quot;DOMNode has a single shadow root.&quot;);
+                InspectorTest.expectThat(domNode.shadowRoots()[0].shadowRootType() === WebInspector.DOMNode.ShadowRootType.Closed, &quot;DOMNode has Closed shadow root type.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;ShadowRootType.Open&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.domTreeManager.querySelector(documentNode.id, &quot;#host-open&quot;, (nodeId) =&gt; {
+                let domNode = WebInspector.domTreeManager.nodeForId(nodeId);
+                InspectorTest.assert(domNode, &quot;Got DOMNode for #host-open&quot;);
+                InspectorTest.expectThat(domNode.shadowRoots().length === 1, &quot;DOMNode has a single shadow root.&quot;);
+                InspectorTest.expectThat(domNode.shadowRoots()[0].shadowRootType() === WebInspector.DOMNode.ShadowRootType.Open, &quot;DOMNode has Open shadow root type.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;NoShadowRootType&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.domTreeManager.querySelector(documentNode.id, &quot;#no-host&quot;, (nodeId) =&gt; {
+                let domNode = WebInspector.domTreeManager.nodeForId(nodeId);
+                InspectorTest.assert(domNode, &quot;Got DOMNode for #no-host&quot;);
+                InspectorTest.expectThat(domNode.shadowRoots().length === 0, &quot;DOMNode has no shadow roots.&quot;);
+                InspectorTest.expectThat(domNode.shadowRootType() === undefined, &quot;DOMNode has no shadow root type.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    WebInspector.domTreeManager.requestDocument((node) =&gt; {
+        documentNode = node;
+        suite.runTestCasesAndFinish();
+    });
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;p&gt;Test for DOMNode.shadowRootType.&lt;/p&gt;
+&lt;div style=&quot;display: none&quot;&gt;
+    &lt;input id=&quot;host-user-agent&quot; controls&gt;
+    &lt;div id=&quot;host-closed&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;host-open&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;no-host&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;script&gt;
+(function() {
+    var shadowRootClosed = document.getElementById(&quot;host-closed&quot;).attachShadow({mode: &quot;closed&quot;});
+    shadowRootClosed.appendChild(document.createTextNode(&quot;closed&quot;));
+
+    var shadowRootOpen = document.getElementById(&quot;host-open&quot;).attachShadow({mode: &quot;open&quot;});
+    shadowRootOpen.appendChild(document.createTextNode(&quot;open&quot;));
+})();
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-06-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Show Shadow Root type in DOM Tree
+        https://bugs.webkit.org/show_bug.cgi?id=159236
+        &lt;rdar://problem/27068521&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/protocol/DOM.json:
+        Include optional shadowRootType property for DOMNodes.
+
</ins><span class="cx"> 2016-06-29  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r202627.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolDOMjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/DOM.json (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/DOM.json        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/JavaScriptCore/inspector/protocol/DOM.json        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -20,6 +20,12 @@
</span><span class="cx">             &quot;description&quot;: &quot;Pseudo element type.&quot;
</span><span class="cx">         },
</span><span class="cx">         {
</span><ins>+            &quot;id&quot;: &quot;ShadowRootType&quot;,
+            &quot;type&quot;: &quot;string&quot;,
+            &quot;enum&quot;: [&quot;user-agent&quot;, &quot;open&quot;, &quot;closed&quot;],
+            &quot;description&quot;: &quot;Shadow root type.&quot;
+        },
+        {
</ins><span class="cx">             &quot;id&quot;: &quot;LiveRegionRelevant&quot;,
</span><span class="cx">             &quot;type&quot;: &quot;string&quot;,
</span><span class="cx">             &quot;enum&quot;: [&quot;additions&quot;, &quot;removals&quot;, &quot;text&quot;],
</span><span class="lines">@@ -46,6 +52,7 @@
</span><span class="cx">                 { &quot;name&quot;: &quot;name&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;&lt;code&gt;Attr&lt;/code&gt;'s name.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;value&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;&lt;code&gt;Attr&lt;/code&gt;'s value.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;pseudoType&quot;, &quot;$ref&quot;: &quot;PseudoType&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Pseudo element type for this node.&quot; },
</span><ins>+                { &quot;name&quot;: &quot;shadowRootType&quot;, &quot;$ref&quot;: &quot;ShadowRootType&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Shadow root type.&quot; },
</ins><span class="cx">                 { &quot;name&quot;: &quot;frameId&quot;, &quot;$ref&quot;: &quot;Network.FrameId&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Frame ID for frame owner elements.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;contentDocument&quot;, &quot;$ref&quot;: &quot;Node&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Content document for frame owner elements.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;shadowRoots&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;$ref&quot;: &quot;Node&quot; }, &quot;description&quot;: &quot;Shadow root list for given element host.&quot; },
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/WebCore/ChangeLog        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-06-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Show Shadow Root type in DOM Tree
+        https://bugs.webkit.org/show_bug.cgi?id=159236
+        &lt;rdar://problem/27068521&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        Test: inspector/dom/shadowRootType.html
+
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::shadowRootType):
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+        Set the shadowRootType property when a node is a ShadowRoot.
+
</ins><span class="cx"> 2016-06-29  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Replace MPAudioVideoRoutingActionSheet with MPAVRoutingSheet.
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -1280,6 +1280,21 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static Inspector::Protocol::DOM::ShadowRootType shadowRootType(ShadowRoot::Type type)
+{
+    switch (type) {
+    case ShadowRoot::Type::UserAgent:
+        return Inspector::Protocol::DOM::ShadowRootType::UserAgent;
+    case ShadowRoot::Type::Closed:
+        return Inspector::Protocol::DOM::ShadowRootType::Closed;
+    case ShadowRoot::Type::Open:
+        return Inspector::Protocol::DOM::ShadowRootType::Open;
+    }
+
+    ASSERT_NOT_REACHED();
+    return Inspector::Protocol::DOM::ShadowRootType::UserAgent;
+}
+
</ins><span class="cx"> static String computeContentSecurityPolicySHA256Hash(const Element&amp; element)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Compute the digest with respect to the raw bytes received from the page.
</span><span class="lines">@@ -1391,6 +1406,9 @@
</span><span class="cx">         Attr&amp; attribute = downcast&lt;Attr&gt;(*node);
</span><span class="cx">         value-&gt;setName(attribute.name());
</span><span class="cx">         value-&gt;setValue(attribute.value());
</span><ins>+    } else if (is&lt;ShadowRoot&gt;(*node)) {
+        ShadowRoot&amp; shadowRoot = downcast&lt;ShadowRoot&gt;(*node);
+        value-&gt;setShadowRootType(shadowRootType(shadowRoot.type()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Need to enable AX to get the computed role.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-06-29  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Show Shadow Root type in DOM Tree
+        https://bugs.webkit.org/show_bug.cgi?id=159236
+        &lt;rdar://problem/27068521&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        &quot;Shadow Content (type)&quot; string.
+
+        * UserInterface/Models/DOMNode.js:
+        (WebInspector.DOMNode):
+        (WebInspector.DOMNode.prototype.shadowRoots):
+        (WebInspector.DOMNode.prototype.shadowRootType):
+        Initialize state and add accessors.
+
+        * UserInterface/Views/DOMTreeElement.js:
+        (WebInspector.DOMTreeElement.shadowRootTypeDisplayName):
+        (WebInspector.DOMTreeElement.prototype._nodeTitleInfo):
+        Better string when an element is a Shadow Root.
+
+        * UserInterface/Views/DOMTreeElementPathComponent.js:
+        (WebInspector.DOMTreeElementPathComponent):
+        Better to check the Shadow Root type.
+
+        * UserInterface/Views/DOMTreeOutline.css:
+        (.tree-outline.dom .html-fragment.shadow):
+        Opacity looks poor when there is a selection. Switch to gray.
+
</ins><span class="cx"> 2016-06-28  Nikita Vasilyev  &lt;nvasilyev@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r188730): Web Inspector: Warning icons incorrectly positioned in CSS Rules sidebar
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -159,6 +159,7 @@
</span><span class="cx"> localizedStrings[&quot;Close Other Tabs&quot;] = &quot;Close Other Tabs&quot;;
</span><span class="cx"> localizedStrings[&quot;Close Tab&quot;] = &quot;Close Tab&quot;;
</span><span class="cx"> localizedStrings[&quot;Close resource view&quot;] = &quot;Close resource view&quot;;
</span><ins>+localizedStrings[&quot;Closed&quot;] = &quot;Closed&quot;;
</ins><span class="cx"> localizedStrings[&quot;Closure Variables&quot;] = &quot;Closure Variables&quot;;
</span><span class="cx"> localizedStrings[&quot;Closure Variables (%s)&quot;] = &quot;Closure Variables (%s)&quot;;
</span><span class="cx"> localizedStrings[&quot;Code&quot;] = &quot;Code&quot;;
</span><span class="lines">@@ -497,6 +498,7 @@
</span><span class="cx"> localizedStrings[&quot;Online&quot;] = &quot;Online&quot;;
</span><span class="cx"> localizedStrings[&quot;Only show resources with issues&quot;] = &quot;Only show resources with issues&quot;;
</span><span class="cx"> localizedStrings[&quot;Opacity&quot;] = &quot;Opacity&quot;;
</span><ins>+localizedStrings[&quot;Open&quot;] = &quot;Open&quot;;
</ins><span class="cx"> localizedStrings[&quot;Option-click to show all units&quot;] = &quot;Option-click to show all units&quot;;
</span><span class="cx"> localizedStrings[&quot;Option-click to show all values&quot;] = &quot;Option-click to show all values&quot;;
</span><span class="cx"> localizedStrings[&quot;Option-click to show source&quot;] = &quot;Option-click to show source&quot;;
</span><span class="lines">@@ -621,6 +623,7 @@
</span><span class="cx"> localizedStrings[&quot;Settings&quot;] = &quot;Settings&quot;;
</span><span class="cx"> localizedStrings[&quot;Shadow&quot;] = &quot;Shadow&quot;;
</span><span class="cx"> localizedStrings[&quot;Shadow Content&quot;] = &quot;Shadow Content&quot;;
</span><ins>+localizedStrings[&quot;Shadow Content (%s)&quot;] = &quot;Shadow Content (%s)&quot;;
</ins><span class="cx"> localizedStrings[&quot;Shared Focus&quot;] = &quot;Shared Focus&quot;;
</span><span class="cx"> localizedStrings[&quot;Shortest property path to %s&quot;] = &quot;Shortest property path to %s&quot;;
</span><span class="cx"> localizedStrings[&quot;Show %d More&quot;] = &quot;Show %d More&quot;;
</span><span class="lines">@@ -733,6 +736,7 @@
</span><span class="cx"> localizedStrings[&quot;Uncomment All Properties&quot;] = &quot;Uncomment All Properties&quot;;
</span><span class="cx"> localizedStrings[&quot;Unknown node&quot;] = &quot;Unknown node&quot;;
</span><span class="cx"> localizedStrings[&quot;Untitled&quot;] = &quot;Untitled&quot;;
</span><ins>+localizedStrings[&quot;User Agent&quot;] = &quot;User Agent&quot;;
</ins><span class="cx"> localizedStrings[&quot;User Agent Stylesheet&quot;] = &quot;User Agent Stylesheet&quot;;
</span><span class="cx"> localizedStrings[&quot;User Stylesheet&quot;] = &quot;User Stylesheet&quot;;
</span><span class="cx"> localizedStrings[&quot;Using Keyword Value&quot;] = &quot;Using Keyword Value&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">         this._localName = payload.localName;
</span><span class="cx">         this._nodeValue = payload.nodeValue;
</span><span class="cx">         this._pseudoType = payload.pseudoType;
</span><ins>+        this._shadowRootType = payload.shadowRootType;
</ins><span class="cx">         this._computedRole = payload.role;
</span><span class="cx">         this._contentSecurityPolicyHash = payload.contentSecurityPolicyHash;
</span><span class="cx"> 
</span><span class="lines">@@ -318,6 +319,16 @@
</span><span class="cx">         return this._pseudoElements.get(WebInspector.DOMNode.PseudoElementType.After) || null;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    shadowRoots()
+    {
+        return this._shadowRoots;
+    }
+
+    shadowRootType()
+    {
+        return this._shadowRootType;
+    }
+
</ins><span class="cx">     nodeValue()
</span><span class="cx">     {
</span><span class="cx">         return this._nodeValue;
</span><span class="lines">@@ -678,3 +689,9 @@
</span><span class="cx">     Before: &quot;before&quot;,
</span><span class="cx">     After: &quot;after&quot;,
</span><span class="cx"> };
</span><ins>+
+WebInspector.DOMNode.ShadowRootType = {
+    UserAgent: &quot;user-agent&quot;,
+    Closed: &quot;closed&quot;,
+    Open: &quot;open&quot;,
+};
</ins></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -48,6 +48,22 @@
</span><span class="cx">         node.addEventListener(WebInspector.DOMNode.Event.EnabledPseudoClassesChanged, this._nodePseudoClassesDidChange, this);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // Static
+
+    static shadowRootTypeDisplayName(type)
+    {
+        switch (type) {
+        case WebInspector.DOMNode.ShadowRootType.UserAgent:
+            return WebInspector.UIString(&quot;User Agent&quot;);
+        case WebInspector.DOMNode.ShadowRootType.Open:
+            return WebInspector.UIString(&quot;Open&quot;);
+        case WebInspector.DOMNode.ShadowRootType.Closed:
+            return WebInspector.UIString(&quot;Closed&quot;);
+        }
+    }
+
+    // Public
+
</ins><span class="cx">     isCloseTag()
</span><span class="cx">     {
</span><span class="cx">         return this._elementCloseTag;
</span><span class="lines">@@ -1195,8 +1211,8 @@
</span><span class="cx">         switch (node.nodeType()) {
</span><span class="cx">             case Node.DOCUMENT_FRAGMENT_NODE:
</span><span class="cx">                 var fragmentElement = info.titleDOM.createChild(&quot;span&quot;, &quot;html-fragment&quot;);
</span><del>-                if (node.isInShadowTree()) {
-                    fragmentElement.textContent = WebInspector.UIString(&quot;Shadow Content&quot;);
</del><ins>+                if (node.shadowRootType()) {
+                    fragmentElement.textContent = WebInspector.UIString(&quot;Shadow Content (%s)&quot;).format(WebInspector.DOMTreeElement.shadowRootTypeDisplayName(node.shadowRootType()));
</ins><span class="cx">                     fragmentElement.classList.add(&quot;shadow&quot;);
</span><span class="cx">                 } else if (node.parentNode &amp;&amp; node.parentNode.templateContent() === node)
</span><span class="cx">                     fragmentElement.textContent = WebInspector.UIString(&quot;Template Content&quot;);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeElementPathComponentjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">             // FIXME: At some point we might want a different icon for this.
</span><span class="cx">             // &lt;rdar://problem/12800950&gt; Need icon for DOCUMENT_FRAGMENT_NODE and PROCESSING_INSTRUCTION_NODE
</span><span class="cx">             className = WebInspector.DOMTreeElementPathComponent.DOMDocumentTypeIconStyleClassName;
</span><del>-            if (node.isInShadowTree())
</del><ins>+            if (node.shadowRootType())
</ins><span class="cx">                 title = WebInspector.UIString(&quot;Shadow Content&quot;);
</span><span class="cx">             else
</span><span class="cx">                 title = WebInspector.displayNameForNode(node);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsDOMTreeOutlinecss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css (202633 => 202634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css        2016-06-29 18:25:40 UTC (rev 202633)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.css        2016-06-29 18:36:29 UTC (rev 202634)
</span><span class="lines">@@ -187,7 +187,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .tree-outline.dom .html-fragment.shadow {
</span><del>-    opacity: 0.6;
</del><ins>+    color: gray;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> .showing-find-banner .tree-outline.dom .search-highlight {
</span></span></pre>
</div>
</div>

</body>
</html>