void RenderNamedFlowThread::addRegionToThread(RenderRegion* renderRegion) { ASSERT(renderRegion); if (m_regionList.isEmpty()) m_regionList.add(renderRegion); else { // Find the first region "greater" than renderRegion. RenderRegionList::iterator it = m_regionList.begin(); while (it != m_regionList.end() && !compareRenderRegions(renderRegion, *it)) ++it; m_regionList.insertBefore(it, renderRegion); } resetMarkForDestruction(); ASSERT(!renderRegion->isValid()); if (renderRegion->parentNamedFlowThread()) { if (renderRegion->parentNamedFlowThread()->dependsOn(this)) { // Register ourself to get a notification when the state changes. renderRegion->parentNamedFlowThread()->m_observerThreadsSet.add(this); return; } addDependencyOnFlowThread(renderRegion->parentNamedFlowThread()); } renderRegion->setIsValid(true); invalidateRegions(); }
void RenderNamedFlowThread::addRegionToThread(RenderRegion* renderRegion) { ASSERT(renderRegion); ASSERT(!renderRegion->isValid()); resetMarkForDestruction(); if (renderRegion->parentNamedFlowThread() && renderRegion->parentNamedFlowThread()->dependsOn(this)) { // The order of invalid regions is irrelevant. m_invalidRegionList.add(renderRegion); // Register ourself to get a notification when the state changes. renderRegion->parentNamedFlowThread()->m_observerThreadsSet.add(this); return; } addRegionToNamedFlowThread(renderRegion); invalidateRegions(); }
// The content nodes list contains those nodes with -webkit-flow-into: flow. // An element with display:none should also be listed among those nodes. // The list of nodes is ordered. void RenderNamedFlowThread::registerNamedFlowContentNode(Node* contentNode) { ASSERT(contentNode && contentNode->isElementNode()); ASSERT(contentNode->document() == document()); contentNode->setInNamedFlow(); resetMarkForDestruction(); // Find the first content node following the new content node. for (NamedFlowContentNodes::iterator it = m_contentNodes.begin(); it != m_contentNodes.end(); ++it) { Node* node = *it; unsigned short position = contentNode->compareDocumentPosition(node); if (position & Node::DOCUMENT_POSITION_FOLLOWING) { m_contentNodes.insertBefore(node, contentNode); return; } } m_contentNodes.add(contentNode); }
// The content nodes list contains those nodes with -webkit-flow-into: flow. // An element with display:none should also be listed among those nodes. // The list of nodes is ordered. void RenderNamedFlowThread::registerNamedFlowContentElement(Element& contentElement) { ASSERT(&contentElement.document() == &document()); contentElement.setInNamedFlow(); resetMarkForDestruction(); // Find the first content node following the new content node. for (auto it = m_contentElements.begin(), end = m_contentElements.end(); it != end; ++it) { Element* element = *it; unsigned short position = contentElement.compareDocumentPosition(element); if (position & Node::DOCUMENT_POSITION_FOLLOWING) { m_contentElements.insertBefore(element, &contentElement); return; } } m_contentElements.add(&contentElement); }
// The content nodes list contains those nodes with -webkit-flow-into: flow. // An element with display:none should also be listed among those nodes. // The list of nodes is ordered. void RenderNamedFlowThread::registerNamedFlowContentElement(Element& contentElement) { ASSERT(&contentElement.document() == &document()); contentElement.setIsNamedFlowContentNode(); resetMarkForDestruction(); // Find the first content node following the new content node. for (auto& element : m_contentElements) { unsigned short position = contentElement.compareDocumentPosition(element); if (position & Node::DOCUMENT_POSITION_FOLLOWING) { m_contentElements.insertBefore(element, &contentElement); InspectorInstrumentation::didRegisterNamedFlowContentElement(&document(), &namedFlow(), &contentElement, element); return; } } m_contentElements.add(&contentElement); InspectorInstrumentation::didRegisterNamedFlowContentElement(&document(), &namedFlow(), &contentElement); }