Inspector "Search HTML" finds additional invisible elements if a pseudoelement contains the user's text (with showAllAnonymousContent enabled)




Developer Tools: Inspector
2 years ago
2 years ago


(Reporter: arni2033, Unassigned)



Firefox Tracking Flags

(firefox48 affected)


(Whiteboard: [btpp-backlog], URL)



2 years ago
>>>   My Info:   Win7_64, Nightly 48, 32bit, ID 20160320030409
1. Open about:config, set "devtools.inspector.showAllAnonymousContent" to true
2. Open the following link in a new tab:
>   data:text/html,<script>var S="";for(i=0;i<90;i++)S+="<div></div>";document.write(S);</script><div class="A"></div><style>.A::after{content:"_span_"}
3. Open inspector, type "span" in the field "Search HTML"
4. Press Enter
5. Press Enter

 After Step 4 pseudoelement ::after is selected in markup. The counter shows "1 of 3" matches
 After Step 5 No elements are selected. The counter shows "2 of 3" matches. The markup is scrolled
              to the up a bit (I saw the same in bug 1184525, bug 1228675. Is there a way
              to disable that once and for all in cases when "Search HTML" can't select an element?)

 Anything better, really. I have 3 options (X, Y, Z) in mind, but I don't know the state of
 development in this direction, so they are useless.
 X) The same behavior as with showAllAnonymousContent disabled
 Y) Show pseudoelement's content in markup (at the right of the pseudoelement) if
    showAllAnonymousContent is enabled. In this case the counter should still show only 2 matches
 Z) Show pseudoelement's content as child node of pseudoelement in markup and select it in Step 5
With devtools.inspector.showAllAnonymousContent set to true, it looks like the inIDeepTreeWalker that we use in the walker backend ( causes the search tool to find 2 search matches in the test page provided:

First, the ::after pseudo-element
And second, a text node inside this pseudo-element.
Priority: -- → P3
Whiteboard: [btpp-backlog]

Comment 2

2 years ago
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)
> regression-range 2 (fx-team)
You need to log in before you can comment on or make changes to this bug.