diff options
author | Moonchild <moonchild@palemoon.org> | 2023-03-11 07:08:38 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2023-03-11 07:08:38 +0000 |
commit | 4c4bc3ca0f8e6e92c208ea182e7f899252e11fff (patch) | |
tree | 15c062edcf877449b4ad1f5eb298b2560fe66242 | |
parent | 014e4b6e7ff6df7c5a15cb96088b1d4600bfd3a3 (diff) | |
parent | 14746314c4297f76f2b2d64c59e8c8fe2dfe8d8e (diff) | |
download | uxp-4c4bc3ca0f8e6e92c208ea182e7f899252e11fff.tar.gz |
Merge pull request 'Destroy the host frame and restyle when there are content changes' (#2152) from FranklinDM/UXP-contrib:work_wc-content-change-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2152
-rw-r--r-- | dom/base/ShadowRoot.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp index e31b97262c..92d5a2f2a9 100644 --- a/dom/base/ShadowRoot.cpp +++ b/dom/base/ShadowRoot.cpp @@ -578,6 +578,13 @@ ShadowRoot::ContentInserted(nsIDocument* aDocument, if (slot && slot->GetContainingShadow() == this && slot->AssignedNodes().IsEmpty()) { 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 && slot->AssignedNodes().IsEmpty()) { 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(); } } |