Changeset 141436 in webkit


Ignore:
Timestamp:
Jan 31, 2013 10:34:11 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: searching for <u> in elements panel finds all tags containing "u"
https://bugs.webkit.org/show_bug.cgi?id=108176

Patch by Dmitry Zvorygin <zvorygin@chromium.org> on 2013-01-31
Reviewed by Pavel Feldman.

When searching for tag name check that tag name must either start from
search query, or must end with it.

Source/WebCore:

  • inspector/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::performSearch):

LayoutTests:

  • inspector/elements/elements-panel-search-expected.txt:
  • inspector/elements/elements-panel-search.html:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141434 r141436  
     12013-01-31  Dmitry Zvorygin  <zvorygin@chromium.org>
     2
     3        Web Inspector: searching for <u> in elements panel finds all tags containing "u"
     4        https://bugs.webkit.org/show_bug.cgi?id=108176
     5
     6        Reviewed by Pavel Feldman.
     7
     8        When searching for tag name check that tag name must either start from
     9        search query, or must end with it.
     10
     11        * inspector/elements/elements-panel-search-expected.txt:
     12        * inspector/elements/elements-panel-search.html:
     13
    1142013-01-31  Zan Dobersek  <zdobersek@igalia.com>
    215
  • trunk/LayoutTests/inspector/elements/elements-panel-search-expected.txt

    r126749 r141436  
    1616< i n p u t   v a l u e = " I n p u t V a l " >
    1717
     18Running: testEndTag
     19< i n p u t   v a l u e = " I n p u t V a l " >
     20
    1821Running: testPartialTag
     22< i n p u t   v a l u e = " I n p u t V a l " >
     23
     24Running: testPartialAbsentTagStart
     25Nothing found
     26
     27Running: testPartialAbsentTagEnd
     28Nothing found
     29
     30Running: testFullTag
    1931< i n p u t   v a l u e = " I n p u t V a l " >
    2032
  • trunk/LayoutTests/inspector/elements/elements-panel-search.html

    r126749 r141436  
    1010    function searchCallback(next, resultCount)
    1111    {
     12        if (resultCount == 0) {
     13            InspectorTest.addResult("Nothing found");
     14            WebInspector.domAgent.cancelSearch();
     15            next();
     16        }
     17
    1218        for (var i = 0; i < resultCount; ++i)
    1319            WebInspector.domAgent.searchResult(i, searchResultCallback.bind(this, i + 1 === resultCount));
     
    4955        },
    5056
     57        function testEndTag(next)
     58        {
     59            WebInspector.domAgent.performSearch("npu" + "t>", searchCallback.bind(this, next));
     60        },
     61
    5162        function testPartialTag(next)
    5263        {
    5364            WebInspector.domAgent.performSearch("npu" + "t", searchCallback.bind(this, next));
     65        },
     66
     67        function testPartialAbsentTagStart(next)
     68        {
     69            WebInspector.domAgent.performSearch("<npu" + "t", searchCallback.bind(this, next));
     70        },
     71
     72        function testPartialAbsentTagEnd(next)
     73        {
     74            WebInspector.domAgent.performSearch("npu" + ">", searchCallback.bind(this, next));
     75        },
     76
     77        function testFullTag(next)
     78        {
     79            WebInspector.domAgent.performSearch("<inpu" + "t>", searchCallback.bind(this, next));
    5480        },
    5581
  • trunk/Source/WebCore/ChangeLog

    r141431 r141436  
     12013-01-31  Dmitry Zvorygin  <zvorygin@chromium.org>
     2
     3        Web Inspector: searching for <u> in elements panel finds all tags containing "u"
     4        https://bugs.webkit.org/show_bug.cgi?id=108176
     5
     6        Reviewed by Pavel Feldman.
     7
     8        When searching for tag name check that tag name must either start from
     9        search query, or must end with it.
     10
     11        * inspector/InspectorDOMAgent.cpp:
     12        (WebCore::InspectorDOMAgent::performSearch):
     13
    1142013-01-30  Mark Lam  <mark.lam@apple.com>
    215
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r139429 r141436  
    876876            }
    877877            case Node::ELEMENT_NODE: {
    878                 if (node->nodeName().findIgnoringCase(tagNameQuery) != notFound) {
     878                if ((!startTagFound && !endTagFound && (node->nodeName().findIgnoringCase(tagNameQuery) != notFound))
     879                    || (startTagFound && endTagFound && equalIgnoringCase(node->nodeName(), tagNameQuery))
     880                    || (startTagFound && !endTagFound && node->nodeName().startsWith(tagNameQuery, false))
     881                    || (!startTagFound && endTagFound && node->nodeName().endsWith(tagNameQuery, false))) {
    879882                    resultCollector.add(node);
    880883                    break;
Note: See TracChangeset for help on using the changeset viewer.