Changeset 161097 in webkit


Ignore:
Timestamp:
Dec 27, 2013, 12:26:42 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r161096.
http://trac.webkit.org/changeset/161096
https://bugs.webkit.org/show_bug.cgi?id=126256

Made lots of tests crash (Requested by ap on #webkit).

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::willRemoveChildren):
(WebCore::ContainerNode::appendChild):

  • dom/Document.cpp:

(WebCore::Document::visibilityStateChanged):
(WebCore::Document::moveNodeIteratorsToNewDocument):
(WebCore::Document::updateRangesAfterChildrenChanged):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::textInserted):
(WebCore::Document::textRemoved):
(WebCore::Document::textNodesMerged):
(WebCore::Document::textNodeSplit):
(WebCore::Document::documentWillSuspendForPageCache):
(WebCore::Document::documentDidResumeFromPageCache):
(WebCore::Document::mediaVolumeDidChange):
(WebCore::Document::privateBrowsingStateDidChange):
(WebCore::Document::captionPreferencesChanged):
(WebCore::Document::validateAutoSizingNodes):
(WebCore::Document::resetAutoSizingNodes):
(WebCore::Document::webkitExitFullscreen):

  • dom/MutationObserver.cpp:

(WebCore::MutationObserver::disconnect):
(WebCore::MutationObserver::getObservedNodes):
(WebCore::MutationObserver::deliver):

  • dom/MutationObserverInterestGroup.cpp:

(WebCore::MutationObserverInterestGroup::isOldValueRequested):
(WebCore::MutationObserverInterestGroup::enqueueMutationRecord):

  • dom/MutationObserverRegistration.cpp:

(WebCore::MutationObserverRegistration::clearTransientRegistrations):
(WebCore::MutationObserverRegistration::addRegistrationNodesToSet):

  • dom/Node.cpp:

(WebCore::Node::dumpStatistics):
(WebCore::Document::invalidateNodeListAndCollectionCaches):
(WebCore::NodeListsNodeData::invalidateCaches):
(WebCore::Node::didMoveToNewDocument):
(WebCore::collectMatchingObserversForMutation):
(WebCore::Node::notifyMutationObserversNodeWillDetach):

  • dom/NodeRareData.h:

(WebCore::NodeListsNodeData::adoptDocument):

  • dom/ScriptExecutionContext.cpp:

