| Index: Source/core/dom/shadow/ElementShadow.cpp
|
| diff --git a/Source/core/dom/shadow/ElementShadow.cpp b/Source/core/dom/shadow/ElementShadow.cpp
|
| index bc4fb9ff822c50c07fdf09731a475b9ad2b61936..1f25ddb0e36964989f2761c5a8ad7e8ebaaad7be 100644
|
| --- a/Source/core/dom/shadow/ElementShadow.cpp
|
| +++ b/Source/core/dom/shadow/ElementShadow.cpp
|
| @@ -173,7 +173,7 @@ InsertionPoint* ElementShadow::findInsertionPointFor(const Node* key) const
|
| return m_nodeToInsertionPoint.get(key);
|
| }
|
|
|
| -void ElementShadow::populate(Node* node, Vector<Node*>& pool)
|
| +void ElementShadow::populate(Node* node, Vector<Node*, 32>& pool)
|
| {
|
| if (!isActiveInsertionPoint(node)) {
|
| pool.append(node);
|
| @@ -192,16 +192,16 @@ void ElementShadow::populate(Node* node, Vector<Node*>& pool)
|
|
|
| void ElementShadow::distribute()
|
| {
|
| - Vector<Node*> pool;
|
| + Vector<Node*, 32> pool;
|
| for (Node* node = host()->firstChild(); node; node = node->nextSibling())
|
| populate(node, pool);
|
|
|
| host()->setNeedsStyleRecalc();
|
|
|
| - Vector<bool> distributed(pool.size());
|
| - distributed.fill(false);
|
| + Vector<bool> distributed;
|
| + distributed.fill(false, pool.size());
|
|
|
| - Vector<HTMLShadowElement*, 8> activeShadowInsertionPoints;
|
| + Vector<HTMLShadowElement*, 32> activeShadowInsertionPoints;
|
| for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
|
| HTMLShadowElement* firstActiveShadowInsertionPoint = 0;
|
|
|
| @@ -253,7 +253,7 @@ void ElementShadow::distribute()
|
| }
|
| }
|
|
|
| -void ElementShadow::distributeSelectionsTo(InsertionPoint* insertionPoint, const Vector<Node*>& pool, Vector<bool>& distributed)
|
| +void ElementShadow::distributeSelectionsTo(InsertionPoint* insertionPoint, const Vector<Node*, 32>& pool, Vector<bool>& distributed)
|
| {
|
| ContentDistribution distribution;
|
|
|
| @@ -281,8 +281,9 @@ void ElementShadow::distributeNodeChildrenTo(InsertionPoint* insertionPoint, Con
|
| InsertionPoint* innerInsertionPoint = toInsertionPoint(node);
|
| if (innerInsertionPoint->hasDistribution()) {
|
| for (size_t i = 0; i < innerInsertionPoint->size(); ++i) {
|
| - distribution.append(innerInsertionPoint->at(i));
|
| - m_nodeToInsertionPoint.add(innerInsertionPoint->at(i), insertionPoint);
|
| + Node* nodeToAdd = innerInsertionPoint->at(i);
|
| + distribution.append(nodeToAdd);
|
| + m_nodeToInsertionPoint.add(nodeToAdd, insertionPoint);
|
| }
|
| } else {
|
| for (Node* child = innerInsertionPoint->firstChild(); child; child = child->nextSibling()) {
|
|
|