mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 16:47:29 +09:00
Issue #2135 - Destroy the host frame and restyle when there are content changes
This is likely inefficient, but I haven't found a way other than this to ensure that the host frame is updated if the inserted/removed content isn't slotted. I'm assuming that Firefox is handling this somewhere else (and may have been even moved to Stylo), but was mentioned in an m-c bug we haven't seen yet. In fact, this is actually similar to how we handled elements passed to ContentInserted before landing e31ed5b07466d4a579fe4b025f97c971003fbc3f.
This commit is contained in:
parent
ef36c56593
commit
18e693464d
1 changed files with 14 additions and 0 deletions
|
|
@ -578,6 +578,13 @@ ShadowRoot::ContentInserted(nsIDocument* aDocument,
|
||||||
if (slot && slot->GetContainingShadow() == this &&
|
if (slot && slot->GetContainingShadow() == this &&
|
||||||
slot->AssignedNodes().IsEmpty()) {
|
slot->AssignedNodes().IsEmpty()) {
|
||||||
slot->EnqueueSlotChangeEvent();
|
slot->EnqueueSlotChangeEvent();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// XXX: The following makes the host destroy its frames and force a
|
||||||
|
// restyle for cases where the content isn't slotted.
|
||||||
|
if (aContainer == this) {
|
||||||
|
DistributionChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -614,6 +621,13 @@ ShadowRoot::ContentRemoved(nsIDocument* aDocument,
|
||||||
if (slot && slot->GetContainingShadow() == this &&
|
if (slot && slot->GetContainingShadow() == this &&
|
||||||
slot->AssignedNodes().IsEmpty()) {
|
slot->AssignedNodes().IsEmpty()) {
|
||||||
slot->EnqueueSlotChangeEvent();
|
slot->EnqueueSlotChangeEvent();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// XXX: The following makes the host destroy its frames and force a
|
||||||
|
// restyle for cases where the content isn't slotted.
|
||||||
|
if (aContainer == this) {
|
||||||
|
DistributionChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue