nsIContent::IsInAnonymousSubtree returns true for shadow DOM content

RESOLVED FIXED in Firefox 31

Status

()

defect
RESOLVED FIXED
5 years ago
4 months ago

People

(Reporter: bholley, Assigned: bholley)

Tracking

unspecified
mozilla31
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox31 fixed)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

The current implementation of this method is:

return IsInNativeAnonymousSubtree() || GetBindingParent() != nullptr;

Since shadow DOM nodes return a non-null GetBindingParent(), this returns true for those cases. Talking with wchen, it doesn't sound like it was intentional, and probably isn't something that callers are expecting. Though I am concerned that we're relying on various anonymous content features (like event retargetting) without realizing it.

I'm going to try fixing it - hopefully nothing breaks.
Attachment #8397497 - Flags: review?(mrbkap) → review+
https://hg.mozilla.org/mozilla-central/rev/74a617a50287
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
(In reply to Bobby Holley (:bholley) from comment #0)
> I'm going to try fixing it - hopefully nothing breaks.

What could this break, potentially? Is there anything QA should be on the lookout for?
Flags: needinfo?(bobbyholley)
(In reply to Anthony Hughes, QA Mentor (:ashughes) from comment #4)
> (In reply to Bobby Holley (:bholley) from comment #0)
> > I'm going to try fixing it - hopefully nothing breaks.
> 
> What could this break, potentially? Is there anything QA should be on the
> lookout for?

Possibly stuff related to Web Components. But the breakage I was expecting would have been visible on tinderbox, I think.
Flags: needinfo?(bobbyholley)
Another thing to keep in mind is that web components are pref'ed off and not exposed to the web by default. The only people using it are developers experimenting with the feature.
Thanks Bobby and William. I'm tagging this [qa-] for now. If you need testing around this please don't hesitate to needinfo me.
Whiteboard: [qa-]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.