Index: third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp |
diff --git a/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp b/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp |
index 03f5048f5d55aa6c5a6f47211a3e95f4b32f9f55..19323fd4098cdfe0315745b4d62344ab2f7a9ac6 100644 |
--- a/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp |
+++ b/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp |
@@ -54,11 +54,6 @@ InsertionPoint::~InsertionPoint() |
void InsertionPoint::setDistributedNodes(DistributedNodes& distributedNodes) |
{ |
- if (shouldUseFallbackElements()) { |
- for (Node* child = firstChild(); child; child = child->nextSibling()) |
- child->lazyReattachIfAttached(); |
- } |
- |
// Attempt not to reattach nodes that would be distributed to the exact same |
// location by comparing the old and new distributions. |
@@ -71,11 +66,15 @@ void InsertionPoint::setDistributedNodes(DistributedNodes& distributedNodes) |
// the new distribution that were inserted. |
for ( ; j < distributedNodes.size() && m_distributedNodes.at(i) != distributedNodes.at(j); ++j) |
distributedNodes.at(j)->lazyReattachIfAttached(); |
+ if (j == distributedNodes.size()) |
+ break; |
} else if (m_distributedNodes.size() > distributedNodes.size()) { |
// If the old distribution is larger than the new one, reattach all nodes in |
// the old distribution that were removed. |
for ( ; i < m_distributedNodes.size() && m_distributedNodes.at(i) != distributedNodes.at(j); ++i) |
m_distributedNodes.at(i)->lazyReattachIfAttached(); |
+ if (i == m_distributedNodes.size()) |
+ break; |
} else if (m_distributedNodes.at(i) != distributedNodes.at(j)) { |
// If both distributions are the same length reattach both old and new. |
m_distributedNodes.at(i)->lazyReattachIfAttached(); |
@@ -130,11 +129,6 @@ void InsertionPoint::willRecalcStyle(StyleRecalcChange change) |
m_distributedNodes.at(i)->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::PropagateInheritChangeToDistributedNodes)); |
} |
-bool InsertionPoint::shouldUseFallbackElements() const |
-{ |
- return isActive() && !hasDistribution(); |
-} |
- |
bool InsertionPoint::canBeActive() const |
{ |
ShadowRoot* shadowRoot = containingShadowRoot(); |