Bug 194673 - Web Inspector: Search: allow DOM searches to be case sensitive
Summary: Web Inspector: Search: allow DOM searches to be case sensitive
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on: 192527
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-14 14:07 PST by Devin Rousso
Modified: 2019-06-15 18:48 PDT (History)
12 users (show)

See Also:


Attachments
Patch (26.38 KB, patch)
2019-03-12 12:43 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2019-02-14 14:07:51 PST
When searching for "DIV", we're still matching <div>.
Comment 1 Radar WebKit Bug Importer 2019-02-14 14:08:21 PST
<rdar://problem/48087577>
Comment 2 Nikita Vasilyev 2019-02-14 14:19:19 PST
(In reply to Devin Rousso from comment #0)
> When searching for "DIV", we're still matching <div>.

This seems fine to me. What's the real-world use case here?
Comment 3 Devin Rousso 2019-02-14 14:23:28 PST
(In reply to Nikita Vasilyev from comment #2)
> (In reply to Devin Rousso from comment #0)
> > When searching for "DIV", we're still matching <div>.
> 
> This seems fine to me. What's the real-world use case here?
Ok maybe that was a bad example.  If I have

    <div class="CLASS">CONTENT"</div>

and I searched for "class" or "content", it would still match.  We are unable to do any sort of case sensitivity (we convert all queries to lowercase, as well as the text through which we're searching).

We could also _try_ to make regex searching work, but that's much harder to search across nodes (e.g. /><div>(\w+)<\/div/ wouldn't work).  If we limit the regex search to within a specific node (as it does now), then that shouldn't be too hard.
Comment 4 Devin Rousso 2019-03-12 12:43:50 PDT
Created attachment 364427 [details]
Patch
Comment 5 EWS Watchlist 2019-03-12 12:45:35 PDT
This patch modifies the inspector protocol. Please ensure that any frontend changes appropriately use feature checks for new protocol features.
Comment 6 WebKit Commit Bot 2019-03-20 09:21:43 PDT
Comment on attachment 364427 [details]
Patch

Clearing flags on attachment: 364427

Committed r243207: <https://trac.webkit.org/changeset/243207>
Comment 7 WebKit Commit Bot 2019-03-20 09:21:45 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Joseph Pecoraro 2019-03-20 11:35:45 PDT
Comment on attachment 364427 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=364427&action=review

Awesome!

> Source/WebCore/inspector/InspectorNodeFinder.h:67
> +    bool m_caseSensitive;
> +
> +    ListHashSet<Node*> m_results;
>      bool m_startTagFound;

Nit: Maybe group the bools together.

> Source/WebCore/inspector/agents/InspectorDOMAgent.h:137
> -    void performSearch(ErrorString&, const String& whitespaceTrimmedQuery, const JSON::Array* nodeIds, String* searchId, int* resultCount) override;
> +    void performSearch(ErrorString&, const String& query, const JSON::Array* nodeIds, const bool* caseSensitive, String* searchId, int* resultCount) override;

Should notify ITMLKit folks.