Bug 1453206: Look in XBL anon content too for stale style data. r=smaug
This would've caught it earlier. Need to do the GetFirstNode(), ... dance
because well, <content>.
MozReview-Commit-ID: 8F35GRO99M4
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3838,23 +3838,34 @@ nsDocument::TryChannelCharset(nsIChannel
}
}
}
static inline void
AssertNoStaleServoDataIn(const nsINode& aSubtreeRoot)
{
#ifdef DEBUG
- for (const nsINode* node = aSubtreeRoot.GetFirstChild();
+ for (const nsINode* node = &aSubtreeRoot;
node;
- node = node->GetNextNode()) {
- if (node->IsElement()) {
- MOZ_ASSERT(!node->AsElement()->HasServoData());
- if (auto* shadow = node->AsElement()->GetShadowRoot()) {
- AssertNoStaleServoDataIn(*shadow);
+ node = node->GetNextNode(&aSubtreeRoot)) {
+ if (!node->IsElement()) {
+ continue;
+ }
+ MOZ_ASSERT(!node->AsElement()->HasServoData());
+ if (auto* shadow = node->AsElement()->GetShadowRoot()) {
+ AssertNoStaleServoDataIn(*shadow);
+ }
+ if (nsXBLBinding* binding = node->AsElement()->GetXBLBinding()) {
+ if (nsIContent* content = binding->GetAnonymousContent()) {
+ MOZ_ASSERT(!content->AsElement()->HasServoData());
+ for (nsINode* child = content->GetFirstChild();
+ child;
+ child = child->GetNextSibling()) {
+ AssertNoStaleServoDataIn(*child);
+ }
}
}
}
#endif
}
already_AddRefed<nsIPresShell>
nsIDocument::CreateShell(nsPresContext* aContext,