diff options
Diffstat (limited to 'dom/base/ChildIterator.cpp')
-rw-r--r-- | dom/base/ChildIterator.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/dom/base/ChildIterator.cpp b/dom/base/ChildIterator.cpp index 391b7c326..dc356fc01 100644 --- a/dom/base/ChildIterator.cpp +++ b/dom/base/ChildIterator.cpp @@ -7,7 +7,6 @@ #include "ChildIterator.h" #include "nsContentUtils.h" #include "mozilla/dom/XBLChildrenElement.h" -#include "mozilla/dom/HTMLContentElement.h" #include "mozilla/dom/ShadowRoot.h" #include "nsIAnonymousContentCreator.h" #include "nsIFrame.h" @@ -18,33 +17,29 @@ namespace dom { class MatchedNodes { public: - explicit MatchedNodes(HTMLContentElement* aInsertionPoint) - : mIsContentElement(true), mContentElement(aInsertionPoint) {} - + explicit MatchedNodes() + : mIsContentElement(false), mChildrenElement(nullptr) {} explicit MatchedNodes(XBLChildrenElement* aInsertionPoint) : mIsContentElement(false), mChildrenElement(aInsertionPoint) {} uint32_t Length() const { - return mIsContentElement ? mContentElement->MatchedNodes().Length() - : mChildrenElement->InsertedChildrenLength(); + return mChildrenElement ? mChildrenElement->InsertedChildrenLength() : 0; } nsIContent* operator[](int32_t aIndex) const { - return mIsContentElement ? mContentElement->MatchedNodes()[aIndex] - : mChildrenElement->InsertedChild(aIndex); + return mChildrenElement ? mChildrenElement->InsertedChild(aIndex) : nullptr; } bool IsEmpty() const { - return mIsContentElement ? mContentElement->MatchedNodes().IsEmpty() - : !mChildrenElement->HasInsertedChildren(); + return mChildrenElement && !mChildrenElement->HasInsertedChildren(); } protected: + // Leftover from Shadow DOM v0. bool mIsContentElement; union { - HTMLContentElement* mContentElement; XBLChildrenElement* mChildrenElement; }; }; @@ -57,9 +52,9 @@ GetMatchedNodesForPoint(nsIContent* aContent) return MatchedNodes(static_cast<XBLChildrenElement*>(aContent)); } + return MatchedNodes(); // Web components case - MOZ_ASSERT(aContent->IsHTMLElement(nsGkAtoms::content)); - return MatchedNodes(HTMLContentElement::FromContent(aContent)); + // XXX handle <slot> element? } nsIContent* |