Bug 1083814 - Fix nsContentUtils::HasDistributedChildren for children of <shadow> insertion point. r=smaug
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -6818,17 +6818,17 @@ nsContentUtils::HasDistributedChildren(n
// the shadow insertion point of the younger shadow root.
return shadow->GetYoungerShadow();
}
HTMLShadowElement* shadowEl = HTMLShadowElement::FromContent(aContent);
if (shadowEl && shadowEl->IsInsertionPoint()) {
// Children of a shadow insertion points are distributed
// to the insertion points in the older shadow root.
- return shadow->GetOlderShadow();
+ return shadowEl->GetOlderShadowRoot();
}
HTMLContentElement* contentEl = HTMLContentElement::FromContent(aContent);
if (contentEl && contentEl->IsInsertionPoint()) {
// Children of a content insertion point are distributed to the
// content insertion point if the content insertion point does
// not match any nodes (fallback content).
return contentEl->MatchedNodes().IsEmpty();