<!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>[165546] trunk/Source</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/165546">165546</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-03-13 10:51:59 -0700 (Thu, 13 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Avoid copy-prone idiom "for (auto item : collection)"
https://bugs.webkit.org/show_bug.cgi?id=129990
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
* heap/CodeBlockSet.h:
(JSC::CodeBlockSet::iterate): Use auto& to be sure we don't copy by accident.
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::dispatchBreakpointActionLog): Use auto* to
make explicit that we are iterating through pointers.
(Inspector::ScriptDebugServer::dispatchBreakpointActionSound): Ditto.
(Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): Ditto.
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::removeBreakpoint): Use auto&, and also
get rid of an unneeded local variable.
Source/WebCore:
Most of these changes have no effect. A few of them get rid of unwanted
copying of the items as we iterate them. Found these with the command
'git grep "for (auto .*:"' or the equivalent.
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData): Use auto& to avoid copying the keys.
(WebCore::IDBKeyData::maybeCreateIDBKey): Ditto.
(WebCore::IDBKeyData::isolatedCopy): Ditto.
* dom/Node.cpp:
(WebCore::Document::invalidateNodeListAndCollectionCaches): Use auto*
to make explicit the fact that these are pointers. Stop using "it" for
a variable that is not an iterator. Get rid of unneeded local variables
for the collections themselves.
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::adoptDocument): Use auto& to make sure we
don't do any unnecessary copying. Stop using "it" for a variable that
is not an iterator.
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::lastRow): Use auto* to be explicit
that these are pointers.
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal): Ditto.
* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot): Ditto. Also got rid of
an unnecessary local variable.
* platform/FileChooser.cpp:
(WebCore::FileChooser::chooseFiles): Use auto&. Also fix a FIXME.
(WebCore::FileChooser::chooseMediaFiles): Ditto.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::naturalSize): Use auto&.
* rendering/RenderIterator.h: Changed include from RenderObject.h to
RenderElement.h; iterators are based on RenderElement now.
* rendering/svg/RenderSVGResource.cpp:
(WebCore::removeFromCacheAndInvalidateDependencies): Use auto*.
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation): Use auto*.
(WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation): Ditto.
(WebCore::RenderSVGResourceContainer::registerResource): Ditto.
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::layoutChildren): Updated to use a more specific
type, to use auto* instead of of auto, and to eliminate the slightly sloppily
capitalized and not-so-slightly ungrammatical notlayoutedObjects.
(WebCore::SVGRenderSupport::applyStrokeStyleToContext): Use auto&.
(WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending): Use auto*.
* rendering/svg/SVGResourcesCycleSolver.cpp:
(WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Use auto*.
(WebCore::SVGResourcesCycleSolver::resolveCycles): Ditto. Also lineageOfType.
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::applyResultsToTarget): Use auto*.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::invalidateMPathDependencies): Ditto.
Source/WebKit/mac:
* WebView/WebFrame.mm:
(-[WebFrame _documentFragmentWithNodesAsParagraphs:]):
Use auto*. Also removed uneeded ASSERT_NO_EXCEPTION, which is already
the default without specifying it explicitly.
Source/WebKit2:
* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties): Use auto&.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): Use auto&
even though the type is a scalar. This does no harm and makes it easier
to spot uses that trigger unnecessary copying with grep.
(WebKit::RemoteLayerTreeTransaction::decode): Ditto.
(WebKit::dumpChangedLayers): Ditto.
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree): Ditto.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::visitedLinkStateChanged): Ditto.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapCodeBlockSeth">trunk/Source/JavaScriptCore/heap/CodeBlockSet.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptDebugServercpp">trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyDatacpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.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="#trunkSourceWebCorehtmlHTMLTableRowsCollectioncpp">trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorNodeFindercpp">trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp</a></li>
<li><a href="#trunkSourceWebCorepageiosFrameIOSmm">trunk/Source/WebCore/page/ios/FrameIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformFileChoosercpp">trunk/Source/WebCore/platform/FileChooser.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderIteratorh">trunk/Source/WebCore/rendering/RenderIterator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourcecpp">trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourceContainercpp">trunk/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderSupportcpp">trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGResourcesCycleSolvercpp">trunk/Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimateMotionElementcpp">trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGPathElementcpp">trunk/Source/WebCore/svg/SVGPathElement.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebFramemm">trunk/Source/WebKit/mac/WebView/WebFrame.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreePropertyAppliermm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacRemoteLayerTreeHostmm">trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-03-10 Darin Adler <darin@apple.com>
+
+ Avoid copy-prone idiom "for (auto item : collection)"
+ https://bugs.webkit.org/show_bug.cgi?id=129990
+
+ Reviewed by Geoffrey Garen.
+
+ * heap/CodeBlockSet.h:
+ (JSC::CodeBlockSet::iterate): Use auto& to be sure we don't copy by accident.
+ * inspector/ScriptDebugServer.cpp:
+ (Inspector::ScriptDebugServer::dispatchBreakpointActionLog): Use auto* to
+ make explicit that we are iterating through pointers.
+ (Inspector::ScriptDebugServer::dispatchBreakpointActionSound): Ditto.
+ (Inspector::ScriptDebugServer::dispatchBreakpointActionProbe): Ditto.
+ * inspector/agents/InspectorDebuggerAgent.cpp:
+ (Inspector::InspectorDebuggerAgent::removeBreakpoint): Use auto&, and also
+ get rid of an unneeded local variable.
+
</ins><span class="cx"> 2014-03-13 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Remove unused callId parameter from evaluateInWebInspector
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapCodeBlockSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/CodeBlockSet.h (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/CodeBlockSet.h        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/JavaScriptCore/heap/CodeBlockSet.h        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx"> // visited.
</span><span class="cx"> template<typename Functor> void iterate(Functor& functor)
</span><span class="cx"> {
</span><del>- for (auto &codeBlock : m_set) {
</del><ins>+ for (auto& codeBlock : m_set) {
</ins><span class="cx"> bool done = functor(codeBlock);
</span><span class="cx"> if (done)
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">
</span><span class="cx"> Vector<ScriptDebugListener*> listenersCopy;
</span><span class="cx"> copyToVector(*listeners, listenersCopy);
</span><del>- for (auto listener : listenersCopy)
</del><ins>+ for (auto* listener : listenersCopy)
</ins><span class="cx"> listener->breakpointActionLog(exec, message);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx">
</span><span class="cx"> Vector<ScriptDebugListener*> listenersCopy;
</span><span class="cx"> copyToVector(*listeners, listenersCopy);
</span><del>- for (auto listener : listenersCopy)
</del><ins>+ for (auto* listener : listenersCopy)
</ins><span class="cx"> listener->breakpointActionSound(breakpointActionIdentifier);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">
</span><span class="cx"> Vector<ScriptDebugListener*> listenersCopy;
</span><span class="cx"> copyToVector(*listeners, listenersCopy);
</span><del>- for (auto listener : listenersCopy)
</del><ins>+ for (auto* listener : listenersCopy)
</ins><span class="cx"> listener->breakpointActionProbe(exec, action, m_hitCount, sample);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -341,8 +341,7 @@
</span><span class="cx"> {
</span><span class="cx"> m_javaScriptBreakpoints.remove(breakpointIdentifier);
</span><span class="cx">
</span><del>- Vector<JSC::BreakpointID> breakpointIDs = m_breakpointIdentifierToDebugServerBreakpointIDs.take(breakpointIdentifier);
- for (auto breakpointID : breakpointIDs) {
</del><ins>+ for (JSC::BreakpointID breakpointID : m_breakpointIdentifierToDebugServerBreakpointIDs.take(breakpointIdentifier)) {
</ins><span class="cx"> const Vector<ScriptBreakpointAction>& breakpointActions = scriptDebugServer().getActionsForBreakpoint(breakpointID);
</span><span class="cx"> for (auto& action : breakpointActions)
</span><span class="cx"> m_injectedScriptManager->releaseObjectGroup(objectGroupForBreakpointAction(action));
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/ChangeLog        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -1,3 +1,73 @@
</span><ins>+2014-03-11 Darin Adler <darin@apple.com>
+
+ Avoid copy-prone idiom "for (auto item : collection)"
+ https://bugs.webkit.org/show_bug.cgi?id=129990
+
+ Reviewed by Geoffrey Garen.
+
+ Most of these changes have no effect. A few of them get rid of unwanted
+ copying of the items as we iterate them. Found these with the command
+ 'git grep "for (auto .*:"' or the equivalent.
+
+ * Modules/indexeddb/IDBKeyData.cpp:
+ (WebCore::IDBKeyData::IDBKeyData): Use auto& to avoid copying the keys.
+ (WebCore::IDBKeyData::maybeCreateIDBKey): Ditto.
+ (WebCore::IDBKeyData::isolatedCopy): Ditto.
+
+ * dom/Node.cpp:
+ (WebCore::Document::invalidateNodeListAndCollectionCaches): Use auto*
+ to make explicit the fact that these are pointers. Stop using "it" for
+ a variable that is not an iterator. Get rid of unneeded local variables
+ for the collections themselves.
+
+ * dom/NodeRareData.h:
+ (WebCore::NodeListsNodeData::adoptDocument): Use auto& to make sure we
+ don't do any unnecessary copying. Stop using "it" for a variable that
+ is not an iterator.
+
+ * html/HTMLTableRowsCollection.cpp:
+ (WebCore::HTMLTableRowsCollection::lastRow): Use auto* to be explicit
+ that these are pointers.
+ * inspector/InspectorNodeFinder.cpp:
+ (WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal): Ditto.
+ * page/ios/FrameIOS.mm:
+ (WebCore::Frame::interpretationsForCurrentRoot): Ditto. Also got rid of
+ an unnecessary local variable.
+
+ * platform/FileChooser.cpp:
+ (WebCore::FileChooser::chooseFiles): Use auto&. Also fix a FIXME.
+ (WebCore::FileChooser::chooseMediaFiles): Ditto.
+
+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+ (WebCore::SourceBufferPrivateAVFObjC::naturalSize): Use auto&.
+
+ * rendering/RenderIterator.h: Changed include from RenderObject.h to
+ RenderElement.h; iterators are based on RenderElement now.
+
+ * rendering/svg/RenderSVGResource.cpp:
+ (WebCore::removeFromCacheAndInvalidateDependencies): Use auto*.
+
+ * rendering/svg/RenderSVGResourceContainer.cpp:
+ (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation): Use auto*.
+ (WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation): Ditto.
+ (WebCore::RenderSVGResourceContainer::registerResource): Ditto.
+
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::layoutChildren): Updated to use a more specific
+ type, to use auto* instead of of auto, and to eliminate the slightly sloppily
+ capitalized and not-so-slightly ungrammatical notlayoutedObjects.
+ (WebCore::SVGRenderSupport::applyStrokeStyleToContext): Use auto&.
+ (WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending): Use auto*.
+
+ * rendering/svg/SVGResourcesCycleSolver.cpp:
+ (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Use auto*.
+ (WebCore::SVGResourcesCycleSolver::resolveCycles): Ditto. Also lineageOfType.
+
+ * svg/SVGAnimateMotionElement.cpp:
+ (WebCore::SVGAnimateMotionElement::applyResultsToTarget): Use auto*.
+ * svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::invalidateMPathDependencies): Ditto.
+
</ins><span class="cx"> 2014-03-13 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Remove unused callId parameter from evaluateInWebInspector
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> case IDBKey::InvalidType:
</span><span class="cx"> break;
</span><span class="cx"> case IDBKey::ArrayType:
</span><del>- for (auto key2 : key->array())
</del><ins>+ for (auto& key2 : key->array())
</ins><span class="cx"> arrayValue.append(IDBKeyData(key2.get()));
</span><span class="cx"> break;
</span><span class="cx"> case IDBKey::StringType:
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> case IDBKey::ArrayType:
</span><span class="cx"> {
</span><span class="cx"> IDBKey::KeyArray array;
</span><del>- for (auto keyData : arrayValue) {
</del><ins>+ for (auto& keyData : arrayValue) {
</ins><span class="cx"> array.append(keyData.maybeCreateIDBKey());
</span><span class="cx"> ASSERT(array.last());
</span><span class="cx"> }
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx"> case IDBKey::InvalidType:
</span><span class="cx"> return result;
</span><span class="cx"> case IDBKey::ArrayType:
</span><del>- for (auto key : arrayValue)
</del><ins>+ for (auto& key : arrayValue)
</ins><span class="cx"> result.arrayValue.append(key.isolatedCopy());
</span><span class="cx"> return result;
</span><span class="cx"> case IDBKey::StringType:
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/dom/Node.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -724,13 +724,10 @@
</span><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx"> m_inInvalidateNodeListAndCollectionCaches = true;
</span><span class="cx"> #endif
</span><del>- HashSet<LiveNodeList*> liveNodeLists = std::move(m_listsInvalidatedAtDocument);
- for (auto it : liveNodeLists)
- it->invalidateCache(attrName);
-
- HashSet<HTMLCollection*> collectionLists = std::move(m_collectionsInvalidatedAtDocument);
- for (auto it : collectionLists)
- it->invalidateCache(attrName);
</del><ins>+ for (auto* list : std::move(m_listsInvalidatedAtDocument))
+ list->invalidateCache(attrName);
+ for (auto* list : std::move(m_collectionsInvalidatedAtDocument))
+ list->invalidateCache(attrName);
</ins><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx"> m_inInvalidateNodeListAndCollectionCaches = false;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeRareDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/NodeRareData.h (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/NodeRareData.h        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/dom/NodeRareData.h        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -33,15 +33,16 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "QualifiedName.h"
</span><span class="cx"> #include "TagNodeList.h"
</span><del>-#if ENABLE(VIDEO_TRACK)
-#include "TextTrack.h"
-#endif
</del><span class="cx"> #include <wtf/HashSet.h>
</span><span class="cx"> #include <wtf/OwnPtr.h>
</span><span class="cx"> #include <wtf/PassOwnPtr.h>
</span><span class="cx"> #include <wtf/text/AtomicString.h>
</span><span class="cx"> #include <wtf/text/StringHash.h>
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO_TRACK)
+#include "TextTrack.h"
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class LabelsNodeList;
</span><span class="lines">@@ -231,27 +232,27 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto it : m_atomicNameCaches)
- it.value->invalidateCache(*oldDocument);
</del><ins>+ for (auto& cache : m_atomicNameCaches.values())
+ cache->invalidateCache(*oldDocument);
</ins><span class="cx">
</span><del>- for (auto it : m_nameCaches)
- it.value->invalidateCache(*oldDocument);
</del><ins>+ for (auto& cache : m_nameCaches.values())
+ cache->invalidateCache(*oldDocument);
</ins><span class="cx">
</span><del>- for (auto it : m_tagNodeListCacheNS) {
- LiveNodeList& list = *it.value;
- ASSERT(!list.isRootedAtDocument());
- list.invalidateCache(*oldDocument);
</del><ins>+ for (auto& list : m_tagNodeListCacheNS.values()) {
+ ASSERT(!list->isRootedAtDocument());
+ list->invalidateCache(*oldDocument);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto it : m_cachedCollections)
- it.value->invalidateCache(*oldDocument);
</del><ins>+ for (auto& collection : m_cachedCollections.values())
+ collection->invalidateCache(*oldDocument);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> NodeListsNodeData()
</span><span class="cx"> : m_childNodeList(nullptr)
</span><span class="cx"> , m_emptyChildNodeList(nullptr)
</span><del>- { }
</del><ins>+ {
+ }
</ins><span class="cx">
</span><span class="cx"> std::pair<unsigned char, AtomicString> namedCollectionKey(CollectionType type, const AtomicString& name)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTableRowsCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -122,25 +122,25 @@
</span><span class="cx">
</span><span class="cx"> HTMLTableRowElement* HTMLTableRowsCollection::lastRow(HTMLTableElement* table)
</span><span class="cx"> {
</span><del>- for (auto child = ElementTraversal::lastChild(table); child; child = ElementTraversal::previousSibling(child)) {
</del><ins>+ for (auto* child = ElementTraversal::lastChild(table); child; child = ElementTraversal::previousSibling(child)) {
</ins><span class="cx"> if (child->hasTagName(tfootTag)) {
</span><del>- if (auto row = childrenOfType<HTMLTableRowElement>(*child).last())
</del><ins>+ if (auto* row = childrenOfType<HTMLTableRowElement>(*child).last())
</ins><span class="cx"> return row;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto child = ElementTraversal::lastChild(table); child; child = ElementTraversal::previousSibling(child)) {
</del><ins>+ for (auto* child = ElementTraversal::lastChild(table); child; child = ElementTraversal::previousSibling(child)) {
</ins><span class="cx"> if (isHTMLTableRowElement(child))
</span><span class="cx"> return toHTMLTableRowElement(child);
</span><span class="cx"> if (child->hasTagName(tbodyTag)) {
</span><del>- if (auto row = childrenOfType<HTMLTableRowElement>(*child).last())
</del><ins>+ if (auto* row = childrenOfType<HTMLTableRowElement>(*child).last())
</ins><span class="cx"> return row;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto child = ElementTraversal::lastChild(table); child; child = ElementTraversal::previousSibling(child)) {
</del><ins>+ for (auto* child = ElementTraversal::lastChild(table); child; child = ElementTraversal::previousSibling(child)) {
</ins><span class="cx"> if (child->hasTagName(theadTag)) {
</span><del>- if (auto row = childrenOfType<HTMLTableRowElement>(*child).last())
</del><ins>+ if (auto* row = childrenOfType<HTMLTableRowElement>(*child).last())
</ins><span class="cx"> return row;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorNodeFindercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/inspector/InspectorNodeFinder.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> void InspectorNodeFinder::searchUsingDOMTreeTraversal(Node* parentNode)
</span><span class="cx"> {
</span><span class="cx"> // Manual plain text search.
</span><del>- for (auto node = parentNode; node; node = NodeTraversal::next(node, parentNode)) {
</del><ins>+ for (auto* node = parentNode; node; node = NodeTraversal::next(node, parentNode)) {
</ins><span class="cx"> switch (node->nodeType()) {
</span><span class="cx"> case Node::TEXT_NODE:
</span><span class="cx"> case Node::COMMENT_NODE:
</span></span></pre></div>
<a id="trunkSourceWebCorepageiosFrameIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ios/FrameIOS.mm (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ios/FrameIOS.mm        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/page/ios/FrameIOS.mm        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -759,7 +759,7 @@
</span><span class="cx"> // The number of interpretations will be i1 * i2 * ... * iN, where iX is the number of interpretations for the Xth phrase with alternatives.
</span><span class="cx"> size_t interpretationsCount = 1;
</span><span class="cx">
</span><del>- for (auto marker : markersInRoot)
</del><ins>+ for (auto* marker : markersInRoot)
</ins><span class="cx"> interpretationsCount *= marker->alternatives().size() + 1;
</span><span class="cx">
</span><span class="cx"> Vector<Vector<UChar>> interpretations;
</span><span class="lines">@@ -771,8 +771,7 @@
</span><span class="cx">
</span><span class="cx"> Node* pastLastNode = rangeOfRootContents->pastLastNode();
</span><span class="cx"> for (Node* node = rangeOfRootContents->firstNode(); node != pastLastNode; node = NodeTraversal::next(node)) {
</span><del>- const Vector<DocumentMarker*>& markers = document()->markers().markersFor(node, DocumentMarker::MarkerTypes(DocumentMarker::DictationPhraseWithAlternatives));
- for (auto marker : markers) {
</del><ins>+ for (auto* marker : document()->markers().markersFor(node, DocumentMarker::MarkerTypes(DocumentMarker::DictationPhraseWithAlternatives))) {
</ins><span class="cx"> // First, add text that precede the marker.
</span><span class="cx"> if (precedingTextStartPosition != createLegacyEditingPosition(node, marker->startOffset())) {
</span><span class="cx"> RefPtr<Range> precedingTextRange = Range::create(*document(), precedingTextStartPosition, createLegacyEditingPosition(node, marker->startOffset()));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileChoosercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileChooser.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileChooser.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/platform/FileChooser.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -70,12 +70,13 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> Vector<FileChooserFileInfo> files;
</span><del>- for (unsigned i = 0; i < filenames.size(); ++i)
- files.append(FileChooserFileInfo(filenames[i]));
</del><ins>+ for (auto& filename : filenames)
+ files.append(FileChooserFileInfo(filename));
</ins><span class="cx"> m_client->filesChosen(files);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> // FIXME: This function is almost identical to FileChooser::chooseFiles(). We should merge this function
</span><span class="cx"> // with FileChooser::chooseFiles() and hence remove the PLATFORM(IOS)-guard.
</span><span class="cx"> void FileChooser::chooseMediaFiles(const Vector<String>& filenames, const String& displayString, Icon* icon)
</span><span class="lines">@@ -88,19 +89,20 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> Vector<FileChooserFileInfo> files;
</span><del>- for (auto filename : filenames)
</del><ins>+ for (auto& filename : filenames)
</ins><span class="cx"> files.append(FileChooserFileInfo(filename));
</span><span class="cx"> m_client->filesChosen(files, displayString, icon);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void FileChooser::chooseFiles(const Vector<FileChooserFileInfo>& files)
</span><span class="cx"> {
</span><del>- // FIXME: This is inelegant. We should not be looking at settings here.
</del><span class="cx"> Vector<String> paths;
</span><del>- for (unsigned i = 0; i < files.size(); ++i)
- paths.append(files[i].path);
</del><ins>+ for (auto& file : files)
+ paths.append(file.path);
</ins><span class="cx">
</span><ins>+ // FIXME: This is inelegant. We should not be looking at settings here.
</ins><span class="cx"> if (m_settings.selectedFiles == paths)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -695,7 +695,7 @@
</span><span class="cx">
</span><span class="cx"> IntSize SourceBufferPrivateAVFObjC::naturalSize()
</span><span class="cx"> {
</span><del>- for (auto videoTrack : m_videoTracks) {
</del><ins>+ for (auto& videoTrack : m_videoTracks) {
</ins><span class="cx"> if (videoTrack->selected())
</span><span class="cx"> return videoTrack->naturalSize();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderIterator.h (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderIterator.h        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/rendering/RenderIterator.h        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #ifndef RenderIterator_h
</span><span class="cx"> #define RenderIterator_h
</span><span class="cx">
</span><del>-#include "RenderObject.h"
</del><ins>+#include "RenderElement.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResource.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -173,8 +173,8 @@
</span><span class="cx"> HashSet<SVGElement*>* dependencies = renderer.document().accessSVGExtensions()->setOfElementsReferencingTarget(toSVGElement(renderer.element()));
</span><span class="cx"> if (!dependencies)
</span><span class="cx"> return;
</span><del>- for (auto element : *dependencies) {
- if (auto renderer = element->renderer())
</del><ins>+ for (auto* element : *dependencies) {
+ if (auto* renderer = element->renderer())
</ins><span class="cx"> RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer, needsLayout);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourceContainercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> bool needsLayout = mode == LayoutAndBoundariesInvalidation;
</span><span class="cx"> bool markForInvalidation = mode != ParentOnlyInvalidation;
</span><span class="cx">
</span><del>- for (auto client : m_clients) {
</del><ins>+ for (auto* client : m_clients) {
</ins><span class="cx"> if (client->isSVGResourceContainer()) {
</span><span class="cx"> toRenderSVGResourceContainer(*client).removeAllClientsFromCache(markForInvalidation);
</span><span class="cx"> continue;
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx"> void RenderSVGResourceContainer::markAllClientLayersForInvalidation()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><del>- for (auto clientLayer : m_clientLayers)
</del><ins>+ for (auto* clientLayer : m_clientLayers)
</ins><span class="cx"> clientLayer->filterNeedsRepaint();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="lines">@@ -176,11 +176,10 @@
</span><span class="cx"> extensions.addResource(m_id, this);
</span><span class="cx">
</span><span class="cx"> // Update cached resources of pending clients.
</span><del>- auto end = clients->end();
- for (auto it = clients->begin(); it != end; ++it) {
- ASSERT((*it)->hasPendingResources());
- extensions.clearHasPendingResourcesIfPossible(*it);
- auto renderer = (*it)->renderer();
</del><ins>+ for (auto* client : *clients) {
+ ASSERT(client->hasPendingResources());
+ extensions.clearHasPendingResourcesIfPossible(client);
+ auto* renderer = client->renderer();
</ins><span class="cx"> if (!renderer)
</span><span class="cx"> continue;
</span><span class="cx"> SVGResourcesCache::clientStyleChanged(*renderer, StyleDifferenceLayout, renderer->style());
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderSupportcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderSupport.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx"> bool transformChanged = transformToRootChanged(&start);
</span><span class="cx"> bool hasSVGShadow = rendererHasSVGShadow(start);
</span><span class="cx"> bool needsBoundariesUpdate = start.needsBoundariesUpdate();
</span><del>- HashSet<RenderObject*> notlayoutedObjects;
</del><ins>+ HashSet<RenderElement*> elementsThatDidNotReceiveLayout;
</ins><span class="cx">
</span><span class="cx"> for (RenderObject* child = start.firstChild(); child; child = child->nextSibling()) {
</span><span class="cx"> bool needsLayout = selfNeedsLayout;
</span><span class="lines">@@ -274,22 +274,20 @@
</span><span class="cx"> // parent containers call repaint(). (RenderBlock::layout* has similar logic.)
</span><span class="cx"> if (!childEverHadLayout)
</span><span class="cx"> child->repaint();
</span><del>- } else if (layoutSizeChanged)
- notlayoutedObjects.add(child);
</del><ins>+ } else if (layoutSizeChanged && child->isRenderElement())
+ elementsThatDidNotReceiveLayout.add(toRenderElement(child));
</ins><span class="cx">
</span><span class="cx"> ASSERT(!child->needsLayout());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!layoutSizeChanged) {
</span><del>- ASSERT(notlayoutedObjects.isEmpty());
</del><ins>+ ASSERT(elementsThatDidNotReceiveLayout.isEmpty());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // If the layout size changed, invalidate all resources of all children that didn't go through the layout() code path.
</span><del>- for (auto child : notlayoutedObjects) {
- if (child->isRenderElement())
- invalidateResourcesOfChildren(toRenderElement(*child));
- }
</del><ins>+ for (auto* element : elementsThatDidNotReceiveLayout)
+ invalidateResourcesOfChildren(*element);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SVGRenderSupport::isOverflowHidden(const RenderElement& renderer)
</span><span class="lines">@@ -428,8 +426,8 @@
</span><span class="cx"> else {
</span><span class="cx"> DashArray dashArray;
</span><span class="cx"> dashArray.reserveInitialCapacity(dashes.size());
</span><del>- for (unsigned i = 0, size = dashes.size(); i < size; ++i)
- dashArray.uncheckedAppend(dashes[i].value(lengthContext));
</del><ins>+ for (auto& dash : dashes)
+ dashArray.uncheckedAppend(dash.value(lengthContext));
</ins><span class="cx">
</span><span class="cx"> context->setLineDash(dashArray, svgStyle.strokeDashOffset().value(lengthContext));
</span><span class="cx"> }
</span><span class="lines">@@ -465,7 +463,7 @@
</span><span class="cx"> ASSERT(renderer.element()->isSVGElement());
</span><span class="cx">
</span><span class="cx"> bool maskedAncestorShouldIsolateBlending = renderer.style().hasBlendMode();
</span><del>- for (auto ancestor = renderer.element()->parentElement(); ancestor && ancestor->isSVGElement(); ancestor = ancestor->parentElement()) {
</del><ins>+ for (auto* ancestor = renderer.element()->parentElement(); ancestor && ancestor->isSVGElement(); ancestor = ancestor->parentElement()) {
</ins><span class="cx"> if (!toSVGElement(ancestor)->isSVGGraphicsElement() || !isolatesBlending(*ancestor->computedStyle()))
</span><span class="cx"> continue;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGResourcesCycleSolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/rendering/svg/SVGResourcesCycleSolver.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> // Set to a value > 0, to debug the resource cache.
</span><span class="cx"> #define DEBUG_CYCLE_DETECTION 0
</span><span class="cx">
</span><del>-#include "RenderElement.h"
-#include "RenderIterator.h"
</del><ins>+#include "RenderAncestorIterator.h"
</ins><span class="cx"> #include "RenderSVGResourceClipper.h"
</span><span class="cx"> #include "RenderSVGResourceFilter.h"
</span><span class="cx"> #include "RenderSVGResourceMarker.h"
</span><span class="lines">@@ -56,7 +55,7 @@
</span><span class="cx"> resources->buildSetOfResources(resourceSet);
</span><span class="cx">
</span><span class="cx"> // Walk all resources and check wheter they reference any resource contained in the resources set.
</span><del>- for (auto resource : resourceSet) {
</del><ins>+ for (auto* resource : resourceSet) {
</ins><span class="cx"> if (m_allResources.contains(resource))
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -75,7 +74,7 @@
</span><span class="cx"> childResources->buildSetOfResources(childResourceSet);
</span><span class="cx">
</span><span class="cx"> // Walk all child resources and check wheter they reference any resource contained in the resources set.
</span><del>- for (auto& resource : childResourceSet) {
</del><ins>+ for (auto* resource : childResourceSet) {
</ins><span class="cx"> if (m_allResources.contains(resource))
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -103,31 +102,27 @@
</span><span class="cx"> ASSERT(!localResources.isEmpty());
</span><span class="cx">
</span><span class="cx"> // Add all parent resource containers to the HashSet.
</span><del>- HashSet<RenderSVGResourceContainer*> parentResources;
- auto parent = m_renderer.parent();
- while (parent) {
- if (parent->isSVGResourceContainer())
- parentResources.add(toRenderSVGResourceContainer(parent));
- parent = parent->parent();
- }
</del><ins>+ HashSet<RenderSVGResourceContainer*> ancestorResources;
+ for (auto& resource : ancestorsOfType<RenderSVGResourceContainer>(m_renderer))
+ ancestorResources.add(&resource);
</ins><span class="cx">
</span><span class="cx"> #if DEBUG_CYCLE_DETECTION > 0
</span><span class="cx"> fprintf(stderr, "\nDetecting wheter any resources references any of following objects:\n");
</span><span class="cx"> {
</span><span class="cx"> fprintf(stderr, "Local resources:\n");
</span><del>- for (auto it = localResources.begin(), end = localResources.end(); it != end; ++it)
- fprintf(stderr, "|> %s: object=%p (node=%p)\n", (*it)->renderName(), *it, (*it)->node());
</del><ins>+ for (auto* resource : localResources)
+ fprintf(stderr, "|> %s: object=%p (node=%p)\n", resource->renderName(), resource, resource->node());
</ins><span class="cx">
</span><span class="cx"> fprintf(stderr, "Parent resources:\n");
</span><del>- for (auto it = parentResources.begin(), end = parentResources.end(); it != end; ++it)
- fprintf(stderr, "|> %s: object=%p (node=%p)\n", (*it)->renderName(), *it, (*it)->node());
</del><ins>+ for (auto* resource : ancestorResources)
+ fprintf(stderr, "|> %s: object=%p (node=%p)\n", resource->renderName(), resource, resource->node());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // Build combined set of local and parent resources.
</span><span class="cx"> m_allResources = localResources;
</span><del>- for (auto it = parentResources.begin(), end = parentResources.end(); it != end; ++it)
- m_allResources.add(*it);
</del><ins>+ for (auto* resource : ancestorResources)
+ m_allResources.add(resource);
</ins><span class="cx">
</span><span class="cx"> // If we're a resource, add ourselves to the HashSet.
</span><span class="cx"> if (m_renderer.isSVGResourceContainer())
</span><span class="lines">@@ -137,10 +132,9 @@
</span><span class="cx">
</span><span class="cx"> // The job of this function is to determine wheter any of the 'resources' associated with the given 'renderer'
</span><span class="cx"> // references us (or wheter any of its kids references us) -> that's a cycle, we need to find and break it.
</span><del>- for (auto it = localResources.begin(), end = localResources.end(); it != end; ++it) {
- RenderSVGResourceContainer& resource = **it;
- if (parentResources.contains(&resource) || resourceContainsCycles(resource))
- breakCycle(resource);
</del><ins>+ for (auto* resource : localResources) {
+ if (ancestorResources.contains(resource) || resourceContainsCycles(*resource))
+ breakCycle(*resource);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if DEBUG_CYCLE_DETECTION > 0
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimateMotionElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/svg/SVGAnimateMotionElement.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -295,7 +295,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // ...except in case where we have additional instances in <use> trees.
</span><del>- for (auto instance : targetElement->instancesForElement()) {
</del><ins>+ for (auto* instance : targetElement->instancesForElement()) {
</ins><span class="cx"> SVGElement* shadowTreeElement = instance->shadowTreeElement();
</span><span class="cx"> ASSERT(shadowTreeElement);
</span><span class="cx"> AffineTransform* transform = shadowTreeElement->supplementalTransform();
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGPathElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGPathElement.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGPathElement.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebCore/svg/SVGPathElement.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -284,7 +284,7 @@
</span><span class="cx"> // <mpath> can only reference <path> but this dependency is not handled in
</span><span class="cx"> // markForLayoutAndParentResourceInvalidation so we update any mpath dependencies manually.
</span><span class="cx"> if (HashSet<SVGElement*>* dependencies = document().accessSVGExtensions()->setOfElementsReferencingTarget(this)) {
</span><del>- for (auto element : *dependencies) {
</del><ins>+ for (auto* element : *dependencies) {
</ins><span class="cx"> if (element->hasTagName(SVGNames::mpathTag))
</span><span class="cx"> toSVGMPathElement(element)->targetPathChanged();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-03-10 Darin Adler <darin@apple.com>
+
+ Avoid copy-prone idiom "for (auto item : collection)"
+ https://bugs.webkit.org/show_bug.cgi?id=129990
+
+ Reviewed by Geoffrey Garen.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _documentFragmentWithNodesAsParagraphs:]):
+ Use auto*. Also removed uneeded ASSERT_NO_EXCEPTION, which is already
+ the default without specifying it explicitly.
+
</ins><span class="cx"> 2014-03-12 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Remove unused callId parameter from evaluateInWebInspector
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebFrame.mm        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -901,10 +901,10 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<DocumentFragment> fragment = document->createDocumentFragment();
</span><span class="cx">
</span><del>- for (auto node : nodesVector) {
</del><ins>+ for (auto* node : nodesVector) {
</ins><span class="cx"> RefPtr<Element> element = createDefaultParagraphElement(*document);
</span><del>- element->appendChild(node, ASSERT_NO_EXCEPTION);
- fragment->appendChild(element.release(), ASSERT_NO_EXCEPTION);
</del><ins>+ element->appendChild(node);
+ fragment->appendChild(element.release());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return kit(fragment.release().get());
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebKit2/ChangeLog        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2014-03-10 Darin Adler <darin@apple.com>
+
+ Avoid copy-prone idiom "for (auto item : collection)"
+ https://bugs.webkit.org/show_bug.cgi?id=129990
+
+ Reviewed by Geoffrey Garen.
+
+ * Shared/mac/RemoteLayerTreePropertyApplier.mm:
+ (WebKit::RemoteLayerTreePropertyApplier::applyProperties): Use auto&.
+
+ * Shared/mac/RemoteLayerTreeTransaction.mm:
+ (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): Use auto&
+ even though the type is a scalar. This does no harm and makes it easier
+ to spot uses that trigger unnecessary copying with grep.
+ (WebKit::RemoteLayerTreeTransaction::decode): Ditto.
+ (WebKit::dumpChangedLayers): Ditto.
+ * UIProcess/mac/RemoteLayerTreeHost.mm:
+ (WebKit::RemoteLayerTreeHost::updateLayerTree): Ditto.
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::visitedLinkStateChanged): Ditto.
+
</ins><span class="cx"> 2014-03-12 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Remove unused callId parameter from evaluateInWebInspector
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreePropertyAppliermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">
</span><span class="cx"> if (properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
</span><span class="cx"> RetainPtr<NSMutableArray> children = adoptNS([[NSMutableArray alloc] initWithCapacity:properties.children.size()]);
</span><del>- for (auto child : properties.children) {
</del><ins>+ for (auto& child : properties.children) {
</ins><span class="cx"> ASSERT(relatedLayers.get(child));
</span><span class="cx"> [children addObject:relatedLayers.get(child)];
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx"> if (!decoder.decode(result.children))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- for (auto layerID : result.children) {
</del><ins>+ for (auto& layerID : result.children) {
</ins><span class="cx"> if (!layerID)
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -455,7 +455,7 @@
</span><span class="cx"> if (!decoder.decode(result.m_destroyedLayerIDs))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- for (auto layerID : result.m_destroyedLayerIDs) {
</del><ins>+ for (auto& layerID : result.m_destroyedLayerIDs) {
</ins><span class="cx"> if (!layerID)
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -699,7 +699,7 @@
</span><span class="cx"> copyKeysToVector(changedLayerProperties, layerIDs);
</span><span class="cx"> std::sort(layerIDs.begin(), layerIDs.end());
</span><span class="cx">
</span><del>- for (auto layerID : layerIDs) {
</del><ins>+ for (auto& layerID : layerIDs) {
</ins><span class="cx"> const RemoteLayerTreeTransaction::LayerProperties& layerProperties = *changedLayerProperties.get(layerID);
</span><span class="cx">
</span><span class="cx"> ts << "\n";
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacRemoteLayerTreeHostmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> RemoteLayerTreePropertyApplier::applyProperties(layer, properties, relatedLayers);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto destroyedLayer : transaction.destroyedLayers())
</del><ins>+ for (auto& destroyedLayer : transaction.destroyedLayers())
</ins><span class="cx"> m_layers.remove(destroyedLayer);
</span><span class="cx">
</span><span class="cx"> return rootLayerChanged;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (165545 => 165546)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-03-13 17:47:53 UTC (rev 165545)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-03-13 17:51:59 UTC (rev 165546)
</span><span class="lines">@@ -514,7 +514,7 @@
</span><span class="cx"> // FIXME: We may want to track visited links per WebPageGroup rather than per WebContext.
</span><span class="cx"> for (const auto& webPage : m_pageMap.values()) {
</span><span class="cx"> if (Page* page = webPage->corePage()) {
</span><del>- for (auto linkHash : linkHashes)
</del><ins>+ for (auto& linkHash : linkHashes)
</ins><span class="cx"> page->invalidateStylesForLink(linkHash);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>