summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dom/base/ShadowRoot.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp
index d432c96e41..8482da5e99 100644
--- a/dom/base/ShadowRoot.cpp
+++ b/dom/base/ShadowRoot.cpp
@@ -9,6 +9,7 @@
#include "mozilla/dom/DocumentFragment.h"
#include "ChildIterator.h"
#include "nsContentUtils.h"
+#include "nsLayoutUtils.h"
#include "nsDOMClassInfoID.h"
#include "nsIDOMHTMLElement.h"
#include "nsIStyleSheetLinkingElement.h"
@@ -162,6 +163,16 @@ ShadowRoot::AddSlot(HTMLSlotElement* aSlot)
oldSlot->RemoveAssignedNode(assignedNode);
currentSlot->AppendAssignedNode(assignedNode);
+ Element* restyleElement;
+ if (assignedNode->IsElement()) {
+ restyleElement = assignedNode->AsElement();
+ } else {
+ // This is likely a text node. Use the host instead.
+ restyleElement = GetHost();
+ }
+ nsLayoutUtils::PostRestyleEvent(
+ restyleElement, eRestyle_Subtree, nsChangeHint(0));
+
doEnqueueSlotChange = true;
}