Closed Bug 1076784 Opened 10 years ago Closed 10 years ago

[shadow-dom] Removing and then appending a shadow-host results in no shadow-dom being rendered

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: wilsonpage, Assigned: wchen)

References

Details

Attachments

(1 file)

I haven't found a workaround/hack for this one yet, so this could endanger Gaia progress. Perhaps someone can suggest something?
Is this perhaps a regression? And which branch are you testing, Nightlies?
(In reply to Olli Pettay [:smaug] from comment #2)
> Is this perhaps a regression? And which branch are you testing, Nightlies?

Yes this is current nightly. I don't believe it is a regression, I just don't think we've tested this specific use-case before.
In a current nightly, I see the text not reappear at all when I click "Append".

In any case, isn't this a duplicate of bug 1025724?
Though I thought bug 1062578 would have fixed that, since it claims to be fixed...
(In reply to Boris Zbarsky [:bz] from comment #4)
> In a current nightly, I see the text not reappear at all when I click
> "Append".
> 
> In any case, isn't this a duplicate of bug 1025724?

Correct, this appears to be mroe than just missing styling; the entire shadow tree fails to be rendered once the shadow-host is re-inserted.
Summary: [shadow-dom] Removing and then appending a shadow-host results in no shadow-dom styling → [shadow-dom] Removing and then appending a shadow-host results in no shadow-dom being rendered
I'm looking into this. It looks like something is removing the binding when the shadow host is removed from the tree.
Assignee: nobody → wchen
Attachment #8499270 - Flags: review?(bugs)
Comment on attachment 8499270 [details] [diff] [review]
Don't remove binding when shadow root host is removed from tree

But what if we have xbl binding and shadowroot?
Like, <input> element.
Currently, when you create a shadow DOM on something that has a xbl binding, the web components binding replaces the XBL binding and we would keep the shadow DOM binding if it's removed from the tree.
Hmm, what happens to the input element's handlers then?
Comment on attachment 8499270 [details] [diff] [review]
Don't remove binding when shadow root host is removed from tree

We'll need to sort out that paltform binding thing, but I think this is fine for now.
Attachment #8499270 - Flags: review?(bugs) → review+
I think if we have a shadow root and XBL binding both on the same node, we should just leave the XBL binding and not use the shadow DOM binding, at least until we figure out how to make these two work well together simultaneously. A lot the elements with XBL bindings have special behaviour and frames that ignore children, so creating a shadow root on them might not make sense anyways and it's probably better to leave the XBL binding on it, but this can happen in another bug.

https://hg.mozilla.org/integration/mozilla-inbound/rev/099906f74b62
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/099906f74b62
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
See Also: → 1217531
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.