Closed Bug 1418560 Opened 3 years ago Closed 3 years ago

Properly return null from GetFlattenedTreeParent if the node is XBL fallback content.

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file)

Otherwise we may get confused in layout, thinking that the node is part of the flattened tree when it is not.
Comment on attachment 8929684 [details]
Bug 1418560: Properly return null from GetFlattenedTreeParent if the node is XBL fallback content and the binding is active.

https://reviewboard.mozilla.org/r/200974/#review206296

Would be nice to have a test for this, if possible.

Re GetXBLBinding, agreed; it might be worth trying to devirtualize that.

::: dom/base/nsIContentInlines.h:85
(Diff revision 2)
> -  // Check if the node is an explicit child of an element with a shadow root,
> -  // re-bound to an insertion point.
> +  // Check if the node is an explicit child of an element with a shadow root or
> +  // an element with an XBL binding, re-bound to an insertion point.

In the comment can you mention that the check for parent->GetXBLBinding() is specifically for the case of children that are not distributed to insertion points?

::: layout/base/nsCSSFrameConstructor.cpp:7494
(Diff revision 2)
> +  for (nsIContent* node = iter.GetNextChild(); node; node = iter.GetNextChild())
> +    if (node == aChild)
> +      return true;

Nit: braces around statements.
Attachment #8929684 - Flags: review?(cam) → review+
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/ff9caa303cc1
Properly return null from GetFlattenedTreeParent if the node is XBL fallback content and the binding is active. r=heycam
https://hg.mozilla.org/integration/autoland/rev/eb531fabadea
Disable test_content_element.html. r=smaug
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/6fba2818b1ee
Don't build IsFlattenedTreeChild in release builds. r=bustage
Blocks: 1419330
Depends on: 1419334
You need to log in before you can comment on or make changes to this bug.