Changeset 116755 in webkit


Ignore:
Timestamp:
May 11, 2012 5:47:57 AM (12 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: Search box doesn't allow CSS selectors anymore
https://bugs.webkit.org/show_bug.cgi?id=86196

Reviewed by Pavel Feldman.

Source/WebCore:

Refactoring in http://trac.webkit.org/changeset/99983 inadvertently removed the selector matching during
node search in the InspectorDOMAgent. This change re-introduces the Document::querySelectorAll() evaluation
for the user query.

  • 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

    r116754 r116755  
     12012-05-11  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: Search box doesn't allow CSS selectors anymore
     4        https://bugs.webkit.org/show_bug.cgi?id=86196
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/elements/elements-panel-search-expected.txt:
     9        * inspector/elements/elements-panel-search.html:
     10
    1112012-05-11  Sheriff Bot  <webkit.review.bot@gmail.com>
    212
  • trunk/LayoutTests/inspector/elements/elements-panel-search-expected.txt

    r99965 r116755  
    33FooBar
    44
     5Found by selector
    56
    67Running: testSetUp
     
    3031< d i v   a t t r = " f o o " > < / d i v >
    3132
     33Running: testSelector
     34< s p a n > F o u n d   b y   s e l e c t o r < / s p a n >
     35
  • trunk/LayoutTests/inspector/elements/elements-panel-search.html

    r99983 r116755  
    7272        {
    7373            WebInspector.domAgent.performSearch("//html" + "//@attr", searchCallback.bind(this, next));
     74        },
     75
     76        function testSelector(next)
     77        {
     78            WebInspector.domAgent.performSearch("d" + "iv.divclass span", searchCallback.bind(this, next));
    7479        }
    7580    ]);
     
    8893<div attr="foo"></div>
    8994<div id="terminator"></div>
     95<div class="divclass"><span>Found by selector</span></div>
    9096
    9197</body>
  • trunk/Source/WebCore/ChangeLog

    r116754 r116755  
     12012-05-11  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: Search box doesn't allow CSS selectors anymore
     4        https://bugs.webkit.org/show_bug.cgi?id=86196
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Refactoring in http://trac.webkit.org/changeset/99983 inadvertently removed the selector matching during
     9        node search in the InspectorDOMAgent. This change re-introduces the Document::querySelectorAll() evaluation
     10        for the user query.
     11
     12        * inspector/InspectorDOMAgent.cpp:
     13        (WebCore::InspectorDOMAgent::performSearch):
     14
    1152012-05-11  Sheriff Bot  <webkit.review.bot@gmail.com>
    216
  • trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp

    r116730 r116755  
    885885            }
    886886        }
     887
     888        // Selector evaluation
     889        for (Vector<Document*>::iterator it = docs.begin(); it != docs.end(); ++it) {
     890            Document* document = *it;
     891            ExceptionCode ec = 0;
     892            RefPtr<NodeList> nodeList = document->querySelectorAll(whitespaceTrimmedQuery, ec);
     893            if (ec || !nodeList)
     894                continue;
     895
     896            unsigned size = nodeList->length();
     897            for (unsigned i = 0; i < size; ++i)
     898                resultCollector.add(nodeList->item(i));
     899        }
    887900    }
    888901
Note: See TracChangeset for help on using the changeset viewer.