Open Bug 1258570 Opened 8 years ago Updated 9 months ago

"Search HTML" first finds text in ::after pseudoelement, and only after that finds text in child nodes

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(firefox48 affected)

Tracking Status
firefox48 --- affected

People

(Reporter: arni2033, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [btpp-backlog])

>>>   My Info:   Win7_64, Nightly 48, 32bit, ID 20160320030409
STR:
1. Open the following "data:" url or click URL in the form above
>   data:text/html,<div class="A"><script>/*span*/ var S="";for(i=0;i<90;i++)S+="<div></div>";document.write(S);</script></div><style>.A::after{content:"_span_"}
2. Open inspector, type "span" in the field "Search HTML"
3. Press Enter
4. Press Enter

AR:  
 After Step 3 pseudoelement ::after is selected in markup
 After Step 4 <script> element is selected in markup

ER:  (vice versa)
 After Step 3 <script> element should be selected
 After Step 4 pseudoelement ::after should be selected

Note:
 The same result when I search for string "after"
Thanks for filing.
This is a bug in the way we sort search results on the backend:

https://dxr.mozilla.org/mozilla-central/source/devtools/server/actors/utils/walker-search.js#264

Here, we compare node positions in the DOM using compareDocumentPosition (see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition).
It looks like when we compare the position of the <script> element and the ::after pseudo-element, compareDocumentPosition tells us that the ::after pseudo-element appears first.
Priority: -- → P3
Whiteboard: [btpp-backlog]
Not reproducible on the last build before bug 835896. Reproducible on the 1st build after bug 835896.
First bad   437545b472e74a71ca112f4b4a300ae0a646288b (fx-team)
Last good   f00a24682d57e48a287e11bcfc72e562929fd007 (mozilla-inbound)
Also good   43f23a377c8510f29aa9546453b3b3bcb7810b07 (fx-team)
> regression-range 1 (mozilla-inbound)  https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=f00a24682d57e48a287e11bcfc72e562929fd007&tochange=961911623a6f2ec1d036c7b12a5117ebbeff45d8
> regression-range 2 (fx-team)          https://hg.mozilla.org/integration/fx-team/pushloghtml?fromchange=43f23a377c8510f29aa9546453b3b3bcb7810b07&tochange=437545b472e74a71ca112f4b4a300ae0a646288b
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.