⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243207 in webkit


Ignore:
Timestamp:
Mar 20, 2019, 9:21:37 AM (7 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Search: allow DOM searches to be case sensitive
https://bugs.webkit.org/show_bug.cgi?id=194673
<rdar://problem/48087577>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Since DOM.performSearch also searches by selector and XPath, some results may appear
as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
as although the literal node name ("BODY") didn't match, it did match via selector/XPath.

  • inspector/protocol/DOM.json:

Allow DOM.performSearch to be case sensitive.

Source/WebCore:

Tests: inspector/dom/dom-search.html

inspector/dom/dom-search-caseSensitive.html

Since DOM.performSearch also searches by selector and XPath, some results may appear
as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
as although the literal node name ("BODY") didn't match, it did match via selector/XPath.

  • inspector/agents/InspectorDOMAgent.h:
  • inspector/agents/InspectorDOMAgent.cpp:

(WebCore::InspectorDOMAgent::performSearch):

  • inspector/InspectorNodeFinder.h:
  • inspector/InspectorNodeFinder.cpp:

(WebCore::InspectorNodeFinder::InspectorNodeFinder):
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
(WebCore::InspectorNodeFinder::checkEquals): Added.
(WebCore::InspectorNodeFinder::checkContains): Added.
(WebCore::InspectorNodeFinder::checkStartsWith): Added.
(WebCore::InspectorNodeFinder::checkEndsWith): Added.
(WebCore::InspectorNodeFinder::matchesAttribute):
(WebCore::InspectorNodeFinder::matchesElement):
(WebCore::InspectorNodeFinder::searchUsingXPath):
(WebCore::InspectorNodeFinder::searchUsingCSSSelectors):

Source/WebInspectorUI:

  • UserInterface/Views/SearchSidebarPanel.js:

(WI.SearchSidebarPanel.prototype.performSearch):

  • UserInterface/Views/DOMTreeContentView.js:

(WI.DOMTreeContentView.prototype.performSearch.contextNodesReady):

  • UserInterface/Controllers/DOMManager.js:

(WI.DOMManager.prototype.performSearch.callback): Deleted.
(WI.DOMManager.prototype.performSearch): Deleted.
(WI.DOMManager.prototype.searchResult.mycallback): Deleted.
(WI.DOMManager.prototype.searchResult): Deleted.
(WI.DOMManager.prototype.cancelSearch): Deleted.
Drive-by: remove unused code.

LayoutTests:

  • inspector/dom/dom-search-caseSensitive.html: Copied from LayoutTests/inspector/dom/dom-search.html.
  • inspector/dom/dom-search-caseSensitive-expected.txt: Copied from LayoutTests/inspector/dom/dom-search-expected.txt.
  • inspector/dom/dom-search-expected.txt:
  • inspector/dom/resources/dom-search-queries.js:

(TestPage.registerInitializer):

Location:
trunk
Files:
1 added
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243201 r243207  
     12019-03-20  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Search: allow DOM searches to be case sensitive
     4        https://bugs.webkit.org/show_bug.cgi?id=194673
     5        <rdar://problem/48087577>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * inspector/dom/dom-search-caseSensitive.html: Copied from LayoutTests/inspector/dom/dom-search.html.
     10        * inspector/dom/dom-search-caseSensitive-expected.txt: Copied from LayoutTests/inspector/dom/dom-search-expected.txt.
     11        * inspector/dom/dom-search-expected.txt:
     12        * inspector/dom/resources/dom-search-queries.js:
     13        (TestPage.registerInitializer):
     14
    1152019-03-20  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/LayoutTests/inspector/dom/dom-search-caseSensitive-expected.txt

    r243206 r243207  
    77body.inside-iframe
    88=== Query: "<body" ===
     9Count: 0
     10=== Query: "body>" ===
     11Count: 0
     12=== Query: "<body>" ===
     13Count: 0
     14=== Query: "bOdY" ===
    915Count: 2
    1016body.main-frame
    1117body.inside-iframe
    12 === Query: "body>" ===
     18=== Query: "<bOdY" ===
     19Count: 0
     20=== Query: "bOdY>" ===
     21Count: 0
     22=== Query: "<bOdY>" ===
     23Count: 0
     24=== Query: "BODY" ===
    1325Count: 2
    1426body.main-frame
    1527body.inside-iframe
    16 === Query: "<body>" ===
     28=== Query: "<BODY" ===
     29Count: 2
     30body.main-frame
     31body.inside-iframe
     32=== Query: "BODY>" ===
    1733Count: 2
    1834body.main-frame
     
    2541Count: 1
    2642body.main-frame
     43=== Query: "oNLoAd" ===
     44Count: 0
    2745=== Query: "ONLOAD" ===
    28 Count: 1
    29 body.main-frame
     46Count: 0
    3047=== Query: "runTest()" ===
    3148Count: 1
     
    3451Count: 1
    3552body.main-frame
     53=== Query: "runTest()\"" ===
     54Count: 1
     55body.main-frame
    3656=== Query: "\"runTest()\"" ===
    3757Count: 1
    3858body.main-frame
    39 === Query: "runTest()\"" ===
    40 Count: 1
    41 body.main-frame
     59=== Query: "runtest()" ===
     60Count: 0
     61=== Query: "\"runtest()" ===
     62Count: 0
     63=== Query: "runtest()\"" ===
     64Count: 0
     65=== Query: "\"runtest()\"" ===
     66Count: 0
     67=== Query: "rUnTeSt()" ===
     68Count: 0
     69=== Query: "\"rUnTeSt()" ===
     70Count: 0
     71=== Query: "rUnTeSt()\"" ===
     72Count: 0
     73=== Query: "\"rUnTeSt()\"" ===
     74Count: 0
    4275=== Query: "RUNTEST()" ===
    43 Count: 1
    44 body.main-frame
    45 === Query: "runtest()" ===
    46 Count: 1
    47 body.main-frame
     76Count: 0
     77=== Query: "\"RUNTEST()" ===
     78Count: 0
     79=== Query: "RUNTEST()\"" ===
     80Count: 0
     81=== Query: "\"RUNTEST()\"" ===
     82Count: 0
    4883=== Query: ".body-inside-iframe" ===
    4984Count: 0
  • trunk/LayoutTests/inspector/dom/dom-search-expected.txt

    r188598 r243207  
    1818body.main-frame
    1919body.inside-iframe
     20=== Query: "bOdY" ===
     21Count: 2
     22body.main-frame
     23body.inside-iframe
     24=== Query: "<bOdY" ===
     25Count: 2
     26body.main-frame
     27body.inside-iframe
     28=== Query: "bOdY>" ===
     29Count: 2
     30body.main-frame
     31body.inside-iframe
     32=== Query: "<bOdY>" ===
     33Count: 2
     34body.main-frame
     35body.inside-iframe
     36=== Query: "BODY" ===
     37Count: 2
     38body.main-frame
     39body.inside-iframe
     40=== Query: "<BODY" ===
     41Count: 2
     42body.main-frame
     43body.inside-iframe
     44=== Query: "BODY>" ===
     45Count: 2
     46body.main-frame
     47body.inside-iframe
    2048=== Query: "<BODY>" ===
    2149Count: 2
     
    2351body.inside-iframe
    2452=== Query: "onload" ===
     53Count: 1
     54body.main-frame
     55=== Query: "oNLoAd" ===
    2556Count: 1
    2657body.main-frame
     
    3465Count: 1
    3566body.main-frame
     67=== Query: "runTest()\"" ===
     68Count: 1
     69body.main-frame
    3670=== Query: "\"runTest()\"" ===
    3771Count: 1
    3872body.main-frame
    39 === Query: "runTest()\"" ===
     73=== Query: "runtest()" ===
     74Count: 1
     75body.main-frame
     76=== Query: "\"runtest()" ===
     77Count: 1
     78body.main-frame
     79=== Query: "runtest()\"" ===
     80Count: 1
     81body.main-frame
     82=== Query: "\"runtest()\"" ===
     83Count: 1
     84body.main-frame
     85=== Query: "rUnTeSt()" ===
     86Count: 1
     87body.main-frame
     88=== Query: "\"rUnTeSt()" ===
     89Count: 1
     90body.main-frame
     91=== Query: "rUnTeSt()\"" ===
     92Count: 1
     93body.main-frame
     94=== Query: "\"rUnTeSt()\"" ===
    4095Count: 1
    4196body.main-frame
     
    4398Count: 1
    4499body.main-frame
    45 === Query: "runtest()" ===
     100=== Query: "\"RUNTEST()" ===
     101Count: 1
     102body.main-frame
     103=== Query: "RUNTEST()\"" ===
     104Count: 1
     105body.main-frame
     106=== Query: "\"RUNTEST()\"" ===
    46107Count: 1
    47108body.main-frame
  • trunk/LayoutTests/inspector/dom/resources/dom-search-queries.js

    r188639 r243207  
    44
    55window.domSearchQueries = [
     6    // Tag names
     7
    68    "body",
    79    "<body",
    810    "body>",
    911    "<body>",
     12
     13    "bOdY",
     14    "<bOdY",
     15    "bOdY>",
     16    "<bOdY>",
     17
     18    "BODY",
     19    "<BODY",
     20    "BODY>",
    1021    "<BODY>",
    1122
    1223    // Attribute names
     24
    1325    "onload",
     26    "oNLoAd",
    1427    "ONLOAD",
    1528
    1629    // Attribute values
     30
    1731    "runTest()",
    1832    "\"runTest()",
     33    "runTest()\"",
    1934    "\"runTest()\"",
    20     "runTest()\"",
     35
     36    "runtest()",
     37    "\"runtest()",
     38    "runtest()\"",
     39    "\"runtest()\"",
     40
     41    "rUnTeSt()",
     42    "\"rUnTeSt()",
     43    "rUnTeSt()\"",
     44    "\"rUnTeSt()\"",
     45
    2146    "RUNTEST()",
    22     "runtest()",
     47    "\"RUNTEST()",
     48    "RUNTEST()\"",
     49    "\"RUNTEST()\"",
    2350
    2451    // CSS selectors
     52
    2553    ".body-inside-iframe",
    2654    "*",
     
    2856
    2957    // XPath query
     58
    3059    "/html/body",
    3160    "/html/body/@onload",
  • trunk/Source/JavaScriptCore/ChangeLog

    r243206 r243207  
     12019-03-20  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Search: allow DOM searches to be case sensitive
     4        https://bugs.webkit.org/show_bug.cgi?id=194673
     5        <rdar://problem/48087577>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        Since `DOM.performSearch` also searches by selector and XPath, some results may appear
     10        as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
     11        as although the literal node name ("BODY") didn't match, it did match via selector/XPath.
     12
     13        * inspector/protocol/DOM.json:
     14        Allow `DOM.performSearch` to be case sensitive.
     15
    1162019-03-20  Saam Barati  <sbarati@apple.com>
    217
  • trunk/Source/JavaScriptCore/inspector/protocol/DOM.json

    r242386 r243207  
    360360            "parameters": [
    361361                { "name": "query", "type": "string", "description": "Plain text or query selector or XPath search query." },
    362                 { "name": "nodeIds", "type": "array", "items": { "$ref": "NodeId" }, "optional": true, "description": "Ids of nodes to use as starting points for the search." }
     362                { "name": "nodeIds", "type": "array", "items": { "$ref": "NodeId" }, "optional": true, "description": "Ids of nodes to use as starting points for the search." },
     363                { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." }
    363364            ],
    364365            "returns": [
  • trunk/Source/WebCore/ChangeLog

    r243204 r243207  
     12019-03-20  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Search: allow DOM searches to be case sensitive
     4        https://bugs.webkit.org/show_bug.cgi?id=194673
     5        <rdar://problem/48087577>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        Tests: inspector/dom/dom-search.html
     10               inspector/dom/dom-search-caseSensitive.html
     11
     12        Since `DOM.performSearch` also searches by selector and XPath, some results may appear
     13        as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
     14        as although the literal node name ("BODY") didn't match, it did match via selector/XPath.
     15
     16        * inspector/agents/InspectorDOMAgent.h:
     17        * inspector/agents/InspectorDOMAgent.cpp:
     18        (WebCore::InspectorDOMAgent::performSearch):
     19
     20        * inspector/InspectorNodeFinder.h:
     21        * inspector/InspectorNodeFinder.cpp:
     22        (WebCore::InspectorNodeFinder::InspectorNodeFinder):
     23        (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
     24        (WebCore::InspectorNodeFinder::checkEquals): Added.
     25        (WebCore::InspectorNodeFinder::checkContains): Added.
     26        (WebCore::InspectorNodeFinder::checkStartsWith): Added.
     27        (WebCore::InspectorNodeFinder::checkEndsWith): Added.
     28        (WebCore::InspectorNodeFinder::matchesAttribute):
     29        (WebCore::InspectorNodeFinder::matchesElement):
     30        (WebCore::InspectorNodeFinder::searchUsingXPath):
     31        (WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
     32
    1332019-03-20  Michael Catanzaro  <mcatanzaro@igalia.com>
    234
  • trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp

    r225117 r243207  
    5454}
    5555
    56 InspectorNodeFinder::InspectorNodeFinder(const String& whitespaceTrimmedQuery)
    57     : m_whitespaceTrimmedQuery(whitespaceTrimmedQuery)
    58 {
    59     m_tagNameQuery = stripCharacters(whitespaceTrimmedQuery, '<', '>', m_startTagFound, m_endTagFound);
     56InspectorNodeFinder::InspectorNodeFinder(const String& query, bool caseSensitive)
     57    : m_query(query)
     58    , m_caseSensitive(caseSensitive)
     59{
     60    m_tagNameQuery = stripCharacters(query, '<', '>', m_startTagFound, m_endTagFound);
    6061
    6162    bool startQuoteFound, endQuoteFound;
    62     m_attributeQuery = stripCharacters(whitespaceTrimmedQuery, '"', '"', startQuoteFound, endQuoteFound);
     63    m_attributeQuery = stripCharacters(query, '"', '"', startQuoteFound, endQuoteFound);
    6364    m_exactAttributeMatch = startQuoteFound && endQuoteFound;
    6465}
     
    8485        case Node::COMMENT_NODE:
    8586        case Node::CDATA_SECTION_NODE:
    86             if (node->nodeValue().containsIgnoringASCIICase(m_whitespaceTrimmedQuery))
     87            if (checkContains(node->nodeValue(), m_query))
    8788                m_results.add(node);
    8889            break;
     
    99100}
    100101
     102bool InspectorNodeFinder::checkEquals(const String& a, const String& b)
     103{
     104    if (m_caseSensitive)
     105        return a == b;
     106    return equalIgnoringASCIICase(a, b);
     107}
     108
     109bool InspectorNodeFinder::checkContains(const String& a, const String& b)
     110{
     111    if (m_caseSensitive)
     112        return a.contains(b);
     113    return a.containsIgnoringASCIICase(b);
     114}
     115
     116bool InspectorNodeFinder::checkStartsWith(const String& a, const String& b)
     117{
     118    if (m_caseSensitive)
     119        return a.startsWith(b);
     120    return a.startsWithIgnoringASCIICase(b);
     121}
     122
     123bool InspectorNodeFinder::checkEndsWith(const String& a, const String& b)
     124{
     125    if (m_caseSensitive)
     126        return a.endsWith(b);
     127    return a.endsWithIgnoringASCIICase(b);
     128}
     129
    101130bool InspectorNodeFinder::matchesAttribute(const Attribute& attribute)
    102131{
    103     if (attribute.localName().string().containsIgnoringASCIICase(m_whitespaceTrimmedQuery))
     132    if (checkContains(attribute.localName().string(), m_query))
    104133        return true;
    105     return m_exactAttributeMatch ? attribute.value() == m_attributeQuery : attribute.value().string().containsIgnoringASCIICase(m_attributeQuery);
     134
     135    auto value = attribute.value().string();
     136    return m_exactAttributeMatch ? checkEquals(value, m_attributeQuery) : checkContains(value, m_attributeQuery);
    106137}
    107138
     
    109140{
    110141    String nodeName = element.nodeName();
    111     if ((!m_startTagFound && !m_endTagFound && nodeName.containsIgnoringASCIICase(m_tagNameQuery))
    112         || (m_startTagFound && m_endTagFound && equalIgnoringASCIICase(nodeName, m_tagNameQuery))
    113         || (m_startTagFound && !m_endTagFound && nodeName.startsWithIgnoringASCIICase(m_tagNameQuery))
    114         || (!m_startTagFound && m_endTagFound && nodeName.endsWithIgnoringASCIICase(m_tagNameQuery)))
     142    if ((!m_startTagFound && !m_endTagFound && checkContains(nodeName, m_tagNameQuery))
     143        || (m_startTagFound && m_endTagFound && checkEquals(nodeName, m_tagNameQuery))
     144        || (m_startTagFound && !m_endTagFound && checkStartsWith(nodeName, m_tagNameQuery))
     145        || (!m_startTagFound && m_endTagFound && checkEndsWith(nodeName, m_tagNameQuery)))
    115146        return true;
    116147
     
    128159void InspectorNodeFinder::searchUsingXPath(Node& parentNode)
    129160{
    130     auto evaluateResult = parentNode.document().evaluate(m_whitespaceTrimmedQuery, &parentNode, nullptr, XPathResult::ORDERED_NODE_SNAPSHOT_TYPE, nullptr);
     161    auto evaluateResult = parentNode.document().evaluate(m_query, &parentNode, nullptr, XPathResult::ORDERED_NODE_SNAPSHOT_TYPE, nullptr);
    131162    if (evaluateResult.hasException())
    132163        return;
     
    158189        return;
    159190
    160     auto queryResult = downcast<ContainerNode>(parentNode).querySelectorAll(m_whitespaceTrimmedQuery);
     191    auto queryResult = downcast<ContainerNode>(parentNode).querySelectorAll(m_query);
    161192    if (queryResult.hasException())
    162193        return;
  • trunk/Source/WebCore/inspector/InspectorNodeFinder.h

    r208145 r243207  
    4242class InspectorNodeFinder {
    4343public:
    44     InspectorNodeFinder(const String& whitespaceTrimmedQuery);
     44    InspectorNodeFinder(const String& query, bool caseSensitive);
    4545    void performSearch(Node*);
    4646    const ListHashSet<Node*>& results() const { return m_results; }
    4747
    4848private:
     49    bool checkEquals(const String&, const String&);
     50    bool checkContains(const String&, const String&);
     51    bool checkStartsWith(const String&, const String&);
     52    bool checkEndsWith(const String&, const String&);
     53
    4954    bool matchesAttribute(const Attribute&);
    5055    bool matchesElement(const Element&);
     
    5459    void searchUsingCSSSelectors(Node&);
    5560
     61    String m_query;
     62    String m_tagNameQuery;
     63    String m_attributeQuery;
     64    bool m_caseSensitive;
     65
     66    ListHashSet<Node*> m_results;
    5667    bool m_startTagFound;
    5768    bool m_endTagFound;
    5869    bool m_exactAttributeMatch;
    59 
    60     String m_whitespaceTrimmedQuery;
    61     String m_tagNameQuery;
    62     String m_attributeQuery;
    63 
    64     ListHashSet<Node*> m_results;
    6570};
    6671
  • trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp

    r243163 r243207  
    10061006}
    10071007
    1008 void InspectorDOMAgent::performSearch(ErrorString& errorString, const String& whitespaceTrimmedQuery, const JSON::Array* nodeIds, String* searchId, int* resultCount)
     1008void InspectorDOMAgent::performSearch(ErrorString& errorString, const String& query, const JSON::Array* nodeIds, const bool* caseSensitive, String* searchId, int* resultCount)
    10091009{
    10101010    // FIXME: Search works with node granularity - number of matches within node is not calculated.
    1011     InspectorNodeFinder finder(whitespaceTrimmedQuery);
     1011    InspectorNodeFinder finder(query, caseSensitive && *caseSensitive);
    10121012
    10131013    if (nodeIds) {
  • trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h

    r242386 r243207  
    135135    void removeBreakpointForEventListener(ErrorString&, int eventListenerId) override;
    136136    void getAccessibilityPropertiesForNode(ErrorString&, int nodeId, RefPtr<Inspector::Protocol::DOM::AccessibilityProperties>& axProperties) override;
    137     void performSearch(ErrorString&, const String& whitespaceTrimmedQuery, const JSON::Array* nodeIds, String* searchId, int* resultCount) override;
     137    void performSearch(ErrorString&, const String& query, const JSON::Array* nodeIds, const bool* caseSensitive, String* searchId, int* resultCount) override;
    138138    void getSearchResults(ErrorString&, const String& searchId, int fromIndex, int toIndex, RefPtr<JSON::ArrayOf<int>>&) override;
    139139    void discardSearchResults(ErrorString&, const String& searchId) override;
  • trunk/Source/WebInspectorUI/ChangeLog

    r243180 r243207  
     12019-03-20  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Search: allow DOM searches to be case sensitive
     4        https://bugs.webkit.org/show_bug.cgi?id=194673
     5        <rdar://problem/48087577>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * UserInterface/Views/SearchSidebarPanel.js:
     10        (WI.SearchSidebarPanel.prototype.performSearch):
     11
     12        * UserInterface/Views/DOMTreeContentView.js:
     13        (WI.DOMTreeContentView.prototype.performSearch.contextNodesReady):
     14
     15        * UserInterface/Controllers/DOMManager.js:
     16        (WI.DOMManager.prototype.performSearch.callback): Deleted.
     17        (WI.DOMManager.prototype.performSearch): Deleted.
     18        (WI.DOMManager.prototype.searchResult.mycallback): Deleted.
     19        (WI.DOMManager.prototype.searchResult): Deleted.
     20        (WI.DOMManager.prototype.cancelSearch): Deleted.
     21        Drive-by: remove unused code.
     22
    1232019-03-19  Devin Rousso  <drousso@apple.com>
    224
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js

    r241874 r243207  
    439439    }
    440440
    441     performSearch(query, searchCallback)
    442     {
    443         this.cancelSearch();
    444 
    445         function callback(error, searchId, resultsCount)
    446         {
    447             this._searchId = searchId;
    448             searchCallback(resultsCount);
    449         }
    450         DOMAgent.performSearch(query, callback.bind(this));
    451     }
    452 
    453     searchResult(index, callback)
    454     {
    455         function mycallback(error, nodeIds)
    456         {
    457             if (error) {
    458                 console.error(error);
    459                 callback(null);
    460                 return;
    461             }
    462             if (nodeIds.length !== 1)
    463                 return;
    464 
    465             callback(this._idToDOMNode[nodeIds[0]]);
    466         }
    467 
    468         if (this._searchId)
    469             DOMAgent.getSearchResults(this._searchId, index, index + 1, mycallback.bind(this));
    470         else
    471             callback(null);
    472     }
    473 
    474     cancelSearch()
    475     {
    476         if (this._searchId) {
    477             DOMAgent.discardSearchResults(this._searchId);
    478             this._searchId = undefined;
    479         }
    480     }
    481 
    482441    querySelector(nodeOrNodeId, selector, callback)
    483442    {
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js

    r242811 r243207  
    303303        function contextNodesReady(nodeIds)
    304304        {
    305             DOMAgent.performSearch(query, nodeIds, searchResultsReady.bind(this));
     305            if (this._searchQuery !== query)
     306                return;
     307
     308            let commandArguments = {
     309                query: this._searchQuery,
     310                nodeIds,
     311                caseSensitive: WI.SearchUtilities.defaultSettings.caseSensitive.value,
     312            };
     313            DOMAgent.performSearch.invoke(commandArguments, searchResultsReady.bind(this));
    306314        }
    307315
  • trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js

    r242105 r243207  
    305305            }
    306306
    307             countPromise(DOMAgent.performSearch(searchQuery), domCallback);
     307            let commandArguments = {
     308                query: searchQuery,
     309                caseSensitive: isCaseSensitive,
     310            };
     311            countPromise(DOMAgent.performSearch.invoke(commandArguments), domCallback);
    308312        }
    309313
Note: See TracChangeset for help on using the changeset viewer.