Inspector search can't find css selector with hyphen
Categories
(DevTools :: Inspector, defect)
Tracking
(firefox-esr128 unaffected, firefox-esr140 fixed, firefox141 wontfix, firefox142 fixed, firefox143 fixed)
| Tracking | Status | |
|---|---|---|
| firefox-esr128 | --- | unaffected |
| firefox-esr140 | --- | fixed |
| firefox141 | --- | wontfix |
| firefox142 | --- | fixed |
| firefox143 | --- | fixed |
People
(Reporter: jdescottes, Assigned: nchevobbe)
References
(Blocks 1 open bug, Regression, )
Details
(Keywords: regression)
Attachments
(3 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
STRs:
- open data:text/html,<div class="a b-c">
- open inspector
- try to search
div.a-> OK,.b-c-> OK,div.b-c-> KO
| Reporter | ||
Comment 1•7 months ago
|
||
| Reporter | ||
Comment 2•7 months ago
|
||
Note that the popup suggests div.b-c in the autocomplete.
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 3•7 months ago
|
||
That's because of https://searchfox.org/mozilla-central/rev/81221d27112f12a67cb86287bf2b3cd9f19373af/devtools/server/actors/utils/walker-search.js#265,270-272,275-282
_searchSelectors(query, options, results) {
...
// If the query is just one "word", no need to search because _searchIndex
// will lead the same results since it has access to tagnames anyway
if (
...
// custom element names
InspectorUtils.isCustomElementName(
query,
this.walker.targetActor.window.document.documentElement.namespaceURI
)
) {
return;
}
InspectorUtils.isCustomElementName("div.b-c") returns true (so does InspectorUtils.isCustomElementName("div#b-c"))
| Assignee | ||
Comment 4•7 months ago
|
||
We used to check if the passed query looked like a tag name so we could
bail out early, as we'd get those results from _searchIndex.
But InspectorUtils.isCustomElementName does match some legitimate
selectors, like div.a-b.
Let's remove the check on custom element and trigger the search in such case.
Updated•7 months ago
|
Comment 5•7 months ago
|
||
Set release status flags based on info from the regressing bug 1871881
Updated•7 months ago
|
Comment 7•7 months ago
|
||
| bugherder | ||
| Assignee | ||
Comment 8•7 months ago
|
||
We used to check if the passed query looked like a tag name so we could
bail out early, as we'd get those results from _searchIndex.
But InspectorUtils.isCustomElementName does match some legitimate
selectors, like div.a-b.
Let's remove the check on custom element and trigger the search in such case.
Original Revision: https://phabricator.services.mozilla.com/D259783
Updated•7 months ago
|
Comment 9•7 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: Searching for an element in the inspector using a selector might not work
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: -
- Risk associated with taking this patch: low
- Explanation of risk level: devtools only patch, removing a simple guard, covered by mochitest
- String changes made/needed: -
- Is Android affected?: no
Updated•7 months ago
|
Updated•7 months ago
|
Comment 10•7 months ago
|
||
| uplift | ||
| Assignee | ||
Comment 11•7 months ago
|
||
We used to check if the passed query looked like a tag name so we could
bail out early, as we'd get those results from _searchIndex.
But InspectorUtils.isCustomElementName does match some legitimate
selectors, like div.a-b.
Let's remove the check on custom element and trigger the search in such case.
Original Revision: https://phabricator.services.mozilla.com/D259783
Updated•7 months ago
|
Comment 12•7 months ago
|
||
firefox-esr140 Uplift Approval Request
- User impact if declined: Searching for an element in the inspector using a selector might not work
- Code covered by automated testing: yes
- Fix verified in Nightly: no
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: -
- Risk associated with taking this patch: low
- Explanation of risk level: devtools only patch, removing a simple guard, covered by mochitest
- String changes made/needed: -
- Is Android affected?: no
Updated•7 months ago
|
Updated•7 months ago
|
Comment 13•7 months ago
|
||
| uplift | ||
Description
•