[ShadowDOM] Changing textContent on 'projected content' nodes makes them disappear

RESOLVED FIXED in mozilla32

Status

()

Core
DOM
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: wilsonpage, Assigned: wchen)

Tracking

(Blocks: 1 bug)

unspecified
mozilla32
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Demo works in Chrome Canary but not FF Nightly: http://jsbin.com/kimob/1/edit

EXPECTED

<h1> content should change from 'foo' to 'bar'.

ACTUAL

<h1> disappears.
(Reporter)

Updated

3 years ago
Summary: Changing textContent on 'projected content' nodes makes them disappear → [ShadowDOM] Changing textContent on 'projected content' nodes makes them disappear
(Reporter)

Updated

3 years ago
Blocks: 811542
(Reporter)

Updated

3 years ago
Blocks: 952445
(Reporter)

Updated

3 years ago
Duplicate of this bug: 1008072
(Assignee)

Comment 2

3 years ago
Created attachment 8426829 [details] [diff] [review]
Update flattened tree to correctly handle nodes distributed into Shadow DOM insertion points.

This bug is caused by GetFlattenedTreeParent() not handling distributed nodes correctly causing the frame constructor to not set the NODE_DESCENDANTS_NEED_FRAMES flag when needed.
Assignee: nobody → wchen
(Assignee)

Updated

3 years ago
Attachment #8426829 - Flags: review?(bugs)

Comment 3

3 years ago
Thanks for the patch, William. UX is watching this closely for BB and web components work. How is review coming along? Thanks!

Comment 4

3 years ago
I have a similar problem with elements disappearing when I alter their overflow property, but unfortunately this patch doesn't fix that. Altering the linked test-case to change overflow to hidden instead of textContent causes Nightly to crash (without this patch applied, though).

Comment 5

3 years ago
Said crashing test-case: http://jsbin.com/tutixipa/1/edit

Comment 6

3 years ago
Comment on attachment 8426829 [details] [diff] [review]
Update flattened tree to correctly handle nodes distributed into Shadow DOM insertion points.

(The change to ExplicitChildIterator::Get() isn't really about this bug.)

I'm a bit worried about making GetFlattenedTreeParent
to always do a virtual call, but perhaps it isn't too bad...
Attachment #8426829 - Flags: review?(bugs) → review+
(Assignee)

Comment 7

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/58541e1f52d2
Flags: in-testsuite+
OS: Mac OS X → All
Hardware: x86 → All
sorry had to backout this csets in https://tbpl.mozilla.org/?tree=Mozilla-Inbound&onlyunstarred=1&rev=24743a3a0f91 since i guess that one of this 2 changes caused https://tbpl.mozilla.org/php/getParsedLog.php?id=41007049&tree=Mozilla-Inbound
(Assignee)

Comment 9

3 years ago
The test case failed on b2g-emu due to an unrelated bug, fixed by making a trivial change to text content in the test.

https://hg.mozilla.org/integration/mozilla-inbound/rev/845420c23256
https://hg.mozilla.org/mozilla-central/rev/845420c23256
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
See Also: → bug 1022866
(Reporter)

Comment 11

3 years ago
I'm still seeing this issue in some cases. Can't narrow down the exact steps to reproduce yet.
(Reporter)

Updated

3 years ago
Blocks: 1011602
(Reporter)

Updated

3 years ago
No longer blocks: 1011602
Blocks: 1049678
You need to log in before you can comment on or make changes to this bug.