The inspector search tool can be used to do 2 things: search for text in the page, and search for elements that match a given selector. The latter is quite buggy. For simple cases it works well, but when selectors become complex, it doesn't always work well. A few problems I see with the code: - _showPopup in inspector-search.js uses regexp all over the places, this isn't a bug in itself but is error-prone and makes the code harder to read - this code doesn't handle attribute selectors at all div[a], div[a*=b], ... (this is partly fixed with bug 1225514) - part of this code assumes id/class attributes have only letters, while they can contain numbers, underscores and hyphens, and can even start with underscores or hyphens - getSuggestionsForQuery in inspector.js (on the server) does not seem to handle attribute selectors at all either Here are use cases that fail currently: - go to data:text/html,<a class="test" id="id1"> and enter #id1.tes suggestion popup is broken and pressing enter replaces the value with just .test - go to data:text/html,<a class="class1" id="id1"> and enter .class1#id same There might be other
- go to data:text/html,<div></div> and enter body * suggestion popup only contains "body", but selecting this suggestion replaces the field with "div"
Is this a meta-bug? Does it "covers" all such cases as subsets or those reports should be marked as blocking to this one? Also, you haven't mention the issue with adding :not(...) pseudoclass. That is the simpliest workaround I found to actually search_with_СSS_selectors, and it's affected by this bug
(In reply to arni2033 from comment #2) > Is this a meta-bug? Does it "covers" all such cases as subsets or those > reports should be marked as blocking to this one? Also, you haven't mention > the issue with adding :not(...) pseudoclass. That is the simpliest > workaround I found to actually search_with_СSS_selectors, and it's affected > by this bug I filed this a while ago after working a little bit on the search tool, but never really add time to do anything about it. You're right, this should be a meta bug. Feel free to link all the bugs you've filed or seen related to this lately. Thanks.
Сurrently it's unclear whether this is a general defect or each group of selectors is broken in its unique way (what groups exactly?). So I believe it's pointless to have >1 open bugs blocking this. Also, this bug should be marked as "regression" or at least connected to bug 835896 which broke it. (I also think it's good idea to check each bug from this type if it indeed was caused by 835896) Cancel my changes if you disagree.
Whiteboard: All cases of this bug are most likely regressions from 835896
Search doesn't work at all for HTML entities (e.g. ) https://bugzilla.mozilla.org/show_bug.cgi?id=1256756 -> https://bugzilla.mozilla.org/show_bug.cgi?id=967493
Old meta bug with 2 dependencies that have been fixed. Let's close this one now, and file other separate issues when needed.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.