Modified: trunk/LayoutTests/ChangeLog (141435 => 141436)
--- trunk/LayoutTests/ChangeLog 2013-01-31 18:32:12 UTC (rev 141435)
+++ trunk/LayoutTests/ChangeLog 2013-01-31 18:34:11 UTC (rev 141436)
@@ -1,3 +1,16 @@
+2013-01-31 Dmitry Zvorygin <[email protected]>
+
+ Web Inspector: searching for <u> in elements panel finds all tags containing "u"
+ https://bugs.webkit.org/show_bug.cgi?id=108176
+
+ Reviewed by Pavel Feldman.
+
+ When searching for tag name check that tag name must either start from
+ search query, or must end with it.
+
+ * inspector/elements/elements-panel-search-expected.txt:
+ * inspector/elements/elements-panel-search.html:
+
2013-01-31 Zan Dobersek <[email protected]>
Unreviewed GTK gardening.
Modified: trunk/LayoutTests/inspector/elements/elements-panel-search-expected.txt (141435 => 141436)
--- trunk/LayoutTests/inspector/elements/elements-panel-search-expected.txt 2013-01-31 18:32:12 UTC (rev 141435)
+++ trunk/LayoutTests/inspector/elements/elements-panel-search-expected.txt 2013-01-31 18:34:11 UTC (rev 141436)
@@ -15,9 +15,21 @@
Running: testStartTag
< i n p u t v a l u e = " I n p u t V a l " >
+Running: testEndTag
+< i n p u t v a l u e = " I n p u t V a l " >
+
Running: testPartialTag
< i n p u t v a l u e = " I n p u t V a l " >
+Running: testPartialAbsentTagStart
+Nothing found
+
+Running: testPartialAbsentTagEnd
+Nothing found
+
+Running: testFullTag
+< i n p u t v a l u e = " I n p u t V a l " >
+
Running: testExactAttributeName
< i n p u t v a l u e = " I n p u t V a l " >
Modified: trunk/LayoutTests/inspector/elements/elements-panel-search.html (141435 => 141436)
--- trunk/LayoutTests/inspector/elements/elements-panel-search.html 2013-01-31 18:32:12 UTC (rev 141435)
+++ trunk/LayoutTests/inspector/elements/elements-panel-search.html 2013-01-31 18:34:11 UTC (rev 141436)
@@ -9,6 +9,12 @@
function searchCallback(next, resultCount)
{
+ if (resultCount == 0) {
+ InspectorTest.addResult("Nothing found");
+ WebInspector.domAgent.cancelSearch();
+ next();
+ }
+
for (var i = 0; i < resultCount; ++i)
WebInspector.domAgent.searchResult(i, searchResultCallback.bind(this, i + 1 === resultCount));
@@ -48,11 +54,31 @@
WebInspector.domAgent.performSearch("<inpu" + "t", searchCallback.bind(this, next));
},
+ function testEndTag(next)
+ {
+ WebInspector.domAgent.performSearch("npu" + "t>", searchCallback.bind(this, next));
+ },
+
function testPartialTag(next)
{
WebInspector.domAgent.performSearch("npu" + "t", searchCallback.bind(this, next));
},
+ function testPartialAbsentTagStart(next)
+ {
+ WebInspector.domAgent.performSearch("<npu" + "t", searchCallback.bind(this, next));
+ },
+
+ function testPartialAbsentTagEnd(next)
+ {
+ WebInspector.domAgent.performSearch("npu" + ">", searchCallback.bind(this, next));
+ },
+
+ function testFullTag(next)
+ {
+ WebInspector.domAgent.performSearch("<inpu" + "t>", searchCallback.bind(this, next));
+ },
+
function testExactAttributeName(next)
{
WebInspector.domAgent.performSearch("valu" + "e", searchCallback.bind(this, next));
Modified: trunk/Source/WebCore/ChangeLog (141435 => 141436)
--- trunk/Source/WebCore/ChangeLog 2013-01-31 18:32:12 UTC (rev 141435)
+++ trunk/Source/WebCore/ChangeLog 2013-01-31 18:34:11 UTC (rev 141436)
@@ -1,3 +1,16 @@
+2013-01-31 Dmitry Zvorygin <[email protected]>
+
+ Web Inspector: searching for <u> in elements panel finds all tags containing "u"
+ https://bugs.webkit.org/show_bug.cgi?id=108176
+
+ Reviewed by Pavel Feldman.
+
+ When searching for tag name check that tag name must either start from
+ search query, or must end with it.
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::performSearch):
+
2013-01-30 Mark Lam <[email protected]>
DatabaseContext needs to outlive the ScriptExecutionContext.
Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (141435 => 141436)
--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp 2013-01-31 18:32:12 UTC (rev 141435)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp 2013-01-31 18:34:11 UTC (rev 141436)
@@ -875,7 +875,10 @@
break;
}
case Node::ELEMENT_NODE: {
- if (node->nodeName().findIgnoringCase(tagNameQuery) != notFound) {
+ if ((!startTagFound && !endTagFound && (node->nodeName().findIgnoringCase(tagNameQuery) != notFound))
+ || (startTagFound && endTagFound && equalIgnoringCase(node->nodeName(), tagNameQuery))
+ || (startTagFound && !endTagFound && node->nodeName().startsWith(tagNameQuery, false))
+ || (!startTagFound && endTagFound && node->nodeName().endsWith(tagNameQuery, false))) {
resultCollector.add(node);
break;
}