summaryrefslogtreecommitdiffstats
path: root/dom/base/ChildIterator.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 07:08:22 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 07:08:22 -0400
commit8beb65dd501cbdcfd6a793027b5de2a1fdfc7149 (patch)
tree4b524fb1a1888b37bc347dc65c7c200979fe54aa /dom/base/ChildIterator.cpp
parent5524318fe73a1123da10491a6a545b50af88ea60 (diff)
downloadUXP-8beb65dd501cbdcfd6a793027b5de2a1fdfc7149.tar
UXP-8beb65dd501cbdcfd6a793027b5de2a1fdfc7149.tar.gz
UXP-8beb65dd501cbdcfd6a793027b5de2a1fdfc7149.tar.lz
UXP-8beb65dd501cbdcfd6a793027b5de2a1fdfc7149.tar.xz
UXP-8beb65dd501cbdcfd6a793027b5de2a1fdfc7149.zip
Bug 1418002 - Remove HTMLContentElement
Tag #1375
Diffstat (limited to 'dom/base/ChildIterator.cpp')
-rw-r--r--dom/base/ChildIterator.cpp21
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*