bool ContentDistributor::invalidate(Element* host) { ASSERT(needsInvalidation()); bool needsReattach = (m_validity == Undetermined) || !m_nodeToInsertionPoint.isEmpty(); if (ShadowRoot* root = host->shadowRoot()) { for (auto& point : ensureInsertionPointList(root)) { needsReattach = true; point->clearDistribution(); } } m_validity = Invalidating; m_nodeToInsertionPoint.clear(); return needsReattach; }
bool ContentDistributor::invalidate(Element* host) { ASSERT(needsInvalidation()); bool needsReattach = (m_validity == Undetermined) || !m_nodeToInsertionPoint.isEmpty(); if (ShadowRoot* root = host->shadowRoot()) { const Vector<RefPtr<InsertionPoint> >& insertionPoints = ensureInsertionPointList(root); for (size_t i = 0; i < insertionPoints.size(); ++i) { needsReattach = true; insertionPoints[i]->clearDistribution(); } } m_validity = Invalidating; m_nodeToInsertionPoint.clear(); return needsReattach; }
void ContentDistributor::distribute(Element* host) { ASSERT(needsDistribution()); ASSERT(m_nodeToInsertionPoint.isEmpty()); ASSERT(!host->containingShadowRoot() || host->containingShadowRoot()->distributor().isValid()); m_validity = Valid; if (ShadowRoot* root = host->shadowRoot()) { const Vector<RefPtr<InsertionPoint> >& insertionPoints = ensureInsertionPointList(root); for (size_t i = 0; i < insertionPoints.size(); ++i) { InsertionPoint* point = insertionPoints[i].get(); if (!point->isActive()) continue; distributeSelectionsTo(point, host); } } }
void ContentDistributor::distribute(Element* host) { ASSERT(needsDistribution()); ASSERT(m_nodeToInsertionPoint.isEmpty()); ASSERT(!host->containingShadowRoot() || !host->containingShadowRoot()->distributor() || host->containingShadowRoot()->distributor()->isValid()); m_validity = Valid; if (ShadowRoot* root = host->shadowRoot()) { for (auto& point : ensureInsertionPointList(root)) { if (!point->isActive()) continue; distributeSelectionsTo(point.get(), host); } } }