(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
(WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
(WebCore::ScriptExecutionContext::stopActiveDOMObjects):
(WebCore::ScriptExecutionContext::closeMessagePorts):
(WebCore::ScriptExecutionContext::adjustMinimumTimerInterval):
(WebCore::ScriptExecutionContext::didChangeTimerAlignmentInterval):

  • dom/WebKitNamedFlow.cpp:

(WebCore::WebKitNamedFlow::getRegionsByContent):
(WebCore::WebKitNamedFlow::getRegions):
(WebCore::WebKitNamedFlow::getContent):

Location:
trunk/Source/WebCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r161096 r161097  
     12013-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
    1652013-12-26  Sam Weinig  <sam@webkit.org>
    266
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r161096 r161097  
    302302
    303303    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
    305307        // Due to arbitrary code running in response to a DOM mutation event it's
    306308        // possible that "next" is no longer a child of "this".
     
    309311        if (next->parentNode() != this)
    310312            break;
    311         if (child->parentNode())
     313        if (child.parentNode())
    312314            break;
    313315
    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);
    319321    }
    320322
     
    456458
    457459    // 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
    459463        // Due to arbitrary code running in response to a DOM mutation event it's
    460464        // possible that "next" is no longer a child of "this".
     
    463467        if (next && next->parentNode() != this)
    464468            break;
    465         if (child->parentNode())
     469        if (child.parentNode())
    466470            break;
    467471
    468         treeScope().adoptIfNeeded(&child.get());
     472        treeScope().adoptIfNeeded(&child);
    469473
    470474        // Add child before "next".
     
    472476            NoEventDispatchAssertion assertNoEventDispatch;
    473477            if (next)
    474                 insertBeforeCommon(*next, child.get());
     478                insertBeforeCommon(*next, child);
    475479            else
    476                 appendChildToContainer(&child.get(), *this);
     480                appendChildToContainer(&child, *this);
    477481        }
    478482
    479         updateTreeAfterInsertion(child.get());
     483        updateTreeAfterInsertion(child);
    480484    }
    481485
     
    502506
    503507    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();
    507512
    508513        // fire removed from document mutation events.
    509         dispatchChildRemovalEvents(child.get());
     514        dispatchChildRemovalEvents(child);
    510515    }
    511516
     
    705710    // Now actually add the child(ren)
    706711    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
    708715        // If the child has a parent again, just stop what we're doing, because
    709716        // that means someone is doing something with DOM mutation -- can't re-parent
    710717        // a child that already has a parent.
    711         if (child->parentNode())
     718        if (child.parentNode())
    712719            break;
    713720
    714         treeScope().adoptIfNeeded(&child.get());
     721        treeScope().adoptIfNeeded(&child);
    715722
    716723        // Append child to the end of the list
    717724        {
    718725            NoEventDispatchAssertion assertNoEventDispatch;
    719             appendChildToContainer(&child.get(), *this);
     726            appendChildToContainer(&child, *this);
    720727        }
    721728
    722         updateTreeAfterInsertion(child.get());
     729        updateTreeAfterInsertion(child);
    723730    }
    724731
  • trunk/Source/WebCore/dom/Document.cpp

    r161096 r161097  
    15541554{
    15551555    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();
    15581558}
    15591559
     
    35313531void Document::moveNodeIteratorsToNewDocument(Node* node, Document* newDocument)
    35323532{
    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);
    35383539        }
    35393540    }
     
    35433544{
    35443545    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);
    35473548    }
    35483549}
     
    35513552{
    35523553    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) {
    35583559        for (Node* n = container.firstChild(); n; n = n->nextSibling())
    3559             nodeIterator->nodeWillBeRemoved(n);
     3560            (*it)->nodeWillBeRemoved(n);
    35603561    }
    35613562
     
    35713572void Document::nodeWillBeRemoved(Node* n)
    35723573{
    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);
    35753577
    35763578    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);
    35793582    }
    35803583
     
    35893592{
    35903593    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);
    35933597    }
    35943598
     
    36003604{
    36013605    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);
    36043609    }
    36053610
     
    36133618    if (!m_ranges.isEmpty()) {
    36143619        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);
    36173623    }
    36183624
     
    36233629{
    36243630    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);
    36273634    }
    36283635
     
    40894096    documentWillBecomeInactive();
    40904097
    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();
    40934101
    40944102#ifndef NDEBUG
     
    41034111    Vector<Element*> elements;
    41044112    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();
    41074116
    41084117#if USE(ACCELERATED_COMPOSITING)
     
    41304139void Document::mediaVolumeDidChange()
    41314140{
    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();
    41344144}
    41354145
     
    41524162void Document::privateBrowsingStateDidChange()
    41534163{
    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();
    41564167}
    41574168
     
    41824193void Document::captionPreferencesChanged()
    41834194{
    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();
    41864198}
    41874199#endif
     
    48314843{
    48324844    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;
    48354847        // Update all the nodes in the collection to reflect the new
    48364848        // candidate size.
     
    48404852        value->adjustNodeSizes();
    48414853        if (!value->numNodes())
    4842             nodesForRemoval.append(autoSizingKeyValuePair.key);
     4854            nodesForRemoval.append(it->key);
    48434855    }
    48444856    unsigned count = nodesForRemoval.size();
     
    48494861void Document::resetAutoSizingNodes()
    48504862{
    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();
    48544867    }
    48554868    m_textAutoSizedNodes.clear();
     
    52885301    // 4. For each descendant in descendants, empty descendant's fullscreen element stack, and queue a
    52895302    // 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());
    52935306    }
    52945307
  • trunk/Source/WebCore/dom/MutationObserver.cpp

    r161096 r161097  
    119119    m_records.clear();
    120120    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);
    123123}
    124124
     
    165165{
    166166    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);
    169169    return observedNodes;
    170170}
     
    182182    // to make a copy of the transient registrations before operating on them.
    183183    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);
    187187    }
    188188    for (size_t i = 0; i < transientRegistrations.size(); ++i)
  • trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp

    r161096 r161097  
    5858bool MutationObserverInterestGroup::isOldValueRequested()
    5959{
    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))
    6262            return true;
    6363    }
     
    6969    RefPtr<MutationRecord> mutation = prpMutation;
    7070    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)) {
    7474            observer->enqueueMutationRecord(mutation);
    7575            continue;
  • trunk/Source/WebCore/dom/MutationObserverRegistration.cpp

    r161096 r161097  
    8888    }
    8989
    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);
    9292
    9393    m_transientRegistrationNodes.clear();
     
    127127    if (!m_transientRegistrationNodes)
    128128        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());
    131131}
    132132
  • trunk/Source/WebCore/dom/Node.cpp

    r161096 r161097  
    132132    size_t elementsWithNamedNodeMap = 0;
    133133
    134     for (auto* node : liveNodeSet) {
     134    for (HashSet<Node*>::iterator it = liveNodeSet.begin(); it != liveNodeSet.end(); ++it) {
     135        Node* node = *it;
     136
    135137        if (node->hasRareData()) {
    136138            ++nodesWithRareData;
     
    238240
    239241    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);
    242244
    243245    printf("Attributes:\n");
     
    726728void Document::invalidateNodeListAndCollectionCaches(const QualifiedName* attrName)
    727729{
    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);
    732734}
    733735
     
    17001702void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName)
    17011703{
    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);
    17101712
    17111713    if (attrName)
    17121714        return;
    17131715
    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();
    17161718}
    17171719
     
    17771779    }
    17781780
    1779     if (auto* registry = mutationObserverRegistry()) {
     1781    if (Vector<OwnPtr<MutationObserverRegistration>>* registry = mutationObserverRegistry()) {
    17801782        for (size_t i = 0; i < registry->size(); ++i) {
    17811783            document().addMutationObserverTypes(registry->at(i)->mutationTypes());
     
    17831785    }
    17841786
    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        }
    17881791    }
    17891792}
     
    19261929    if (!registry)
    19271930        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);
    19331936            if (!result.isNewEntry)
    19341937                result.iterator->value |= deliveryOptions;
     
    20042007
    20052008    for (Node* node = parentNode(); node; node = node->parentNode()) {
    2006         if (auto* registry = node->mutationObserverRegistry()) {
     2009        if (Vector<OwnPtr<MutationObserverRegistration>>* registry = node->mutationObserverRegistry()) {
    20072010            const size_t size = registry->size();
    20082011            for (size_t i = 0; i < size; ++i)
     
    20102013        }
    20112014
    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);
    20152018        }
    20162019    }
  • trunk/Source/WebCore/dom/NodeRareData.h

    r161096 r161097  
    229229
    230230        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);
    234235            }
    235236
    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);
    239241            }
    240242
    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);
    245248            }
    246249
    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);
    250254            }
    251255        }
  • trunk/Source/WebCore/dom/ScriptExecutionContext.cpp

    r161096 r161097  
    104104{
    105105    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;
    107108        m_destructionObservers.remove(observer);
    108109        ASSERT(observer->scriptExecutionContext() == this);
     
    110111    }
    111112
    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();
    115117    }
    116118#if ENABLE(BLOB)
     
    165167    // No protection against m_activeDOMObjects changing during iteration: canSuspend() shouldn't execute arbitrary JS.
    166168    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()) {
    171174            m_iteratingActiveDOMObjects = false;
    172175            return false;
     
    188191    // No protection against m_activeDOMObjects changing during iteration: suspend() shouldn't execute arbitrary JS.
    189192    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);
    194198    }
    195199    m_iteratingActiveDOMObjects = false;
     
    206210    // No protection against m_activeDOMObjects changing during iteration: resume() shouldn't execute arbitrary JS.
    207211    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();
    212217    }
    213218    m_iteratingActiveDOMObjects = false;
     
    221226    // No protection against m_activeDOMObjects changing during iteration: stop() shouldn't execute arbitrary JS.
    222227    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();
    227233    }
    228234    m_iteratingActiveDOMObjects = false;
     
    272278}
    273279
    274 void ScriptExecutionContext::closeMessagePorts()
    275 {
    276     for (auto* port : m_messagePorts) {
    277         ASSERT(port->scriptExecutionContext() == this);
    278         port->close();
     280void 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();
    279285    }
    280286}
     
    368374{
    369375    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;
    371378            timer->adjustMinimumTimerInterval(oldMinimumTimerInterval);
     379        }
    372380    }
    373381}
     
    385393void ScriptExecutionContext::didChangeTimerAlignmentInterval()
    386394{
    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;
    388397        timer->didChangeAlignmentInterval();
     398    }
    389399}
    390400
  • trunk/Source/WebCore/dom/WebKitNamedFlow.cpp

    r161096 r161097  
    131131
    132132    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) {
    134135            // FIXME: Pseudo-elements are not included in the list.
    135136            // They will be included when we will properly support the Region interface
    136137            // http://dev.w3.org/csswg/css-regions/#the-region-interface
    137             const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(region);
     138            const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter);
    138139            if (renderRegion->isPseudoElementRegion())
    139140                continue;
     
    159160
    160161    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) {
    162165        // FIXME: Pseudo-elements are not included in the list.
    163166        // They will be included when we will properly support the Region interface
    164167        // http://dev.w3.org/csswg/css-regions/#the-region-interface
    165         const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(region);
     168        const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter);
    166169        if (renderRegion->isPseudoElementRegion())
    167170            continue;
     
    184187
    185188    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;
    187193        ASSERT(element->computedStyle()->flowThread() == m_parentFlowThread->flowThreadName());
    188194        contentElements.append(*element);
Note: See TracChangeset for help on using the changeset viewer.