mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
2175f32677
commit
89db30494d
@ -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)
|
||||
|
||||
@ -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); }
|
||||
|
||||
@ -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();
|
||||
};
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -50,7 +50,7 @@ public:
|
||||
|
||||
bool isContentInsertionPoint() const;
|
||||
|
||||
PassRefPtr<StaticNodeList> getDistributedNodes();
|
||||
Vector<RefPtr<Node>> getDistributedNodes();
|
||||
|
||||
virtual bool canAffectSelector() const { return false; }
|
||||
|
||||
|
||||
@ -27,5 +27,5 @@
|
||||
[
|
||||
] interface HTMLContentElement : HTMLElement {
|
||||
[Reflect, TreatNullAs=NullString] attribute DOMString select;
|
||||
NodeList getDistributedNodes();
|
||||
sequence<Node> getDistributedNodes();
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user