Bug 1331047: Require a child iterator for elements with ::before and ::after pseudos. r?bholley
MozReview-Commit-ID: e1UTlnNn3X
--- a/dom/base/ChildIterator.cpp
+++ b/dom/base/ChildIterator.cpp
@@ -507,16 +507,26 @@ StyleChildrenIterator::IsNeeded(const El
if (aElement->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) {
nsBindingManager* manager = aElement->OwnerDoc()->BindingManager();
nsXBLBinding* binding = manager->GetBindingWithContent(aElement);
if (binding && binding->GetAnonymousContent()) {
return true;
}
}
+ // If the node has a ::before or ::after pseudo, return true, because we want
+ // to visit those.
+ //
+ // TODO(emilio): Make this fast adding a bit? or, perhaps just using
+ // ProbePseudoElementStyle? It should be quite fast in Stylo.
+ if (aElement->GetProperty(nsGkAtoms::beforePseudoProperty) ||
+ aElement->GetProperty(nsGkAtoms::afterPseudoProperty)) {
+ return true;
+ }
+
// If the node has native anonymous content, return true.
nsIAnonymousContentCreator* ac = do_QueryFrame(aElement->GetPrimaryFrame());
if (ac) {
return true;
}
return false;
}