<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[161096] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/161096">161096</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2013-12-26 18:55:57 -0800 (Thu, 26 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Convert some of WebCore/dom over to range-for loops
https://bugs.webkit.org/show_bug.cgi?id=126250
Reviewed by Andreas Kling.
* dom/ContainerNode.cpp:
* dom/Document.cpp:
* dom/MutationObserver.cpp:
* dom/MutationObserverInterestGroup.cpp:
* dom/MutationObserverRegistration.cpp:
* dom/Node.cpp:
* dom/NodeRareData.h:
* dom/ScriptExecutionContext.cpp:
* dom/WebKitNamedFlow.cpp:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomContainerNodecpp">trunk/Source/WebCore/dom/ContainerNode.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMutationObservercpp">trunk/Source/WebCore/dom/MutationObserver.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMutationObserverInterestGroupcpp">trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMutationObserverRegistrationcpp">trunk/Source/WebCore/dom/MutationObserverRegistration.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodeRareDatah">trunk/Source/WebCore/dom/NodeRareData.h</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContextcpp">trunk/Source/WebCore/dom/ScriptExecutionContext.cpp</a></li>
<li><a href="#trunkSourceWebCoredomWebKitNamedFlowcpp">trunk/Source/WebCore/dom/WebKitNamedFlow.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/ChangeLog        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2013-12-26 Sam Weinig <sam@webkit.org>
+
+ Convert some of WebCore/dom over to range-for loops
+ https://bugs.webkit.org/show_bug.cgi?id=126250
+
+ Reviewed by Andreas Kling.
+
+ * dom/ContainerNode.cpp:
+ * dom/Document.cpp:
+ * dom/MutationObserver.cpp:
+ * dom/MutationObserverInterestGroup.cpp:
+ * dom/MutationObserverRegistration.cpp:
+ * dom/Node.cpp:
+ * dom/NodeRareData.h:
+ * dom/ScriptExecutionContext.cpp:
+ * dom/WebKitNamedFlow.cpp:
+
</ins><span class="cx"> 2013-12-26 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
</span><span class="cx">
</span><span class="cx"> [Nix] Cleanup Source/WebCore/PlatformNix.cmake
</span></span></pre></div>
<a id="trunkSourceWebCoredomContainerNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ContainerNode.cpp        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -301,23 +301,21 @@
</span><span class="cx"> InspectorInstrumentation::willInsertDOMNode(&document(), this);
</span><span class="cx">
</span><span class="cx"> ChildListMutationScope mutation(*this);
</span><del>- for (auto it = targets.begin(), end = targets.end(); it != end; ++it) {
- Node& child = it->get();
-
</del><ins>+ for (auto& child : targets) {
</ins><span class="cx"> // Due to arbitrary code running in response to a DOM mutation event it's
</span><span class="cx"> // possible that "next" is no longer a child of "this".
</span><span class="cx"> // It's also possible that "child" has been inserted elsewhere.
</span><span class="cx"> // In either of those cases, we'll just stop.
</span><span class="cx"> if (next->parentNode() != this)
</span><span class="cx"> break;
</span><del>- if (child.parentNode())
</del><ins>+ if (child->parentNode())
</ins><span class="cx"> break;
</span><span class="cx">
</span><del>- treeScope().adoptIfNeeded(&child);
</del><ins>+ treeScope().adoptIfNeeded(&child.get());
</ins><span class="cx">
</span><del>- insertBeforeCommon(next.get(), child);
</del><ins>+ insertBeforeCommon(next.get(), child.get());
</ins><span class="cx">
</span><del>- updateTreeAfterInsertion(child);
</del><ins>+ updateTreeAfterInsertion(child.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> dispatchSubtreeModifiedEvent();
</span><span class="lines">@@ -457,30 +455,28 @@
</span><span class="cx"> InspectorInstrumentation::willInsertDOMNode(&document(), this);
</span><span class="cx">
</span><span class="cx"> // Add the new child(ren)
</span><del>- for (auto it = targets.begin(), end = targets.end(); it != end; ++it) {
- Node& child = it->get();
-
</del><ins>+ for (auto& child : targets) {
</ins><span class="cx"> // Due to arbitrary code running in response to a DOM mutation event it's
</span><span class="cx"> // possible that "next" is no longer a child of "this".
</span><span class="cx"> // It's also possible that "child" has been inserted elsewhere.
</span><span class="cx"> // In either of those cases, we'll just stop.
</span><span class="cx"> if (next && next->parentNode() != this)
</span><span class="cx"> break;
</span><del>- if (child.parentNode())
</del><ins>+ if (child->parentNode())
</ins><span class="cx"> break;
</span><span class="cx">
</span><del>- treeScope().adoptIfNeeded(&child);
</del><ins>+ treeScope().adoptIfNeeded(&child.get());
</ins><span class="cx">
</span><span class="cx"> // Add child before "next".
</span><span class="cx"> {
</span><span class="cx"> NoEventDispatchAssertion assertNoEventDispatch;
</span><span class="cx"> if (next)
</span><del>- insertBeforeCommon(*next, child);
</del><ins>+ insertBeforeCommon(*next, child.get());
</ins><span class="cx"> else
</span><del>- appendChildToContainer(&child, *this);
</del><ins>+ appendChildToContainer(&child.get(), *this);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- updateTreeAfterInsertion(child);
</del><ins>+ updateTreeAfterInsertion(child.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> dispatchSubtreeModifiedEvent();
</span><span class="lines">@@ -505,13 +501,12 @@
</span><span class="cx"> getChildNodes(container, children);
</span><span class="cx">
</span><span class="cx"> ChildListMutationScope mutation(container);
</span><del>- for (auto it = children.begin(); it != children.end(); ++it) {
- Node& child = it->get();
- mutation.willRemoveChild(child);
- child.notifyMutationObserversNodeWillDetach();
</del><ins>+ for (auto& child : children) {
+ mutation.willRemoveChild(child.get());
+ child->notifyMutationObserversNodeWillDetach();
</ins><span class="cx">
</span><span class="cx"> // fire removed from document mutation events.
</span><del>- dispatchChildRemovalEvents(child);
</del><ins>+ dispatchChildRemovalEvents(child.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> container.document().nodeChildrenWillBeRemoved(container);
</span><span class="lines">@@ -709,24 +704,22 @@
</span><span class="cx">
</span><span class="cx"> // Now actually add the child(ren)
</span><span class="cx"> ChildListMutationScope mutation(*this);
</span><del>- for (auto it = targets.begin(), end = targets.end(); it != end; ++it) {
- Node& child = it->get();
-
</del><ins>+ for (auto& child : targets) {
</ins><span class="cx"> // If the child has a parent again, just stop what we're doing, because
</span><span class="cx"> // that means someone is doing something with DOM mutation -- can't re-parent
</span><span class="cx"> // a child that already has a parent.
</span><del>- if (child.parentNode())
</del><ins>+ if (child->parentNode())
</ins><span class="cx"> break;
</span><span class="cx">
</span><del>- treeScope().adoptIfNeeded(&child);
</del><ins>+ treeScope().adoptIfNeeded(&child.get());
</ins><span class="cx">
</span><span class="cx"> // Append child to the end of the list
</span><span class="cx"> {
</span><span class="cx"> NoEventDispatchAssertion assertNoEventDispatch;
</span><del>- appendChildToContainer(&child, *this);
</del><ins>+ appendChildToContainer(&child.get(), *this);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- updateTreeAfterInsertion(child);
</del><ins>+ updateTreeAfterInsertion(child.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> dispatchSubtreeModifiedEvent();
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/Document.cpp        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -1553,8 +1553,8 @@
</span><span class="cx"> void Document::visibilityStateChanged()
</span><span class="cx"> {
</span><span class="cx"> dispatchEvent(Event::create(eventNames().visibilitychangeEvent, false, false));
</span><del>- for (auto it = m_visibilityStateCallbackElements.begin(); it != m_visibilityStateCallbackElements.end(); ++it)
- (*it)->visibilityStateChanged();
</del><ins>+ for (auto* element : m_visibilityStateCallbackElements)
+ element->visibilityStateChanged();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PageVisibilityState Document::pageVisibilityState() const
</span><span class="lines">@@ -3530,12 +3530,11 @@
</span><span class="cx">
</span><span class="cx"> void Document::moveNodeIteratorsToNewDocument(Node* node, Document* newDocument)
</span><span class="cx"> {
</span><del>- HashSet<NodeIterator*> nodeIteratorsList = m_nodeIterators;
- HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = nodeIteratorsList.end();
- for (HashSet<NodeIterator*>::const_iterator it = nodeIteratorsList.begin(); it != nodeIteratorsEnd; ++it) {
- if ((*it)->root() == node) {
- detachNodeIterator(*it);
- newDocument->attachNodeIterator(*it);
</del><ins>+ HashSet<NodeIterator*> nodeIteratorsCopy = m_nodeIterators;
+ for (auto* nodeIterator : nodeIteratorsCopy) {
+ if (nodeIterator->root() == node) {
+ detachNodeIterator(nodeIterator);
+ newDocument->attachNodeIterator(nodeIterator);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -3543,21 +3542,21 @@
</span><span class="cx"> void Document::updateRangesAfterChildrenChanged(ContainerNode& container)
</span><span class="cx"> {
</span><span class="cx"> if (!m_ranges.isEmpty()) {
</span><del>- for (auto it = m_ranges.begin(), end = m_ranges.end(); it != end; ++it)
- (*it)->nodeChildrenChanged(container);
</del><ins>+ for (auto* range : m_ranges)
+ range->nodeChildrenChanged(container);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::nodeChildrenWillBeRemoved(ContainerNode& container)
</span><span class="cx"> {
</span><span class="cx"> if (!m_ranges.isEmpty()) {
</span><del>- for (auto it = m_ranges.begin(), end = m_ranges.end(); it != end; ++it)
- (*it)->nodeChildrenWillBeRemoved(container);
</del><ins>+ for (auto* range : m_ranges)
+ range->nodeChildrenWillBeRemoved(container);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto it = m_nodeIterators.begin(), end = m_nodeIterators.end(); it != end; ++it) {
</del><ins>+ for (auto* nodeIterator : m_nodeIterators) {
</ins><span class="cx"> for (Node* n = container.firstChild(); n; n = n->nextSibling())
</span><del>- (*it)->nodeWillBeRemoved(n);
</del><ins>+ nodeIterator->nodeWillBeRemoved(n);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (Frame* frame = this->frame()) {
</span><span class="lines">@@ -3571,14 +3570,12 @@
</span><span class="cx">
</span><span class="cx"> void Document::nodeWillBeRemoved(Node* n)
</span><span class="cx"> {
</span><del>- HashSet<NodeIterator*>::const_iterator nodeIteratorsEnd = m_nodeIterators.end();
- for (HashSet<NodeIterator*>::const_iterator it = m_nodeIterators.begin(); it != nodeIteratorsEnd; ++it)
- (*it)->nodeWillBeRemoved(n);
</del><ins>+ for (auto* nodeIterator : m_nodeIterators)
+ nodeIterator->nodeWillBeRemoved(n);
</ins><span class="cx">
</span><span class="cx"> if (!m_ranges.isEmpty()) {
</span><del>- HashSet<Range*>::const_iterator rangesEnd = m_ranges.end();
- for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != rangesEnd; ++it)
- (*it)->nodeWillBeRemoved(n);
</del><ins>+ for (auto* range : m_ranges)
+ range->nodeWillBeRemoved(n);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (Frame* frame = this->frame()) {
</span><span class="lines">@@ -3591,9 +3588,8 @@
</span><span class="cx"> void Document::textInserted(Node* text, unsigned offset, unsigned length)
</span><span class="cx"> {
</span><span class="cx"> if (!m_ranges.isEmpty()) {
</span><del>- HashSet<Range*>::const_iterator end = m_ranges.end();
- for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
- (*it)->textInserted(text, offset, length);
</del><ins>+ for (auto* range : m_ranges)
+ range->textInserted(text, offset, length);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Update the markers for spelling and grammar checking.
</span><span class="lines">@@ -3603,9 +3599,8 @@
</span><span class="cx"> void Document::textRemoved(Node* text, unsigned offset, unsigned length)
</span><span class="cx"> {
</span><span class="cx"> if (!m_ranges.isEmpty()) {
</span><del>- HashSet<Range*>::const_iterator end = m_ranges.end();
- for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
- (*it)->textRemoved(text, offset, length);
</del><ins>+ for (auto* range : m_ranges)
+ range->textRemoved(text, offset, length);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Update the markers for spelling and grammar checking.
</span><span class="lines">@@ -3617,9 +3612,8 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_ranges.isEmpty()) {
</span><span class="cx"> NodeWithIndex oldNodeWithIndex(oldNode);
</span><del>- HashSet<Range*>::const_iterator end = m_ranges.end();
- for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
- (*it)->textNodesMerged(oldNodeWithIndex, offset);
</del><ins>+ for (auto* range : m_ranges)
+ range->textNodesMerged(oldNodeWithIndex, offset);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // FIXME: This should update markers for spelling and grammar checking.
</span><span class="lines">@@ -3628,9 +3622,8 @@
</span><span class="cx"> void Document::textNodeSplit(Text* oldNode)
</span><span class="cx"> {
</span><span class="cx"> if (!m_ranges.isEmpty()) {
</span><del>- HashSet<Range*>::const_iterator end = m_ranges.end();
- for (HashSet<Range*>::const_iterator it = m_ranges.begin(); it != end; ++it)
- (*it)->textNodeSplit(oldNode);
</del><ins>+ for (auto* range : m_ranges)
+ range->textNodeSplit(oldNode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // FIXME: This should update markers for spelling and grammar checking.
</span><span class="lines">@@ -4095,9 +4088,8 @@
</span><span class="cx"> {
</span><span class="cx"> documentWillBecomeInactive();
</span><span class="cx">
</span><del>- HashSet<Element*>::iterator end = m_documentSuspensionCallbackElements.end();
- for (HashSet<Element*>::iterator i = m_documentSuspensionCallbackElements.begin(); i != end; ++i)
- (*i)->documentWillSuspendForPageCache();
</del><ins>+ for (auto* element : m_documentSuspensionCallbackElements)
+ element->documentWillSuspendForPageCache();
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> // Clear the update flag to be able to check if the viewport arguments update
</span><span class="lines">@@ -4110,9 +4102,8 @@
</span><span class="cx"> {
</span><span class="cx"> Vector<Element*> elements;
</span><span class="cx"> copyToVector(m_documentSuspensionCallbackElements, elements);
</span><del>- Vector<Element*>::iterator end = elements.end();
- for (Vector<Element*>::iterator i = elements.begin(); i != end; ++i)
- (*i)->documentDidResumeFromPageCache();
</del><ins>+ for (auto* element : elements)
+ element->documentDidResumeFromPageCache();
</ins><span class="cx">
</span><span class="cx"> #if USE(ACCELERATED_COMPOSITING)
</span><span class="cx"> if (renderView())
</span><span class="lines">@@ -4138,9 +4129,8 @@
</span><span class="cx">
</span><span class="cx"> void Document::mediaVolumeDidChange()
</span><span class="cx"> {
</span><del>- HashSet<Element*>::iterator end = m_mediaVolumeCallbackElements.end();
- for (HashSet<Element*>::iterator i = m_mediaVolumeCallbackElements.begin(); i != end; ++i)
- (*i)->mediaVolumeDidChange();
</del><ins>+ for (auto* element : m_mediaVolumeCallbackElements)
+ element->mediaVolumeDidChange();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::registerForMediaVolumeCallbacks(Element* e)
</span><span class="lines">@@ -4161,9 +4151,8 @@
</span><span class="cx">
</span><span class="cx"> void Document::privateBrowsingStateDidChange()
</span><span class="cx"> {
</span><del>- HashSet<Element*>::iterator end = m_privateBrowsingStateChangedElements.end();
- for (HashSet<Element*>::iterator it = m_privateBrowsingStateChangedElements.begin(); it != end; ++it)
- (*it)->privateBrowsingStateDidChange();
</del><ins>+ for (auto* element : m_privateBrowsingStateChangedElements)
+ element->privateBrowsingStateDidChange();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::registerForPrivateBrowsingStateChangedCallbacks(Element* e)
</span><span class="lines">@@ -4192,9 +4181,8 @@
</span><span class="cx">
</span><span class="cx"> void Document::captionPreferencesChanged()
</span><span class="cx"> {
</span><del>- HashSet<Element*>::iterator end = m_captionPreferencesChangedElements.end();
- for (HashSet<Element*>::iterator it = m_captionPreferencesChangedElements.begin(); it != end; ++it)
- (*it)->captionPreferencesChanged();
</del><ins>+ for (auto* element : m_captionPreferencesChangedElements)
+ element->captionPreferencesChanged();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -4842,8 +4830,8 @@
</span><span class="cx"> void Document::validateAutoSizingNodes()
</span><span class="cx"> {
</span><span class="cx"> Vector<TextAutoSizingKey> nodesForRemoval;
</span><del>- for (auto it = m_textAutoSizedNodes.begin(), end = m_textAutoSizedNodes.end(); it != end; ++it) {
- RefPtr<TextAutoSizingValue> value = it->value;
</del><ins>+ for (auto& autoSizingKeyValuePair : m_textAutoSizedNodes) {
+ RefPtr<TextAutoSizingValue> value = autoSizingKeyValuePair.value;
</ins><span class="cx"> // Update all the nodes in the collection to reflect the new
</span><span class="cx"> // candidate size.
</span><span class="cx"> if (!value)
</span><span class="lines">@@ -4851,7 +4839,7 @@
</span><span class="cx">
</span><span class="cx"> value->adjustNodeSizes();
</span><span class="cx"> if (!value->numNodes())
</span><del>- nodesForRemoval.append(it->key);
</del><ins>+ nodesForRemoval.append(autoSizingKeyValuePair.key);
</ins><span class="cx"> }
</span><span class="cx"> unsigned count = nodesForRemoval.size();
</span><span class="cx"> for (unsigned i = 0; i < count; i++)
</span><span class="lines">@@ -4860,10 +4848,9 @@
</span><span class="cx">
</span><span class="cx"> void Document::resetAutoSizingNodes()
</span><span class="cx"> {
</span><del>- for (auto it = m_textAutoSizedNodes.begin(), end = m_textAutoSizedNodes.end(); it != end; ++it) {
- RefPtr<TextAutoSizingValue> value = it->value;
- if (value)
- value->reset();
</del><ins>+ for (auto& autoSizingValue : m_textAutoSizedNodes.values()) {
+ if (autoSizingValue)
+ autoSizingValue->reset();
</ins><span class="cx"> }
</span><span class="cx"> m_textAutoSizedNodes.clear();
</span><span class="cx"> }
</span><span class="lines">@@ -5300,9 +5287,9 @@
</span><span class="cx">
</span><span class="cx"> // 4. For each descendant in descendants, empty descendant's fullscreen element stack, and queue a
</span><span class="cx"> // task to fire an event named fullscreenchange with its bubbles attribute set to true on descendant.
</span><del>- for (Deque<RefPtr<Document>>::iterator i = descendants.begin(); i != descendants.end(); ++i) {
- (*i)->clearFullscreenElementStack();
- addDocumentToFullScreenChangeEventQueue(i->get());
</del><ins>+ for (auto& descendant : descendants) {
+ descendant->clearFullscreenElementStack();
+ addDocumentToFullScreenChangeEventQueue(descendant.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 5. While doc is not null, run these substeps:
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObservercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserver.cpp (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserver.cpp        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/MutationObserver.cpp        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -118,8 +118,8 @@
</span><span class="cx"> {
</span><span class="cx"> m_records.clear();
</span><span class="cx"> HashSet<MutationObserverRegistration*> registrations(m_registrations);
</span><del>- for (HashSet<MutationObserverRegistration*>::iterator iter = registrations.begin(); iter != registrations.end(); ++iter)
- MutationObserverRegistration::unregisterAndDelete(*iter);
</del><ins>+ for (auto* registration : registrations)
+ MutationObserverRegistration::unregisterAndDelete(registration);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MutationObserver::observationStarted(MutationObserverRegistration* registration)
</span><span class="lines">@@ -164,8 +164,8 @@
</span><span class="cx"> HashSet<Node*> MutationObserver::getObservedNodes() const
</span><span class="cx"> {
</span><span class="cx"> HashSet<Node*> observedNodes;
</span><del>- for (HashSet<MutationObserverRegistration*>::const_iterator iter = m_registrations.begin(); iter != m_registrations.end(); ++iter)
- (*iter)->addRegistrationNodesToSet(observedNodes);
</del><ins>+ for (auto* registration : m_registrations)
+ registration->addRegistrationNodesToSet(observedNodes);
</ins><span class="cx"> return observedNodes;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -181,9 +181,9 @@
</span><span class="cx"> // Calling clearTransientRegistrations() can modify m_registrations, so it's necessary
</span><span class="cx"> // to make a copy of the transient registrations before operating on them.
</span><span class="cx"> Vector<MutationObserverRegistration*, 1> transientRegistrations;
</span><del>- for (HashSet<MutationObserverRegistration*>::iterator iter = m_registrations.begin(); iter != m_registrations.end(); ++iter) {
- if ((*iter)->hasTransientRegistrations())
- transientRegistrations.append(*iter);
</del><ins>+ for (auto* registration : m_registrations) {
+ if (registration->hasTransientRegistrations())
+ transientRegistrations.append(registration);
</ins><span class="cx"> }
</span><span class="cx"> for (size_t i = 0; i < transientRegistrations.size(); ++i)
</span><span class="cx"> transientRegistrations[i]->clearTransientRegistrations();
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObserverInterestGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/MutationObserverInterestGroup.cpp        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx">
</span><span class="cx"> bool MutationObserverInterestGroup::isOldValueRequested()
</span><span class="cx"> {
</span><del>- for (HashMap<MutationObserver*, MutationRecordDeliveryOptions>::iterator iter = m_observers.begin(); iter != m_observers.end(); ++iter) {
- if (hasOldValue(iter->value))
</del><ins>+ for (auto options : m_observers.values()) {
+ if (hasOldValue(options))
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> return false;
</span><span class="lines">@@ -68,9 +68,9 @@
</span><span class="cx"> {
</span><span class="cx"> RefPtr<MutationRecord> mutation = prpMutation;
</span><span class="cx"> RefPtr<MutationRecord> mutationWithNullOldValue;
</span><del>- for (HashMap<MutationObserver*, MutationRecordDeliveryOptions>::iterator iter = m_observers.begin(); iter != m_observers.end(); ++iter) {
- MutationObserver* observer = iter->key;
- if (hasOldValue(iter->value)) {
</del><ins>+ for (auto& observerOptionsPair : m_observers) {
+ MutationObserver* observer = observerOptionsPair.key;
+ if (hasOldValue(observerOptionsPair.value)) {
</ins><span class="cx"> observer->enqueueMutationRecord(mutation);
</span><span class="cx"> continue;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomMutationObserverRegistrationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MutationObserverRegistration.cpp (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MutationObserverRegistration.cpp        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/MutationObserverRegistration.cpp        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -87,8 +87,8 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- for (NodeHashSet::iterator iter = m_transientRegistrationNodes->begin(); iter != m_transientRegistrationNodes->end(); ++iter)
- (*iter)->unregisterTransientMutationObserver(this);
</del><ins>+ for (auto& node : *m_transientRegistrationNodes)
+ node->unregisterTransientMutationObserver(this);
</ins><span class="cx">
</span><span class="cx"> m_transientRegistrationNodes.clear();
</span><span class="cx">
</span><span class="lines">@@ -126,8 +126,8 @@
</span><span class="cx"> nodes.add(m_registrationNode);
</span><span class="cx"> if (!m_transientRegistrationNodes)
</span><span class="cx"> return;
</span><del>- for (NodeHashSet::const_iterator iter = m_transientRegistrationNodes->begin(); iter != m_transientRegistrationNodes->end(); ++iter)
- nodes.add(iter->get());
</del><ins>+ for (auto& node : *m_transientRegistrationNodes)
+ nodes.add(node.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/Node.cpp        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -131,9 +131,7 @@
</span><span class="cx"> size_t elementsWithRareData = 0;
</span><span class="cx"> size_t elementsWithNamedNodeMap = 0;
</span><span class="cx">
</span><del>- for (HashSet<Node*>::iterator it = liveNodeSet.begin(); it != liveNodeSet.end(); ++it) {
- Node* node = *it;
-
</del><ins>+ for (auto* node : liveNodeSet) {
</ins><span class="cx"> if (node->hasRareData()) {
</span><span class="cx"> ++nodesWithRareData;
</span><span class="cx"> if (node->isElementNode()) {
</span><span class="lines">@@ -239,8 +237,8 @@
</span><span class="cx"> printf(" Number of ShadowRoot nodes: %zu\n", shadowRootNodes);
</span><span class="cx">
</span><span class="cx"> printf("Element tag name distibution:\n");
</span><del>- for (HashMap<String, size_t>::iterator it = perTagCount.begin(); it != perTagCount.end(); ++it)
- printf(" Number of <%s> tags: %zu\n", it->key.utf8().data(), it->value);
</del><ins>+ for (auto stringSizePair : perTagCount)
+ printf(" Number of <%s> tags: %zu\n", stringSizePair.key.utf8().data(), stringSizePair.value);
</ins><span class="cx">
</span><span class="cx"> printf("Attributes:\n");
</span><span class="cx"> printf(" Number of Attributes (non-Node and Node): %zu [%zu]\n", attributes, sizeof(Attribute));
</span><span class="lines">@@ -727,10 +725,10 @@
</span><span class="cx">
</span><span class="cx"> void Document::invalidateNodeListAndCollectionCaches(const QualifiedName* attrName)
</span><span class="cx"> {
</span><del>- for (HashSet<LiveNodeList*>::iterator it = m_listsInvalidatedAtDocument.begin(), end = m_listsInvalidatedAtDocument.end(); it != end; ++it)
- (*it)->invalidateCache(attrName);
- for (HashSet<HTMLCollection*>::iterator it = m_collectionsInvalidatedAtDocument.begin(), end = m_collectionsInvalidatedAtDocument.end(); it != end; ++it)
- (*it)->invalidateCache(attrName);
</del><ins>+ for (auto* nodeList : m_listsInvalidatedAtDocument)
+ nodeList->invalidateCache(attrName);
+ for (auto* collection : m_collectionsInvalidatedAtDocument)
+ collection->invalidateCache(attrName);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Node::invalidateNodeListAndCollectionCachesInAncestors(const QualifiedName* attrName, Element* attributeOwnerElement)
</span><span class="lines">@@ -1701,20 +1699,20 @@
</span><span class="cx">
</span><span class="cx"> void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName)
</span><span class="cx"> {
</span><del>- for (auto it = m_atomicNameCaches.begin(), end = m_atomicNameCaches.end(); it != end; ++it)
- it->value->invalidateCache(attrName);
</del><ins>+ for (auto* nodeList : m_atomicNameCaches.values())
+ nodeList->invalidateCache(attrName);
</ins><span class="cx">
</span><del>- for (auto it = m_nameCaches.begin(), end = m_nameCaches.end(); it != end; ++it)
- it->value->invalidateCache(attrName);
</del><ins>+ for (auto* nodeList : m_nameCaches.values())
+ nodeList->invalidateCache(attrName);
</ins><span class="cx">
</span><del>- for (auto it = m_cachedCollections.begin(), end = m_cachedCollections.end(); it != end; ++it)
- it->value->invalidateCache(attrName);
</del><ins>+ for (auto* collection : m_cachedCollections.values())
+ collection->invalidateCache(attrName);
</ins><span class="cx">
</span><span class="cx"> if (attrName)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- for (auto it = m_tagNodeListCacheNS.begin(), end = m_tagNodeListCacheNS.end(); it != end; ++it)
- it->value->invalidateCache();
</del><ins>+ for (auto* nodeList : m_tagNodeListCacheNS.values())
+ nodeList->invalidateCache();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Node::getSubresourceURLs(ListHashSet<URL>& urls) const
</span><span class="lines">@@ -1778,16 +1776,15 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (Vector<OwnPtr<MutationObserverRegistration>>* registry = mutationObserverRegistry()) {
</del><ins>+ if (auto* registry = mutationObserverRegistry()) {
</ins><span class="cx"> for (size_t i = 0; i < registry->size(); ++i) {
</span><span class="cx"> document().addMutationObserverTypes(registry->at(i)->mutationTypes());
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (HashSet<MutationObserverRegistration*>* transientRegistry = transientMutationObserverRegistry()) {
- for (HashSet<MutationObserverRegistration*>::iterator iter = transientRegistry->begin(); iter != transientRegistry->end(); ++iter) {
- document().addMutationObserverTypes((*iter)->mutationTypes());
- }
</del><ins>+ if (auto* transientRegistry = transientMutationObserverRegistry()) {
+ for (auto* registration : *transientRegistry)
+ document().addMutationObserverTypes(registration->mutationTypes());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1928,11 +1925,11 @@
</span><span class="cx"> {
</span><span class="cx"> if (!registry)
</span><span class="cx"> return;
</span><del>- for (typename Registry::iterator iter = registry->begin(); iter != registry->end(); ++iter) {
- const MutationObserverRegistration& registration = **iter;
- if (registration.shouldReceiveMutationFrom(target, type, attributeName)) {
- MutationRecordDeliveryOptions deliveryOptions = registration.deliveryOptions();
- HashMap<MutationObserver*, MutationRecordDeliveryOptions>::AddResult result = observers.add(registration.observer(), deliveryOptions);
</del><ins>+
+ for (auto& registration : *registry) {
+ if (registration->shouldReceiveMutationFrom(target, type, attributeName)) {
+ MutationRecordDeliveryOptions deliveryOptions = registration->deliveryOptions();
+ auto result = observers.add(registration->observer(), deliveryOptions);
</ins><span class="cx"> if (!result.isNewEntry)
</span><span class="cx"> result.iterator->value |= deliveryOptions;
</span><span class="cx"> }
</span><span class="lines">@@ -2006,15 +2003,15 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> for (Node* node = parentNode(); node; node = node->parentNode()) {
</span><del>- if (Vector<OwnPtr<MutationObserverRegistration>>* registry = node->mutationObserverRegistry()) {
</del><ins>+ if (auto* registry = node->mutationObserverRegistry()) {
</ins><span class="cx"> const size_t size = registry->size();
</span><span class="cx"> for (size_t i = 0; i < size; ++i)
</span><span class="cx"> registry->at(i)->observedSubtreeNodeWillDetach(this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (HashSet<MutationObserverRegistration*>* transientRegistry = node->transientMutationObserverRegistry()) {
- for (HashSet<MutationObserverRegistration*>::iterator iter = transientRegistry->begin(); iter != transientRegistry->end(); ++iter)
- (*iter)->observedSubtreeNodeWillDetach(this);
</del><ins>+ if (auto* transientRegistry = node->transientMutationObserverRegistry()) {
+ for (auto* registration : *transientRegistry)
+ registration->observedSubtreeNodeWillDetach(this);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeRareDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeRareData.h (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeRareData.h        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/NodeRareData.h        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -228,29 +228,25 @@
</span><span class="cx"> invalidateCaches();
</span><span class="cx">
</span><span class="cx"> if (oldDocument != newDocument) {
</span><del>- for (auto it = m_atomicNameCaches.begin(), end = m_atomicNameCaches.end(); it != end; ++it) {
- LiveNodeList& list = *it->value;
- oldDocument->unregisterNodeList(list);
- newDocument->registerNodeList(list);
</del><ins>+ for (auto* list : m_atomicNameCaches.values()) {
+ oldDocument->unregisterNodeList(*list);
+ newDocument->registerNodeList(*list);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto it = m_nameCaches.begin(), end = m_nameCaches.end(); it != end; ++it) {
- LiveNodeList& list = *it->value;
- oldDocument->unregisterNodeList(list);
- newDocument->registerNodeList(list);
</del><ins>+ for (auto* list : m_nameCaches.values()) {
+ oldDocument->unregisterNodeList(*list);
+ newDocument->registerNodeList(*list);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto it = m_tagNodeListCacheNS.begin(), end = m_tagNodeListCacheNS.end(); it != end; ++it) {
- LiveNodeList& list = *it->value;
- ASSERT(!list.isRootedAtDocument());
- oldDocument->unregisterNodeList(list);
- newDocument->registerNodeList(list);
</del><ins>+ for (auto* list : m_tagNodeListCacheNS.values()) {
+ ASSERT(!list->isRootedAtDocument());
+ oldDocument->unregisterNodeList(*list);
+ newDocument->registerNodeList(*list);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto it = m_cachedCollections.begin(), end = m_cachedCollections.end(); it != end; ++it) {
- HTMLCollection& collection = *it->value;
- oldDocument->unregisterCollection(collection);
- newDocument->registerCollection(collection);
</del><ins>+ for (auto collection : m_cachedCollections.values()) {
+ oldDocument->unregisterCollection(*collection);
+ newDocument->registerCollection(*collection);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -103,17 +103,15 @@
</span><span class="cx"> ScriptExecutionContext::~ScriptExecutionContext()
</span><span class="cx"> {
</span><span class="cx"> m_inDestructor = true;
</span><del>- for (HashSet<ContextDestructionObserver*>::iterator iter = m_destructionObservers.begin(); iter != m_destructionObservers.end(); iter = m_destructionObservers.begin()) {
- ContextDestructionObserver* observer = *iter;
</del><ins>+ for (auto* observer : m_destructionObservers) {
</ins><span class="cx"> m_destructionObservers.remove(observer);
</span><span class="cx"> ASSERT(observer->scriptExecutionContext() == this);
</span><span class="cx"> observer->contextDestroyed();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end();
- for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) {
- ASSERT((*iter)->scriptExecutionContext() == this);
- (*iter)->contextDestroyed();
</del><ins>+ for (auto* port : m_messagePorts) {
+ ASSERT(port->scriptExecutionContext() == this);
+ port->contextDestroyed();
</ins><span class="cx"> }
</span><span class="cx"> #if ENABLE(BLOB)
</span><span class="cx"> if (m_publicURLManager)
</span><span class="lines">@@ -166,11 +164,10 @@
</span><span class="cx"> {
</span><span class="cx"> // No protection against m_activeDOMObjects changing during iteration: canSuspend() shouldn't execute arbitrary JS.
</span><span class="cx"> m_iteratingActiveDOMObjects = true;
</span><del>- ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
- for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
- ASSERT((*iter)->scriptExecutionContext() == this);
- ASSERT((*iter)->suspendIfNeededCalled());
- if (!(*iter)->canSuspend()) {
</del><ins>+ for (auto* activeDOMObject : m_activeDOMObjects) {
+ ASSERT(activeDOMObject->scriptExecutionContext() == this);
+ ASSERT(activeDOMObject->suspendIfNeededCalled());
+ if (!activeDOMObject->canSuspend()) {
</ins><span class="cx"> m_iteratingActiveDOMObjects = false;
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -190,11 +187,10 @@
</span><span class="cx">
</span><span class="cx"> // No protection against m_activeDOMObjects changing during iteration: suspend() shouldn't execute arbitrary JS.
</span><span class="cx"> m_iteratingActiveDOMObjects = true;
</span><del>- ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
- for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
- ASSERT((*iter)->scriptExecutionContext() == this);
- ASSERT((*iter)->suspendIfNeededCalled());
- (*iter)->suspend(why);
</del><ins>+ for (auto* activeDOMObject : m_activeDOMObjects) {
+ ASSERT(activeDOMObject->scriptExecutionContext() == this);
+ ASSERT(activeDOMObject->suspendIfNeededCalled());
+ activeDOMObject->suspend(why);
</ins><span class="cx"> }
</span><span class="cx"> m_iteratingActiveDOMObjects = false;
</span><span class="cx"> m_activeDOMObjectsAreSuspended = true;
</span><span class="lines">@@ -209,11 +205,10 @@
</span><span class="cx"> m_activeDOMObjectsAreSuspended = false;
</span><span class="cx"> // No protection against m_activeDOMObjects changing during iteration: resume() shouldn't execute arbitrary JS.
</span><span class="cx"> m_iteratingActiveDOMObjects = true;
</span><del>- ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
- for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
- ASSERT((*iter)->scriptExecutionContext() == this);
- ASSERT((*iter)->suspendIfNeededCalled());
- (*iter)->resume();
</del><ins>+ for (auto* activeDOMObject : m_activeDOMObjects) {
+ ASSERT(activeDOMObject->scriptExecutionContext() == this);
+ ASSERT(activeDOMObject->suspendIfNeededCalled());
+ activeDOMObject->resume();
</ins><span class="cx"> }
</span><span class="cx"> m_iteratingActiveDOMObjects = false;
</span><span class="cx"> }
</span><span class="lines">@@ -225,11 +220,10 @@
</span><span class="cx"> m_activeDOMObjectsAreStopped = true;
</span><span class="cx"> // No protection against m_activeDOMObjects changing during iteration: stop() shouldn't execute arbitrary JS.
</span><span class="cx"> m_iteratingActiveDOMObjects = true;
</span><del>- ActiveDOMObjectsSet::iterator activeObjectsEnd = m_activeDOMObjects.end();
- for (ActiveDOMObjectsSet::iterator iter = m_activeDOMObjects.begin(); iter != activeObjectsEnd; ++iter) {
- ASSERT((*iter)->scriptExecutionContext() == this);
- ASSERT((*iter)->suspendIfNeededCalled());
- (*iter)->stop();
</del><ins>+ for (auto* activeDOMObject : m_activeDOMObjects) {
+ ASSERT(activeDOMObject->scriptExecutionContext() == this);
+ ASSERT(activeDOMObject->suspendIfNeededCalled());
+ activeDOMObject->stop();
</ins><span class="cx"> }
</span><span class="cx"> m_iteratingActiveDOMObjects = false;
</span><span class="cx">
</span><span class="lines">@@ -277,11 +271,11 @@
</span><span class="cx"> m_destructionObservers.remove(observer);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void ScriptExecutionContext::closeMessagePorts() {
- HashSet<MessagePort*>::iterator messagePortsEnd = m_messagePorts.end();
- for (HashSet<MessagePort*>::iterator iter = m_messagePorts.begin(); iter != messagePortsEnd; ++iter) {
- ASSERT((*iter)->scriptExecutionContext() == this);
- (*iter)->close();
</del><ins>+void ScriptExecutionContext::closeMessagePorts()
+{
+ for (auto* port : m_messagePorts) {
+ ASSERT(port->scriptExecutionContext() == this);
+ port->close();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -373,10 +367,8 @@
</span><span class="cx"> void ScriptExecutionContext::adjustMinimumTimerInterval(double oldMinimumTimerInterval)
</span><span class="cx"> {
</span><span class="cx"> if (minimumTimerInterval() != oldMinimumTimerInterval) {
</span><del>- for (TimeoutMap::iterator iter = m_timeouts.begin(); iter != m_timeouts.end(); ++iter) {
- DOMTimer* timer = iter->value;
</del><ins>+ for (auto* timer : m_timeouts.values())
</ins><span class="cx"> timer->adjustMinimumTimerInterval(oldMinimumTimerInterval);
</span><del>- }
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -392,10 +384,8 @@
</span><span class="cx">
</span><span class="cx"> void ScriptExecutionContext::didChangeTimerAlignmentInterval()
</span><span class="cx"> {
</span><del>- for (TimeoutMap::iterator iter = m_timeouts.begin(); iter != m_timeouts.end(); ++iter) {
- DOMTimer* timer = iter->value;
</del><ins>+ for (auto* timer : m_timeouts.values())
</ins><span class="cx"> timer->didChangeAlignmentInterval();
</span><del>- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> double ScriptExecutionContext::timerAlignmentInterval() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomWebKitNamedFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/WebKitNamedFlow.cpp (161095 => 161096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/WebKitNamedFlow.cpp        2013-12-27 00:21:54 UTC (rev 161095)
+++ trunk/Source/WebCore/dom/WebKitNamedFlow.cpp        2013-12-27 02:55:57 UTC (rev 161096)
</span><span class="lines">@@ -130,12 +130,11 @@
</span><span class="cx"> Vector<Ref<Element>> regionElements;
</span><span class="cx">
</span><span class="cx"> if (inFlowThread(contentNode->renderer(), m_parentFlowThread)) {
</span><del>- const RenderRegionList& regionList = m_parentFlowThread->renderRegionList();
- for (auto iter = regionList.begin(), end = regionList.end(); iter != end; ++iter) {
</del><ins>+ for (auto* region : m_parentFlowThread->renderRegionList()) {
</ins><span class="cx"> // FIXME: Pseudo-elements are not included in the list.
</span><span class="cx"> // They will be included when we will properly support the Region interface
</span><span class="cx"> // http://dev.w3.org/csswg/css-regions/#the-region-interface
</span><del>- const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter);
</del><ins>+ const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(region);
</ins><span class="cx"> if (renderRegion->isPseudoElementRegion())
</span><span class="cx"> continue;
</span><span class="cx"> if (m_parentFlowThread->objectInFlowRegion(contentNode->renderer(), renderRegion)) {
</span><span class="lines">@@ -159,13 +158,11 @@
</span><span class="cx"> return StaticElementList::createEmpty();
</span><span class="cx">
</span><span class="cx"> Vector<Ref<Element>> regionElements;
</span><del>-
- const RenderRegionList& regionList = m_parentFlowThread->renderRegionList();
- for (auto iter = regionList.begin(), end = regionList.end(); iter != end; ++iter) {
</del><ins>+ for (auto region : m_parentFlowThread->renderRegionList()) {
</ins><span class="cx"> // FIXME: Pseudo-elements are not included in the list.
</span><span class="cx"> // They will be included when we will properly support the Region interface
</span><span class="cx"> // http://dev.w3.org/csswg/css-regions/#the-region-interface
</span><del>- const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(*iter);
</del><ins>+ const RenderNamedFlowFragment* renderRegion = toRenderNamedFlowFragment(region);
</ins><span class="cx"> if (renderRegion->isPseudoElementRegion())
</span><span class="cx"> continue;
</span><span class="cx"> ASSERT(renderRegion->generatingElement());
</span><span class="lines">@@ -186,10 +183,7 @@
</span><span class="cx"> return StaticElementList::createEmpty();
</span><span class="cx">
</span><span class="cx"> Vector<Ref<Element>> contentElements;
</span><del>-
- const NamedFlowContentElements& contentElementsList = m_parentFlowThread->contentElements();
- for (auto it = contentElementsList.begin(), end = contentElementsList.end(); it != end; ++it) {
- Element* element = *it;
</del><ins>+ for (auto* element : m_parentFlowThread->contentElements()) {
</ins><span class="cx"> ASSERT(element->computedStyle()->flowThread() == m_parentFlowThread->flowThreadName());
</span><span class="cx"> contentElements.append(*element);
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>