summaryrefslogtreecommitdiffstats
path: root/dom/base/nsContentUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/nsContentUtils.cpp')
-rw-r--r--dom/base/nsContentUtils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index 038da24b4..62be71b4a 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -44,6 +44,7 @@
#include "mozilla/dom/Element.h"
#include "mozilla/dom/FileSystemSecurity.h"
#include "mozilla/dom/HTMLMediaElement.h"
+#include "mozilla/dom/HTMLSlotElement.h"
#include "mozilla/dom/HTMLTemplateElement.h"
#include "mozilla/dom/ipc/BlobChild.h"
#include "mozilla/dom/ipc/BlobParent.h"
@@ -7053,6 +7054,13 @@ nsContentUtils::HasDistributedChildren(nsIContent* aContent)
return true;
}
+ HTMLSlotElement* slotEl = HTMLSlotElement::FromContent(aContent);
+ if (slotEl && slotEl->GetContainingShadow()) {
+ // Children of a slot are rendered if the slot does not have any assigned
+ // nodes (fallback content).
+ return slotEl->AssignedNodes().IsEmpty();
+ }
+
return false;
}