Bug 1372061 - Remove unused StyleChildrenIterator::IsNeeded. r?bholley draft
authorCameron McCormack <cam@mcc.id.au>
Tue, 27 Jun 2017 23:56:13 -0700
changeset 601168 a7116fdcc871a441eb8e37c9114fc6c7fab077c8
parent 601167 b27086aad94e37915670f3a036475fae1200b3e0
child 601169 e092e01421c7631eb83ef528cdc9e2cecd135ba0
push id65977
push userbmo:cam@mcc.id.au
push dateWed, 28 Jun 2017 06:56:24 +0000
reviewersbholley
bugs1372061
milestone56.0a1
Bug 1372061 - Remove unused StyleChildrenIterator::IsNeeded. r?bholley MozReview-Commit-ID: LH8xZMrcdO1
dom/base/ChildIterator.cpp
dom/base/ChildIterator.h
--- a/dom/base/ChildIterator.cpp
+++ b/dom/base/ChildIterator.cpp
@@ -473,53 +473,16 @@ AllChildrenIterator::GetPreviousChild()
       return beforeContent;
     }
   }
 
   mPhase = eAtBegin;
   return nullptr;
 }
 
-/* static */ bool
-StyleChildrenIterator::IsNeeded(const Element* aElement)
-{
-  // If the node is in an anonymous subtree, we conservatively return true to
-  // handle insertion points.
-  if (aElement->IsInAnonymousSubtree()) {
-    return true;
-  }
-
-  // If the node has an XBL binding with anonymous content return true.
-  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;
-}
-
 nsIContent*
 StyleChildrenIterator::GetNextChild()
 {
   return AllChildrenIterator::GetNextChild();
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/ChildIterator.h
+++ b/dom/base/ChildIterator.h
@@ -276,18 +276,14 @@ public:
                           nsIContent::eAllChildren |
                           nsIContent::eSkipDocumentLevelNativeAnonymousContent)
   {
     MOZ_COUNT_CTOR(StyleChildrenIterator);
   }
   ~StyleChildrenIterator() { MOZ_COUNT_DTOR(StyleChildrenIterator); }
 
   nsIContent* GetNextChild();
-
-  // Returns true if we cannot find all the children we need to style by
-  // traversing the siblings of the first child.
-  static bool IsNeeded(const Element* aParent);
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif