Open
Bug 1105027
Opened 10 years ago
Updated 2 years ago
Element.createShadowTree does not update style sheets in the old ShadowRoot
Categories
(Core :: DOM: Core & HTML, defect, P5)
Core
DOM: Core & HTML
Tracking
()
NEW
People
(Reporter: heycam, Unassigned)
Details
Attachments
(1 file)
490 bytes,
text/html
|
Details |
Consider the attached test. It should display "1 0 1", according to bug 1098270 comment 19. I think we try to make the second number "0", by unbinding the contents of a ShadowRoot when we create a new, younger ShadowRoot for the host element, but we don't end up calling UpdateStyleSheet on <style> elements we unbind.
Reporter | ||
Comment 1•10 years ago
|
||
In Element::CreateShadowRoot, we first set the newly ShadowRoot on the host element, and then we call UnbindFromTree on the children of the older ShadowRoot. In HTMLStyleElement::UnbindFromTree, GetComposedDoc() returns null (because the <style> element now indeed isn't in the composed document) and we exit early without calling UpdateStyleSheetInternal. I wonder if we can just remove that check and early exit in HTMLStyleElement::UnbindFromTree.
Reporter | ||
Comment 2•10 years ago
|
||
(In reply to Cameron McCormack (:heycam) from comment #1) > I wonder if we can just remove that check and early exit in > HTMLStyleElement::UnbindFromTree. This plus the changes mentioned in bug 1098270 to use GetComposedDoc() in nsStyleLinkElement::DoUpdateStyleSheet seems to work.
Comment 3•10 years ago
|
||
Yes, the combination of those would make sense to me. But again, it would be good to have a clear idea of what behavior the spec wants here....
Reporter | ||
Comment 4•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=7f8fb00fc9c3 with those two changes.
Reporter | ||
Comment 5•10 years ago
|
||
Raised https://github.com/w3c/web-platform-tests/issues/1415 for the failing WPT.
Comment 6•6 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Assignee | ||
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•