AllChildrenIterator misses native anonymous content from the root scroll frame

RESOLVED FIXED in Firefox 51



3 years ago
13 days ago


(Reporter: bobbyholley, Assigned: bobbyholley)



Firefox Tracking Flags

(firefox51 fixed)



(2 attachments)

It detects native anonymous children by QueryFrame-ing the primary frame to nsINativeAnonymousContentCreator. This generally works, but the root scroll frame is not the primary frame of the root element, and so we miss this case. This is problematic for stylo, since we restyle using the DOM rather than the frame tree, so we need our DOM iterator to handle corner cases like this.

I have a patch which I'll run through try.
Comment on attachment 8784472 [details] [diff] [review]
Handle the root scroll frame in AllChildrenIterator. v1

Review of attachment 8784472 [details] [diff] [review]:

r=me with that fixed.

::: dom/base/ChildIterator.cpp
@@ +423,5 @@
> +        nsIPresShell* presShell = mOriginalContent->OwnerDoc()->GetShell();
> +        nsIFrame* scrollFrame = presShell ? presShell->GetRootScrollFrame() : nullptr;
> +        if (scrollFrame) {
> +          AppendAnonymousChildrenFromFrame(scrollFrame);
> +        }

Don't we need to do this all in GetPreviousChild too?
Attachment #8784472 - Flags: review?(cam) → review+
boxes. r=heycam

The layout inspector ends up traversing into the root scroll frame in the next patch. If we don't
fix this, we erroneously enter this code here:

in this test:

Attachment #8785115 - Flags: review+

Comment 6

3 years ago
Pushed by
Prevent HasPseudoElementData from erroneously tracking anonymous boxes. r=heycam
Handle the root scroll frame in AllChildrenIterator. r=heycam
FWIW I just pushed a try run to check that we never have non-pseudo style inheriting from anon box style, except for the viewport scroll case, and I didn't get any failures.
Thanks! When I get around to it, I'll see if I can push a patch to try to make the root scroll NAC inherit null instead of the anon boxes.

Comment 9

3 years ago
Last Resolved: 3 years ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.