Changeset 161097 in webkit
- Timestamp:
- Dec 27, 2013, 12:26:42 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
dom/ContainerNode.cpp (modified) (7 diffs)
-
dom/Document.cpp (modified) (18 diffs)
-
dom/MutationObserver.cpp (modified) (3 diffs)
-
dom/MutationObserverInterestGroup.cpp (modified) (2 diffs)
-
dom/MutationObserverRegistration.cpp (modified) (2 diffs)
-
dom/Node.cpp (modified) (9 diffs)
-
dom/NodeRareData.h (modified) (1 diff)
-
dom/ScriptExecutionContext.cpp (modified) (9 diffs)
-
dom/WebKitNamedFlow.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161096 r161097 1 2013-12-27 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r161096. 4 http://trac.webkit.org/changeset/161096 5 https://bugs.webkit.org/show_bug.cgi?id=126256 6 7 Made lots of tests crash (Requested by ap on #webkit). 8 9 * dom/ContainerNode.cpp: 10 (WebCore::ContainerNode::insertBefore): 11 (WebCore::ContainerNode::replaceChild): 12 (WebCore::willRemoveChildren): 13 (WebCore::ContainerNode::appendChild): 14 * dom/Document.cpp: 15 (WebCore::Document::visibilityStateChanged): 16 (WebCore::Document::moveNodeIteratorsToNewDocument): 17 (WebCore::Document::updateRangesAfterChildrenChanged): 18 (WebCore::Document::nodeChildrenWillBeRemoved): 19 (WebCore::Document::nodeWillBeRemoved): 20 (WebCore::Document::textInserted): 21 (WebCore::Document::textRemoved): 22 (WebCore::Document::textNodesMerged): 23 (WebCore::Document::textNodeSplit): 24 (WebCore::Document::documentWillSuspendForPageCache): 25 (WebCore::Document::documentDidResumeFromPageCache): 26 (WebCore::Document::mediaVolumeDidChange): 27 (WebCore::Document::privateBrowsingStateDidChange): 28 (WebCore::Document::captionPreferencesChanged): 29 (WebCore::Document::validateAutoSizingNodes): 30 (WebCore::Document::resetAutoSizingNodes): 31 (WebCore::Document::webkitExitFullscreen): 32 * dom/MutationObserver.cpp: 33 (WebCore::MutationObserver::disconnect): 34 (WebCore::MutationObserver::getObservedNodes): 35 (WebCore::MutationObserver::deliver): 36 * dom/MutationObserverInterestGroup.cpp: 37 (WebCore::MutationObserverInterestGroup::isOldValueRequested): 38 (WebCore::MutationObserverInterestGroup::enqueueMutationRecord): 39 * dom/MutationObserverRegistration.cpp: 40 (WebCore::MutationObserverRegistration::clearTransientRegistrations): 41 (WebCore::MutationObserverRegistration::addRegistrationNodesToSet): 42 * dom/Node.cpp: 43 (WebCore::Node::dumpStatistics): 44 (WebCore::Document::invalidateNodeListAndCollectionCaches): 45 (WebCore::NodeListsNodeData::invalidateCaches): 46 (WebCore::Node::didMoveToNewDocument): 47 (WebCore::collectMatchingObserversForMutation): 48 (WebCore::Node::notifyMutationObserversNodeWillDetach): 49 * dom/NodeRareData.h: 50 (WebCore::NodeListsNodeData::adoptDocument): 51 * dom/ScriptExecutionContext.cpp: 52 (WebCore::ScriptExecutionContext::~ScriptExecutionContext): 53 (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): 54 (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): 55 (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): 56 (WebCore::ScriptExecutionContext::stopActiveDOMObjects): 57 (WebCore::ScriptExecutionContext::closeMessagePorts): 58 (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval): 59 (WebCore::ScriptExecutionContext::didChangeTimerAlignmentInterval): 60 * dom/WebKitNamedFlow.cpp: 61 (WebCore::WebKitNamedFlow::getRegionsByContent): 62 (WebCore::WebKitNamedFlow::getRegions): 63 (WebCore::WebKitNamedFlow::getContent): 64 1 65 2013-12-26 Sam Weinig <sam@webkit.org> 2 66 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r161096 r161097 302 302 303 303 ChildListMutationScope mutation(*this); 304 for (auto& child : targets) { 304 for (auto it = targets.begin(), end = targets.end(); it != end; ++it) { 305 Node& child = it->get(); 306 305 307 // Due to arbitrary code running in response to a DOM mutation event it's 306 308 // possible that "next" is no longer a child of "this". … … 309 311 if (next->parentNode() != this) 310 312 break; 311 if (child ->parentNode())313 if (child.parentNode()) 312 314 break; 313 315 314 treeScope().adoptIfNeeded(&child .get());315 316 insertBeforeCommon(next.get(), child .get());317 318 updateTreeAfterInsertion(child .get());316 treeScope().adoptIfNeeded(&child); 317 318 insertBeforeCommon(next.get(), child); 319 320 updateTreeAfterInsertion(child); 319 321 } 320 322 … … 456 458 457 459 // Add the new child(ren) 458 for (auto& child : targets) { 460 for (auto it = targets.begin(), end = targets.end(); it != end; ++it) { 461 Node& child = it->get(); 462 459 463 // Due to arbitrary code running in response to a DOM mutation event it's 460 464 // possible that "next" is no longer a child of "this". … … 463 467 if (next && next->parentNode() != this) 464 468 break; 465 if (child ->parentNode())469 if (child.parentNode()) 466 470 break; 467 471 468 treeScope().adoptIfNeeded(&child .get());472 treeScope().adoptIfNeeded(&child); 469 473 470 474 // Add child before "next". … … 472 476 NoEventDispatchAssertion assertNoEventDispatch; 473 477 if (next) 474 insertBeforeCommon(*next, child .get());478 insertBeforeCommon(*next, child); 475 479 else 476 appendChildToContainer(&child .get(), *this);480 appendChildToContainer(&child, *this); 477 481 } 478 482 479 updateTreeAfterInsertion(child .get());483 updateTreeAfterInsertion(child); 480 484 } 481 485 … … 502 506 503 507 ChildListMutationScope mutation(container); 504 for (auto& child : children) { 505 mutation.willRemoveChild(child.get()); 506 child->notifyMutationObserversNodeWillDetach(); 508 for (auto it = children.begin(); it != children.end(); ++it) { 509 Node& child = it->get(); 510 mutation.willRemoveChild(child); 511 child.notifyMutationObserversNodeWillDetach(); 507 512 508 513 // fire removed from document mutation events. 509 dispatchChildRemovalEvents(child .get());514 dispatchChildRemovalEvents(child); 510 515 } 511 516 … … 705 710 // Now actually add the child(ren) 706 711 ChildListMutationScope mutation(*this); 707 for (auto& child : targets) { 712 for (auto it = targets.begin(), end = targets.end(); it != end; ++it) { 713 Node& child = it->get(); 714 708 715 // If the child has a parent again, just stop what we're doing, because 709 716 // that means someone is doing something with DOM mutation -- can't re-parent 710 717 // a child that already has a parent. 711 if (child ->parentNode())718 if (child.parentNode()) 712 719 break; 713 720 714 treeScope().adoptIfNeeded(&child .get());721 treeScope().adoptIfNeeded(&child); 715 722 716 723 // Append child to the end of the list 717 724 { 718 725 NoEventDispatchAssertion assertNoEventDispatch; 719 appendChildToContainer(&child .get(), *this);726 appendChildToContainer(&child, *this); 720 727 } 721 728 722 updateTreeAfterInsertion(child .get());729 updateTreeAfterInsertion(child); 723 730 } 724 731 -
trunk/Source/WebCore/dom/Document.cpp
r161096 r161097 1554 1554 { 1555 1555 dispatchEvent(Event::create(eventNames().visibilitychangeEvent, false, false)); 1556 for (auto * element : m_visibilityStateCallbackElements)1557 element->visibilityStateChanged();1556 for (auto it = m_visibilityStateCallbackElements.begin(); it != m_visibilityStateCallbackElements.end(); ++it) 1557 (*it)->visibilityStateChanged(); 1558 1558 } 1559 1559 … … 3531 3531 void Document::moveNodeIteratorsToNewDocument(Node* node, Document* newDocument) 3532 3532 { 3533 HashSet<NodeIterator*> nodeIteratorsCopy = m_nodeIterators; 3534 for (auto* nodeIterator : nodeIteratorsCopy) { 3535 if (nodeIterator->root() == node) { 3536 detachNodeIterator(nodeIterator); 3537 newDocument->attachNodeIterator(nodeIterator); 3533 HashSet<NodeIterator*> nodeIteratorsList = m_nodeIterators; 3534 HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = nodeIteratorsList.end(); 3535 for (HashSet<NodeIterator*>::const_iterator it = nodeIteratorsList.begin(); it != nodeIteratorsEnd; ++it) { 3536 if ((*it)->root() == node) { 3537 detachNodeIterator(*it); 3538 newDocument->attachNodeIterator(*it); 3538 3539 } 3539 3540 } … … 3543 3544 { 3544 3545 if (!m_ranges.isEmpty()) { 3545 for (auto * range : m_ranges)3546 range->nodeChildrenChanged(container);3546 for (auto it = m_ranges.begin(), end = m_ranges.end(); it != end; ++it) 3547 (*it)->nodeChildrenChanged(container); 3547 3548 } 3548 3549 } … … 3551 3552 { 3552 3553 if (!m_ranges.isEmpty()) { 3553 for (auto * range : m_ranges)3554 range->nodeChildrenWillBeRemoved(container);3555 } 3556 3557 for (auto * nodeIterator : m_nodeIterators) {3554 for (auto it = m_ranges.begin(), end = m_ranges.end(); it != end; ++it) 3555 (*it)->nodeChildrenWillBeRemoved(container); 3556 } 3557 3558 for (auto it = m_nodeIterators.begin(), end = m_nodeIterators.end(); it != end; ++it) { 3558 3559 for (Node* n = container.firstChild(); n; n = n->nextSibling()) 3559 nodeIterator->nodeWillBeRemoved(n);3560 (*it)->nodeWillBeRemoved(n); 3560 3561 } 3561 3562 … … 3571 3572 void Document::nodeWillBeRemoved(Node* n) 3572 3573 { 3573 for (auto* nodeIterator : m_nodeIterators) 3574 nodeIterator->nodeWillBeRemoved(n); 3574 HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = m_nodeIterators.end(); 3575 for (HashSet<NodeIterator*>::const_iterator it = m_nodeIterators.begin(); it != nodeIteratorsEnd; ++it) 3576 (*it)->nodeWillBeRemoved(n); 3575 3577 3576 3578 if (!m_ranges.isEmpty()) { 3577 for (auto* range : m_ranges) 3578 range->nodeWillBeRemoved(n); 3579 HashSet<Range*>::const_iterator rangesEnd = m_ranges.end(); 3580 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != rangesEnd; ++it) 3581 (*it)->nodeWillBeRemoved(n); 3579 3582 } 3580 3583 … … 3589 3592 { 3590 3593 if (!m_ranges.isEmpty()) { 3591 for (auto* range : m_ranges) 3592 range->textInserted(text, offset, length); 3594 HashSet<Range*>::const_iterator end = m_ranges.end(); 3595 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it) 3596 (*it)->textInserted(text, offset, length); 3593 3597 } 3594 3598 … … 3600 3604 { 3601 3605 if (!m_ranges.isEmpty()) { 3602 for (auto* range : m_ranges) 3603 range->textRemoved(text, offset, length); 3606 HashSet<Range*>::const_iterator end = m_ranges.end(); 3607 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it) 3608 (*it)->textRemoved(text, offset, length); 3604 3609 } 3605 3610 … … 3613 3618 if (!m_ranges.isEmpty()) { 3614 3619 NodeWithIndex oldNodeWithIndex(oldNode); 3615 for (auto* range : m_ranges) 3616 range->textNodesMerged(oldNodeWithIndex, offset); 3620 HashSet<Range*>::const_iterator end = m_ranges.end(); 3621 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it) 3622 (*it)->textNodesMerged(oldNodeWithIndex, offset); 3617 3623 } 3618 3624 … … 3623 3629 { 3624 3630 if (!m_ranges.isEmpty()) { 3625 for (auto* range : m_ranges) 3626 range->textNodeSplit(oldNode); 3631 HashSet<Range*>::const_iterator end = m_ranges.end(); 3632 for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it) 3633 (*it)->textNodeSplit(oldNode); 3627 3634 } 3628 3635 … … 4089 4096 documentWillBecomeInactive(); 4090 4097 4091 for (auto* element : m_documentSuspensionCallbackElements) 4092 element->documentWillSuspendForPageCache(); 4098 HashSet<Element*>::iterator end = m_documentSuspensionCallbackElements.end(); 4099 for (HashSet<Element*>::iterator i = m_documentSuspensionCallbackElements.begin(); i != end; ++i) 4100 (*i)->documentWillSuspendForPageCache(); 4093 4101 4094 4102 #ifndef NDEBUG … … 4103 4111 Vector<Element*> elements; 4104 4112 copyToVector(m_documentSuspensionCallbackElements, elements); 4105 for (auto* element : elements) 4106 element->documentDidResumeFromPageCache(); 4113 Vector<Element*>::iterator end = elements.end(); 4114 for (Vector<Element*>::iterator i = elements.begin(); i != end; ++i) 4115 (*i)->documentDidResumeFromPageCache(); 4107 4116 4108 4117 #if USE(ACCELERATED_COMPOSITING) … … 4130 4139 void Document::mediaVolumeDidChange() 4131 4140 { 4132 for (auto* element : m_mediaVolumeCallbackElements) 4133 element->mediaVolumeDidChange(); 4141 HashSet<Element*>::iterator end = m_mediaVolumeCallbackElements.end(); 4142 for (HashSet<Element*>::iterator i = m_mediaVolumeCallbackElements.begin(); i != end; ++i) 4143 (*i)->mediaVolumeDidChange(); 4134 4144 } 4135 4145 … … 4152 4162 void Document::privateBrowsingStateDidChange() 4153 4163 { 4154 for (auto* element : m_privateBrowsingStateChangedElements) 4155 element->privateBrowsingStateDidChange(); 4164 HashSet<Element*>::iterator end = m_privateBrowsingStateChangedElements.end(); 4165 for (HashSet<Element*>::iterator it = m_privateBrowsingStateChangedElements.begin(); it != end; ++it) 4166 (*it)->privateBrowsingStateDidChange(); 4156 4167 } 4157 4168 … … 4182 4193 void Document::captionPreferencesChanged() 4183 4194 { 4184 for (auto* element : m_captionPreferencesChangedElements) 4185 element->captionPreferencesChanged(); 4195 HashSet<Element*>::iterator end = m_captionPreferencesChangedElements.end(); 4196 for (HashSet<Element*>::iterator it = m_captionPreferencesChangedElements.begin(); it != end; ++it) 4197 (*it)->captionPreferencesChanged(); 4186 4198 } 4187 4199 #endif … … 4831 4843 { 4832 4844 Vector<TextAutoSizingKey> nodesForRemoval; 4833 for (auto & autoSizingKeyValuePair : m_textAutoSizedNodes) {4834 RefPtr<TextAutoSizingValue> value = autoSizingKeyValuePair.value;4845 for (auto it = m_textAutoSizedNodes.begin(), end = m_textAutoSizedNodes.end(); it != end; ++it) { 4846 RefPtr<TextAutoSizingValue> value = it->value; 4835 4847 // Update all the nodes in the collection to reflect the new 4836 4848 // candidate size. … … 4840 4852 value->adjustNodeSizes(); 4841 4853 if (!value->numNodes()) 4842 nodesForRemoval.append( autoSizingKeyValuePair.key);4854 nodesForRemoval.append(it->key); 4843 4855 } 4844 4856 unsigned count = nodesForRemoval.size(); … … 4849 4861 void Document::resetAutoSizingNodes() 4850 4862 { 4851 for (auto& autoSizingValue : m_textAutoSizedNodes.values()) { 4852 if (autoSizingValue) 4853 autoSizingValue->reset(); 4863 for (auto it = m_textAutoSizedNodes.begin(), end = m_textAutoSizedNodes.end(); it != end; ++it) { 4864 RefPtr<TextAutoSizingValue> value = it->value; 4865 if (value) 4866 value->reset(); 4854 4867 } 4855 4868 m_textAutoSizedNodes.clear(); … … 5288 5301 // 4. For each descendant in descendants, empty descendant's fullscreen element stack, and queue a 5289 5302 // task to fire an event named fullscreenchange with its bubbles attribute set to true on descendant. 5290 for ( auto& descendant : descendants) {5291 descendant->clearFullscreenElementStack();5292 addDocumentToFullScreenChangeEventQueue( descendant.get());5303 for (Deque<RefPtr<Document>>::iterator i = descendants.begin(); i != descendants.end(); ++i) { 5304 (*i)->clearFullscreenElementStack(); 5305 addDocumentToFullScreenChangeEventQueue(i->get()); 5293 5306 } 5294 5307 -
trunk/Source/WebCore/dom/MutationObserver.cpp
r161096 r161097 119 119 m_records.clear(); 120 120 HashSet<MutationObserverRegistration*> registrations(m_registrations); 121 for ( auto* registration : registrations)122 MutationObserverRegistration::unregisterAndDelete( registration);121 for (HashSet<MutationObserverRegistration*>::iterator iter = registrations.begin(); iter != registrations.end(); ++iter) 122 MutationObserverRegistration::unregisterAndDelete(*iter); 123 123 } 124 124 … … 165 165 { 166 166 HashSet<Node*> observedNodes; 167 for ( auto* registration : m_registrations)168 registration->addRegistrationNodesToSet(observedNodes);167 for (HashSet<MutationObserverRegistration*>::const_iterator iter = m_registrations.begin(); iter != m_registrations.end(); ++iter) 168 (*iter)->addRegistrationNodesToSet(observedNodes); 169 169 return observedNodes; 170 170 } … … 182 182 // to make a copy of the transient registrations before operating on them. 183 183 Vector<MutationObserverRegistration*, 1> transientRegistrations; 184 for ( auto* registration : m_registrations) {185 if ( registration->hasTransientRegistrations())186 transientRegistrations.append( registration);184 for (HashSet<MutationObserverRegistration*>::iterator iter = m_registrations.begin(); iter != m_registrations.end(); ++iter) { 185 if ((*iter)->hasTransientRegistrations()) 186 transientRegistrations.append(*iter); 187 187 } 188 188 for (size_t i = 0; i < transientRegistrations.size(); ++i) -
trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp
r161096 r161097 58 58 bool MutationObserverInterestGroup::isOldValueRequested() 59 59 { 60 for ( auto options : m_observers.values()) {61 if (hasOldValue( options))60 for (HashMap<MutationObserver*, MutationRecordDeliveryOptions>::iterator iter = m_observers.begin(); iter != m_observers.end(); ++iter) { 61 if (hasOldValue(iter->value)) 62 62 return true; 63 63 } … … 69 69 RefPtr<MutationRecord> mutation = prpMutation; 70 70 RefPtr<MutationRecord> mutationWithNullOldValue; 71 for ( auto& observerOptionsPair : m_observers) {72 MutationObserver* observer = observerOptionsPair.key;73 if (hasOldValue( observerOptionsPair.value)) {71 for (HashMap<MutationObserver*, MutationRecordDeliveryOptions>::iterator iter = m_observers.begin(); iter != m_observers.end(); ++iter) { 72 MutationObserver* observer = iter->key; 73 if (hasOldValue(iter->value)) { 74 74 observer->enqueueMutationRecord(mutation); 75 75 continue; -
trunk/Source/WebCore/dom/MutationObserverRegistration.cpp
r161096 r161097 88 88 } 89 89 90 for ( auto& node : *m_transientRegistrationNodes)91 node->unregisterTransientMutationObserver(this);90 for (NodeHashSet::iterator iter = m_transientRegistrationNodes->begin(); iter != m_transientRegistrationNodes->end(); ++iter) 91 (*iter)->unregisterTransientMutationObserver(this); 92 92 93 93 m_transientRegistrationNodes.clear(); … … 127 127 if (!m_transientRegistrationNodes) 128 128 return; 129 for ( auto& node : *m_transientRegistrationNodes)130 nodes.add( node.get());129 for (NodeHashSet::const_iterator iter = m_transientRegistrationNodes->begin(); iter != m_transientRegistrationNodes->end(); ++iter) 130 nodes.add(iter->get()); 131 131 } 132 132 -
trunk/Source/WebCore/dom/Node.cpp
r161096 r161097 132 132 size_t elementsWithNamedNodeMap = 0; 133 133 134 for (auto* node : liveNodeSet) { 134 for (HashSet<Node*>::iterator it = liveNodeSet.begin(); it != liveNodeSet.end(); ++it) { 135 Node* node = *it; 136 135 137 if (node->hasRareData()) { 136 138 ++nodesWithRareData; … … 238 240 239 241 printf("Element tag name distibution:\n"); 240 for ( auto stringSizePair : perTagCount)241 printf(" Number of <%s> tags: %zu\n", stringSizePair.key.utf8().data(), stringSizePair.value);242 for (HashMap<String, size_t>::iterator it = perTagCount.begin(); it != perTagCount.end(); ++it) 243 printf(" Number of <%s> tags: %zu\n", it->key.utf8().data(), it->value); 242 244 243 245 printf("Attributes:\n"); … … 726 728 void Document::invalidateNodeListAndCollectionCaches(const QualifiedName* attrName) 727 729 { 728 for ( auto* nodeList : m_listsInvalidatedAtDocument)729 nodeList->invalidateCache(attrName);730 for ( auto* collection : m_collectionsInvalidatedAtDocument)731 collection->invalidateCache(attrName);730 for (HashSet<LiveNodeList*>::iterator it = m_listsInvalidatedAtDocument.begin(), end = m_listsInvalidatedAtDocument.end(); it != end; ++it) 731 (*it)->invalidateCache(attrName); 732 for (HashSet<HTMLCollection*>::iterator it = m_collectionsInvalidatedAtDocument.begin(), end = m_collectionsInvalidatedAtDocument.end(); it != end; ++it) 733 (*it)->invalidateCache(attrName); 732 734 } 733 735 … … 1700 1702 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) 1701 1703 { 1702 for (auto * nodeList : m_atomicNameCaches.values())1703 nodeList->invalidateCache(attrName);1704 1705 for (auto * nodeList : m_nameCaches.values())1706 nodeList->invalidateCache(attrName);1707 1708 for (auto * collection : m_cachedCollections.values())1709 collection->invalidateCache(attrName);1704 for (auto it = m_atomicNameCaches.begin(), end = m_atomicNameCaches.end(); it != end; ++it) 1705 it->value->invalidateCache(attrName); 1706 1707 for (auto it = m_nameCaches.begin(), end = m_nameCaches.end(); it != end; ++it) 1708 it->value->invalidateCache(attrName); 1709 1710 for (auto it = m_cachedCollections.begin(), end = m_cachedCollections.end(); it != end; ++it) 1711 it->value->invalidateCache(attrName); 1710 1712 1711 1713 if (attrName) 1712 1714 return; 1713 1715 1714 for (auto * nodeList : m_tagNodeListCacheNS.values())1715 nodeList->invalidateCache();1716 for (auto it = m_tagNodeListCacheNS.begin(), end = m_tagNodeListCacheNS.end(); it != end; ++it) 1717 it->value->invalidateCache(); 1716 1718 } 1717 1719 … … 1777 1779 } 1778 1780 1779 if ( auto* registry = mutationObserverRegistry()) {1781 if (Vector<OwnPtr<MutationObserverRegistration>>* registry = mutationObserverRegistry()) { 1780 1782 for (size_t i = 0; i < registry->size(); ++i) { 1781 1783 document().addMutationObserverTypes(registry->at(i)->mutationTypes()); … … 1783 1785 } 1784 1786 1785 if (auto* transientRegistry = transientMutationObserverRegistry()) { 1786 for (auto* registration : *transientRegistry) 1787 document().addMutationObserverTypes(registration->mutationTypes()); 1787 if (HashSet<MutationObserverRegistration*>* transientRegistry = transientMutationObserverRegistry()) { 1788 for (HashSet<MutationObserverRegistration*>::iterator iter = transientRegistry->begin(); iter != transientRegistry->end(); ++iter) { 1789 document().addMutationObserverTypes((*iter)->mutationTypes()); 1790 } 1788 1791 } 1789 1792 } … … 1926 1929 if (!registry) 1927 1930 return; 1928 1929 for (auto& registration : *registry) {1930 if (registration ->shouldReceiveMutationFrom(target, type, attributeName)) {1931 MutationRecordDeliveryOptions deliveryOptions = registration ->deliveryOptions();1932 auto result = observers.add(registration->observer(), deliveryOptions);1931 for (typename Registry::iterator iter = registry->begin(); iter != registry->end(); ++iter) { 1932 const MutationObserverRegistration& registration = **iter; 1933 if (registration.shouldReceiveMutationFrom(target, type, attributeName)) { 1934 MutationRecordDeliveryOptions deliveryOptions = registration.deliveryOptions(); 1935 HashMap<MutationObserver*, MutationRecordDeliveryOptions>::AddResult result = observers.add(registration.observer(), deliveryOptions); 1933 1936 if (!result.isNewEntry) 1934 1937 result.iterator->value |= deliveryOptions; … … 2004 2007 2005 2008 for (Node* node = parentNode(); node; node = node->parentNode()) { 2006 if ( auto* registry = node->mutationObserverRegistry()) {2009 if (Vector<OwnPtr<MutationObserverRegistration>>* registry = node->mutationObserverRegistry()) { 2007 2010 const size_t size = registry->size(); 2008 2011 for (size_t i = 0; i < size; ++i) … … 2010 2013 } 2011 2014 2012 if ( auto* transientRegistry = node->transientMutationObserverRegistry()) {2013 for ( auto* registration : *transientRegistry)2014 registration->observedSubtreeNodeWillDetach(this);2015 if (HashSet<MutationObserverRegistration*>* transientRegistry = node->transientMutationObserverRegistry()) { 2016 for (HashSet<MutationObserverRegistration*>::iterator iter = transientRegistry->begin(); iter != transientRegistry->end(); ++iter) 2017 (*iter)->observedSubtreeNodeWillDetach(this); 2015 2018 } 2016 2019 } -
trunk/Source/WebCore/dom/NodeRareData.h
r161096 r161097 229 229 230 230 if (oldDocument != newDocument) { 231 for (auto* list : m_atomicNameCaches.values()) { 232 oldDocument->unregisterNodeList(*list); 233 newDocument->registerNodeList(*list); 231 for (auto it = m_atomicNameCaches.begin(), end = m_atomicNameCaches.end(); it != end; ++it) { 232 LiveNodeList& list = *it->value; 233 oldDocument->unregisterNodeList(list); 234 newDocument->registerNodeList(list); 234 235 } 235 236 236 for (auto* list : m_nameCaches.values()) { 237 oldDocument->unregisterNodeList(*list); 238 newDocument->registerNodeList(*list); 237 for (auto it = m_nameCaches.begin(), end = m_nameCaches.end(); it != end; ++it) { 238 LiveNodeList& list = *it->value; 239 oldDocument->unregisterNodeList(list); 240 newDocument->registerNodeList(list); 239 241 } 240 242 241 for (auto* list : m_tagNodeListCacheNS.values()) { 242 ASSERT(!list->isRootedAtDocument()); 243 oldDocument->unregisterNodeList(*list); 244 newDocument->registerNodeList(*list); 243 for (auto it = m_tagNodeListCacheNS.begin(), end = m_tagNodeListCacheNS.end(); it != end; ++it) { 244 LiveNodeList& list = *it->value; 245 ASSERT(!list.isRootedAtDocument()); 246 oldDocument->unregisterNodeList(list); 247 newDocument->registerNodeList(list); 245 248 } 246 249 247 for (auto collection : m_cachedCollections.values()) { 248 oldDocument->unregisterCollection(*collection); 249 newDocument->registerCollection(*collection); 250 for (auto it = m_cachedCollections.begin(), end = m_cachedCollections.end(); it != end; ++it) { 251 HTMLCollection& collection = *it->value; 252 oldDocument->unregisterCollection(collection); 253 newDocument->registerCollection(collection); 250 254 } 251 255 } -
trunk/Source/WebCore/dom/ScriptExecutionContext.cpp
r161096 r161097 104 104 { 105 105 m_inDestructor = true; 106 for (auto* observer : m_destructionObservers) { 106 for (HashSet<ContextDestructionObserver*>::iterator iter = m_destructionObservers.begin(); iter != m_destructionObservers.end(); iter = m_destructionObservers.begin()) { 107 ContextDestructionObserver* observer = *iter; 107 108 m_destructionObservers.remove(observer); 108 109 ASSERT(observer->scriptExecutionContext() == this); … … 110 111 } 111 112 112 for (auto* port : m_messagePorts) { 113 ASSERT(port->scriptExecutionContext() == this); 114 port->contextDestroyed(); 113 HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end(); 114 for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) { 115 ASSERT((*iter)->scriptExecutionContext() == this); 116 (*iter)->contextDestroyed(); 115 117 } 116 118 #if ENABLE(BLOB) … … 165 167 // No protection against m_activeDOMObjects changing during iteration: canSuspend() shouldn't execute arbitrary JS. 166 168 m_iteratingActiveDOMObjects = true; 167 for (auto* activeDOMObject : m_activeDOMObjects) { 168 ASSERT(activeDOMObject->scriptExecutionContext() == this); 169 ASSERT(activeDOMObject->suspendIfNeededCalled()); 170 if (!activeDOMObject->canSuspend()) { 169 ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); 170 for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) { 171 ASSERT((*iter)->scriptExecutionContext() == this); 172 ASSERT((*iter)->suspendIfNeededCalled()); 173 if (!(*iter)->canSuspend()) { 171 174 m_iteratingActiveDOMObjects = false; 172 175 return false; … … 188 191 // No protection against m_activeDOMObjects changing during iteration: suspend() shouldn't execute arbitrary JS. 189 192 m_iteratingActiveDOMObjects = true; 190 for (auto* activeDOMObject : m_activeDOMObjects) { 191 ASSERT(activeDOMObject->scriptExecutionContext() == this); 192 ASSERT(activeDOMObject->suspendIfNeededCalled()); 193 activeDOMObject->suspend(why); 193 ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); 194 for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) { 195 ASSERT((*iter)->scriptExecutionContext() == this); 196 ASSERT((*iter)->suspendIfNeededCalled()); 197 (*iter)->suspend(why); 194 198 } 195 199 m_iteratingActiveDOMObjects = false; … … 206 210 // No protection against m_activeDOMObjects changing during iteration: resume() shouldn't execute arbitrary JS. 207 211 m_iteratingActiveDOMObjects = true; 208 for (auto* activeDOMObject : m_activeDOMObjects) { 209 ASSERT(activeDOMObject->scriptExecutionContext() == this); 210 ASSERT(activeDOMObject->suspendIfNeededCalled()); 211 activeDOMObject->resume(); 212 ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); 213 for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) { 214 ASSERT((*iter)->scriptExecutionContext() == this); 215 ASSERT((*iter)->suspendIfNeededCalled()); 216 (*iter)->resume(); 212 217 } 213 218 m_iteratingActiveDOMObjects = false; … … 221 226 // No protection against m_activeDOMObjects changing during iteration: stop() shouldn't execute arbitrary JS. 222 227 m_iteratingActiveDOMObjects = true; 223 for (auto* activeDOMObject : m_activeDOMObjects) { 224 ASSERT(activeDOMObject->scriptExecutionContext() == this); 225 ASSERT(activeDOMObject->suspendIfNeededCalled()); 226 activeDOMObject->stop(); 228 ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end(); 229 for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) { 230 ASSERT((*iter)->scriptExecutionContext() == this); 231 ASSERT((*iter)->suspendIfNeededCalled()); 232 (*iter)->stop(); 227 233 } 228 234 m_iteratingActiveDOMObjects = false; … … 272 278 } 273 279 274 void ScriptExecutionContext::closeMessagePorts() 275 { 276 for ( auto* port : m_messagePorts) {277 ASSERT( port->scriptExecutionContext() == this);278 port->close();280 void ScriptExecutionContext::closeMessagePorts() { 281 HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end(); 282 for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) { 283 ASSERT((*iter)->scriptExecutionContext() == this); 284 (*iter)->close(); 279 285 } 280 286 } … … 368 374 { 369 375 if (minimumTimerInterval() != oldMinimumTimerInterval) { 370 for (auto* timer : m_timeouts.values()) 376 for (TimeoutMap::iterator iter = m_timeouts.begin(); iter != m_timeouts.end(); ++iter) { 377 DOMTimer* timer = iter->value; 371 378 timer->adjustMinimumTimerInterval(oldMinimumTimerInterval); 379 } 372 380 } 373 381 } … … 385 393 void ScriptExecutionContext::didChangeTimerAlignmentInterval() 386 394 { 387 for (auto* timer : m_timeouts.values()) 395 for (TimeoutMap::iterator iter = m_timeouts.begin(); iter != m_timeouts.end(); ++iter) { 396 DOMTimer* timer = iter->value; 388 397 timer->didChangeAlignmentInterval(); 398 } 389 399 } 390 400 -
trunk/Source/WebCore/dom/WebKitNamedFlow.cpp
r161096 r161097 131 131 132 132 if (inFlowThread(contentNode->renderer(), m_parentFlowThread)) { 133 for (auto* region : m_parentFlowThread->renderRegionList()) { 133 const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); 134 for (auto iter = regionList.begin(), end = regionList.end(); iter != end; ++iter) { 134 135 // FIXME: Pseudo-elements are not included in the list. 135 136 // They will be included when we will properly support the Region interface 136 137 // http://dev.w3.org/csswg/css-regions/#the-region-interface 137 const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment( region);138 const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter); 138 139 if (renderRegion->isPseudoElementRegion()) 139 140 continue; … … 159 160 160 161 Vector<Ref<Element>> regionElements; 161 for (auto region : m_parentFlowThread->renderRegionList()) { 162 163 const RenderRegionList& regionList = m_parentFlowThread->renderRegionList(); 164 for (auto iter = regionList.begin(), end = regionList.end(); iter != end; ++iter) { 162 165 // FIXME: Pseudo-elements are not included in the list. 163 166 // They will be included when we will properly support the Region interface 164 167 // http://dev.w3.org/csswg/css-regions/#the-region-interface 165 const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment( region);168 const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter); 166 169 if (renderRegion->isPseudoElementRegion()) 167 170 continue; … … 184 187 185 188 Vector<Ref<Element>> contentElements; 186 for (auto* element : m_parentFlowThread->contentElements()) { 189 190 const NamedFlowContentElements& contentElementsList = m_parentFlowThread->contentElements(); 191 for (auto it = contentElementsList.begin(), end = contentElementsList.end(); it != end; ++it) { 192 Element* element = *it; 187 193 ASSERT(element->computedStyle()->flowThread() == m_parentFlowThread->flowThreadName()); 188 194 contentElements.append(*element);
Note:
See TracChangeset
for help on using the changeset viewer.