Remove two more uses of NodeList

We now use List<Node> instead, which is more idiomatic.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/941913002
This commit is contained in:
Adam Barth 2015-02-19 21:10:20 -08:00
parent 2175f32677
commit 89db30494d
6 changed files with 13 additions and 18 deletions

View File

@ -1560,15 +1560,15 @@ void Node::removedLastRef()
}
#endif
PassRefPtr<StaticNodeList> Node::getDestinationInsertionPoints()
Vector<RefPtr<Node>> Node::getDestinationInsertionPoints()
{
document().updateDistributionForNodeIfNeeded(this);
Vector<RawPtr<InsertionPoint>, 8> insertionPoints;
collectDestinationInsertionPoints(*this, insertionPoints);
// FIXME(sky): Is there an easier way to get this into a Vector<Node>?
Vector<RefPtr<Node> > nodes(insertionPoints.size());
copyToVector(insertionPoints, nodes);
return StaticNodeList::adopt(nodes);
Vector<RefPtr<Node>> result(insertionPoints.size());
copyToVector(insertionPoints, result);
return result;
}
void Node::setFocus(bool flag)

View File

@ -481,7 +481,7 @@ public:
void unregisterTransientMutationObserver(MutationObserverRegistration*);
void notifyMutationObserversNodeWillDetach();
PassRefPtr<StaticNodeList> getDestinationInsertionPoints();
Vector<RefPtr<Node>> getDestinationInsertionPoints();
void setAlreadySpellChecked(bool flag) { setFlag(flag, AlreadySpellCheckedFlag); }
bool isAlreadySpellChecked() { return getFlag(AlreadySpellCheckedFlag); }

View File

@ -20,10 +20,6 @@
Constructor(optional DOMString data = ""),
ConstructorCallWith=Document,
] interface Text : CharacterData {
// DOM Level 1
[RaisesException] Text splitText(unsigned long offset);
// Shadow DOM API
NodeList getDestinationInsertionPoints();
sequence<Node> getDestinationInsertionPoints();
};

View File

@ -141,16 +141,15 @@ bool InsertionPoint::isContentInsertionPoint() const
return isHTMLContentElement(*this) && isActive();
}
PassRefPtr<StaticNodeList> InsertionPoint::getDistributedNodes()
Vector<RefPtr<Node>> InsertionPoint::getDistributedNodes()
{
document().updateDistributionForNodeIfNeeded(this);
Vector<RefPtr<Node> > nodes;
nodes.reserveInitialCapacity(m_distribution.size());
Vector<RefPtr<Node> > result;
result.reserveInitialCapacity(m_distribution.size());
for (size_t i = 0; i < m_distribution.size(); ++i)
nodes.uncheckedAppend(m_distribution.at(i));
return StaticNodeList::adopt(nodes);
result.uncheckedAppend(m_distribution.at(i));
return result;
}
void InsertionPoint::childrenChanged(const ChildrenChange& change)

View File

@ -50,7 +50,7 @@ public:
bool isContentInsertionPoint() const;
PassRefPtr<StaticNodeList> getDistributedNodes();
Vector<RefPtr<Node>> getDistributedNodes();
virtual bool canAffectSelector() const { return false; }

View File

@ -27,5 +27,5 @@
[
] interface HTMLContentElement : HTMLElement {
[Reflect, TreatNullAs=NullString] attribute DOMString select;
NodeList getDistributedNodes();
sequence<Node> getDistributedNodes();
};