Commit af176916 authored by vsevik@chromium.org's avatar vsevik@chromium.org

DevTools: Fix elements panel search in shadow host.

R=pfeldman
BUG=426815

Review URL: https://codereview.chromium.org/640953004

git-svn-id: svn://svn.chromium.org/blink/trunk@184360 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c71f0cbe
...@@ -68,3 +68,6 @@ Searching UA shadow DOM with setting enabled: ...@@ -68,3 +68,6 @@ Searching UA shadow DOM with setting enabled:
< d i v i d = " i n n e r - e d i t o r " > I n p u t V a l < / d i v > < d i v i d = " i n n e r - e d i t o r " > I n p u t V a l < / d i v >
< d i v i d = " i n n e r - e d i t o r " > < / d i v > < d i v i d = " i n n e r - e d i t o r " > < / d i v >
Running: testSearchShadowHostChildren
< d i v i d = " s h a d o w - h o s t - c o n t e n t " > < / d i v >
...@@ -157,7 +157,12 @@ function test() ...@@ -157,7 +157,12 @@ function test()
InspectorTest.addResult("Searching UA shadow DOM with setting enabled:") InspectorTest.addResult("Searching UA shadow DOM with setting enabled:")
WebInspector.domModel.performSearch("inne" + "r-editor", true, searchCallback.bind(this, next)); WebInspector.domModel.performSearch("inne" + "r-editor", true, searchCallback.bind(this, next));
} }
} },
function testSearchShadowHostChildren(next)
{
WebInspector.domModel.performSearch("shadow-host-c" + "ontent", false, searchCallback.bind(this, next));
},
]); ]);
} }
...@@ -178,7 +183,7 @@ Tests that elements panel search is returning proper results. ...@@ -178,7 +183,7 @@ Tests that elements panel search is returning proper results.
<span class="CASELESS"></span> <span class="CASELESS"></span>
<span data-camel="insenstive"></span> <span data-camel="insenstive"></span>
<div id="shadow-host"> <div id="shadow-host">
<div id="shadow-root-content"></div> <div id="shadow-host-content"></div>
</div> </div>
<template id="shadow-dom-template"> <template id="shadow-dom-template">
<div id="shadow-dom-outer"> <div id="shadow-dom-outer">
......
...@@ -984,6 +984,9 @@ static Node* nextNodeWithShadowDOMInMind(const Node& current, const Node* stayWi ...@@ -984,6 +984,9 @@ static Node* nextNodeWithShadowDOMInMind(const Node& current, const Node* stayWi
const ShadowRoot* shadowRoot = toShadowRoot(node); const ShadowRoot* shadowRoot = toShadowRoot(node);
if (shadowRoot->olderShadowRoot()) if (shadowRoot->olderShadowRoot())
return shadowRoot->olderShadowRoot(); return shadowRoot->olderShadowRoot();
Node* host = shadowRoot->host();
if (host && host->hasChildren())
return host->firstChild();
} }
if (node->nextSibling()) if (node->nextSibling())
return node->nextSibling(); return node->nextSibling();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment