Closed Bug 1269034 Opened 4 years ago Closed 4 years ago

Markup view "body #" search show suggestion "body #"


(DevTools :: Inspector, defect, P3)

47 Branch


(firefox49 fixed)

Firefox 49
Tracking Status
firefox49 --- fixed


(Reporter: nchevobbe, Assigned: nchevobbe)



(1 file)

1. Open `data:text/html;charset=utf-8,%0A<body>%0A<div id%3D"test">test<%2Fdiv>%0A<div>test<%2Fdiv>%0A<%2Fbody>%0A`
2. Open inspector
3. In the search field, type `body #`

Expected Result:
One suggestion ("body #test" is shown in the popup)

Actual Result:
There are two suggestion in the popup, "body #test", which is right, "body #", which seems wrong (pressing enter outputs "no results")

The problem comes from actor's `getSuggestionsForQuery` function ( The sent `query` parameter is "body *", and thus `_multiFrameQuerySelectorAll`returns the 2 div child nodes, and then put their id in a set. But because only one of the two divs got an id, we end up having the "body #" suggestion.
A simple solution would be to test if the id of the node is not undefined before adding it to the result ( ).

However there is one test that rely on such suggestion ( ), so I'm wondering if this is an expected behavior.
Assignee: nobody → chevobbe.nicolas
Has STR: --- → yes
Priority: -- → P3
Make sure that result node id is not empty before appending it to the results

Review commit:
See other reviews:
Attachment #8747333 - Flags: review?(bgrinstead)
Comment on attachment 8747333 [details]
MozReview Request: Bug 1269034 - Fix getSuggestionForQuery in inspector actor for id queries. r=bgrins

Works for me with a green try push, thanks
Attachment #8747333 - Flags: review?(bgrinstead) → review+
TRY is mostly green ( ), failed jobs have been successfully re-triggered.
Keywords: checkin-needed
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
I have successfully reproduced this bug with Nightly 49.0a1 (2016-04-29) on windows 7 , 64 bit!

This bug's fix is verified on latest Developer Edition, Nightly.
Build  ID     20160708004052
User   Agent  Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0

Build  ID     20160714030208
User  Agent   Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0

But I could not find the fix in beta version (48)
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.