<!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>[158561] 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/158561">158561</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2013-11-04 00:46:06 -0800 (Mon, 04 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add an ancestor renderer iterator.
&lt;https://webkit.org/b/123718&gt;

Add ancestor iterators for renderers, analogous to element ancestor
iterators. They walk the chain of parent renderers, stopping at each
ancestor of a certain type.

Just like child renderer iterators, this requires isRendererOfType()
to be implemented for the targeted renderer class.

You use them like this:

auto frameSets = ancestorsOfType&lt;RenderFrameSet&gt;(*this);
for (auto frameSet = frameSets.begin(), end = frameSets.end(); frameSet != end; ++frameSet)
    frameSet-&gt;thisOrThat();

To complete the patch, I put them to use in a couple of random places.

Reviewed by Antti Koivisto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockh">trunk/Source/WebCore/rendering/RenderBlock.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFrameSetcpp">trunk/Source/WebCore/rendering/RenderFrameSet.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderFrameSeth">trunk/Source/WebCore/rendering/RenderFrameSet.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderIteratorh">trunk/Source/WebCore/rendering/RenderIterator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextFragmentcpp">trunk/Source/WebCore/rendering/RenderTextFragment.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextFragmenth">trunk/Source/WebCore/rendering/RenderTextFragment.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorerenderingRenderAncestorIteratorh">trunk/Source/WebCore/rendering/RenderAncestorIterator.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/ChangeLog        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2013-11-04  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Add an ancestor renderer iterator.
+        &lt;https://webkit.org/b/123718&gt;
+
+        Add ancestor iterators for renderers, analogous to element ancestor
+        iterators. They walk the chain of parent renderers, stopping at each
+        ancestor of a certain type.
+
+        Just like child renderer iterators, this requires isRendererOfType()
+        to be implemented for the targeted renderer class.
+
+        You use them like this:
+
+        auto frameSets = ancestorsOfType&lt;RenderFrameSet&gt;(*this);
+        for (auto frameSet = frameSets.begin(), end = frameSets.end(); frameSet != end; ++frameSet)
+            frameSet-&gt;thisOrThat();
+
+        To complete the patch, I put them to use in a couple of random places.
+
+        Reviewed by Antti Koivisto.
+
</ins><span class="cx"> 2013-11-04  Mihnea Ovidenie  &lt;mihnea@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSSRegions] Use auto keyword to clean-up for loops
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -4294,6 +4294,7 @@
</span><span class="cx">         Source/WebCore/rendering/PointerEventsHitRules.cpp \
</span><span class="cx">         Source/WebCore/rendering/PointerEventsHitRules.h \
</span><span class="cx">         Source/WebCore/rendering/RegionOversetState.h \
</span><ins>+        Source/WebCore/rendering/RenderAncestorIterator.h \
</ins><span class="cx">         Source/WebCore/rendering/RenderBlock.cpp \
</span><span class="cx">         Source/WebCore/rendering/RenderBlock.h \
</span><span class="cx">     Source/WebCore/rendering/RenderBlockFlow.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -19571,6 +19571,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\PaintInfo.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\PaintPhase.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\PointerEventsHitRules.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\rendering\RenderAncestorIterator.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\RenderBlock.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\RenderBox.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\RenderBoxModelObject.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -4660,6 +4660,7 @@
</span><span class="cx">                 B59DD6A611902A62007E9684 /* JSSQLStatementCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B59DD6A411902A62007E9684 /* JSSQLStatementCallback.cpp */; };
</span><span class="cx">                 B59DD6A911902A71007E9684 /* JSSQLStatementErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B59DD6A711902A71007E9684 /* JSSQLStatementErrorCallback.h */; };
</span><span class="cx">                 B59DD6AA11902A71007E9684 /* JSSQLStatementErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B59DD6A811902A71007E9684 /* JSSQLStatementErrorCallback.cpp */; };
</span><ins>+                B59ED23B18272679006D564C /* RenderAncestorIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = B59ED23A18272679006D564C /* RenderAncestorIterator.h */; };
</ins><span class="cx">                 B5A684220FFABE9800D24689 /* SQLiteFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A684210FFABE9800D24689 /* SQLiteFileSystem.h */; };
</span><span class="cx">                 B5A684240FFABEAA00D24689 /* SQLiteFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A684230FFABEAA00D24689 /* SQLiteFileSystem.cpp */; };
</span><span class="cx">                 B5B7A17017C10AA800E4AA0A /* ElementData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5B7A16F17C1080600E4AA0A /* ElementData.cpp */; };
</span><span class="lines">@@ -5581,8 +5582,6 @@
</span><span class="cx">                 E187056316E54A0D00585E97 /* MainThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = E187056216E54A0D00585E97 /* MainThreadTask.h */; };
</span><span class="cx">                 E18772F1126E2629003DD586 /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E18772F0126E2629003DD586 /* Language.cpp */; };
</span><span class="cx">                 E19727161820549E00592D51 /* CryptoKeyType.h in Headers */ = {isa = PBXBuildFile; fileRef = E19727151820549E00592D51 /* CryptoKeyType.h */; };
</span><del>-                E19AC3F71824E5D100349426 /* CryptoAlgorithmAesKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParams.h */; };
-                E19AC3F9182566F700349426 /* CryptoKeyMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */; };
</del><span class="cx">                 E19AC3E21824DC6900349426 /* CryptoAlgorithmSHA224Mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E19AC3DE1824DC6900349426 /* CryptoAlgorithmSHA224Mac.cpp */; };
</span><span class="cx">                 E19AC3E31824DC6900349426 /* CryptoAlgorithmSHA256Mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E19AC3DF1824DC6900349426 /* CryptoAlgorithmSHA256Mac.cpp */; };
</span><span class="cx">                 E19AC3E41824DC6900349426 /* CryptoAlgorithmSHA384Mac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E19AC3E01824DC6900349426 /* CryptoAlgorithmSHA384Mac.cpp */; };
</span><span class="lines">@@ -5595,6 +5594,8 @@
</span><span class="cx">                 E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */ = {isa = PBXBuildFile; fileRef = E19AC3EB1824DC7900349426 /* CryptoAlgorithmSHA384.h */; };
</span><span class="cx">                 E19AC3F41824DC7900349426 /* CryptoAlgorithmSHA512.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E19AC3EC1824DC7900349426 /* CryptoAlgorithmSHA512.cpp */; };
</span><span class="cx">                 E19AC3F51824DC7900349426 /* CryptoAlgorithmSHA512.h in Headers */ = {isa = PBXBuildFile; fileRef = E19AC3ED1824DC7900349426 /* CryptoAlgorithmSHA512.h */; };
</span><ins>+                E19AC3F71824E5D100349426 /* CryptoAlgorithmAesKeyGenParams.h in Headers */ = {isa = PBXBuildFile; fileRef = E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParams.h */; };
+                E19AC3F9182566F700349426 /* CryptoKeyMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */; };
</ins><span class="cx">                 E19DA29C18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParams.h in Headers */ = {isa = PBXBuildFile; fileRef = E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParams.h */; };
</span><span class="cx">                 E1A1470811102B1500EEC0F3 /* ContainerNodeAlgorithms.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A1470711102B1500EEC0F3 /* ContainerNodeAlgorithms.h */; };
</span><span class="cx">                 E1A3162D134BC32D007C9A4F /* WebNSAttributedStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = E1A3162B134BC32D007C9A4F /* WebNSAttributedStringExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -11584,6 +11585,7 @@
</span><span class="cx">                 B59DD6A411902A62007E9684 /* JSSQLStatementCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLStatementCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B59DD6A711902A71007E9684 /* JSSQLStatementErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLStatementErrorCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B59DD6A811902A71007E9684 /* JSSQLStatementErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLStatementErrorCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                B59ED23A18272679006D564C /* RenderAncestorIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderAncestorIterator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 B5A684210FFABE9800D24689 /* SQLiteFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SQLiteFileSystem.h; path = sql/SQLiteFileSystem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B5A684230FFABEAA00D24689 /* SQLiteFileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SQLiteFileSystem.cpp; path = sql/SQLiteFileSystem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B5B7A16E17C1048000E4AA0A /* ElementData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ElementData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12612,8 +12614,6 @@
</span><span class="cx">                 E187056216E54A0D00585E97 /* MainThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainThreadTask.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E18772F0126E2629003DD586 /* Language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Language.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E19727151820549E00592D51 /* CryptoKeyType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 E19AC3DE1824DC6900349426 /* CryptoAlgorithmSHA224Mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CryptoAlgorithmSHA224Mac.cpp; path = mac/CryptoAlgorithmSHA224Mac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E19AC3DF1824DC6900349426 /* CryptoAlgorithmSHA256Mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CryptoAlgorithmSHA256Mac.cpp; path = mac/CryptoAlgorithmSHA256Mac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E19AC3E01824DC6900349426 /* CryptoAlgorithmSHA384Mac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CryptoAlgorithmSHA384Mac.cpp; path = mac/CryptoAlgorithmSHA384Mac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12626,6 +12626,8 @@
</span><span class="cx">                 E19AC3EB1824DC7900349426 /* CryptoAlgorithmSHA384.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmSHA384.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E19AC3EC1824DC7900349426 /* CryptoAlgorithmSHA512.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmSHA512.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E19AC3ED1824DC7900349426 /* CryptoAlgorithmSHA512.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmSHA512.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E19AC3F61824E5D100349426 /* CryptoAlgorithmAesKeyGenParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmAesKeyGenParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E19AC3F8182566F700349426 /* CryptoKeyMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E19DA29B18189ADD00088BC8 /* CryptoAlgorithmHmacKeyParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CryptoAlgorithmHmacKeyParams.h; path = parameters/CryptoAlgorithmHmacKeyParams.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1A1470711102B1500EEC0F3 /* ContainerNodeAlgorithms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContainerNodeAlgorithms.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1A3162B134BC32D007C9A4F /* WebNSAttributedStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNSAttributedStringExtras.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20760,6 +20762,7 @@
</span><span class="cx">                                 B2B1F7140D00CAA8004AEA64 /* PointerEventsHitRules.cpp */,
</span><span class="cx">                                 B2B1F7150D00CAA8004AEA64 /* PointerEventsHitRules.h */,
</span><span class="cx">                                 6C70A81417707C49009A446E /* RegionOversetState.h */,
</span><ins>+                                B59ED23A18272679006D564C /* RenderAncestorIterator.h */,
</ins><span class="cx">                                 BCEA4820097D93020094C9E4 /* RenderBlock.cpp */,
</span><span class="cx">                                 BCEA4821097D93020094C9E4 /* RenderBlock.h */,
</span><span class="cx">                                 BCFB45F417D8E49400444446 /* RenderBlockFlow.cpp */,
</span><span class="lines">@@ -22873,6 +22876,7 @@
</span><span class="cx">                                 A8EA7CB50A192B9C00A8EF5F /* HTMLParagraphElement.h in Headers */,
</span><span class="cx">                                 A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */,
</span><span class="cx">                                 BC588AF00BFA6CF900EE679E /* HTMLParserErrorCodes.h in Headers */,
</span><ins>+                                B59ED23B18272679006D564C /* RenderAncestorIterator.h in Headers */,
</ins><span class="cx">                                 93E2A307123E9DC0009FE12A /* HTMLParserIdioms.h in Headers */,
</span><span class="cx">                                 973F418A169B95FF0006BF60 /* HTMLParserOptions.h in Headers */,
</span><span class="cx">                                 449B19F50FA72ECE0015CA4A /* HTMLParserQuirks.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderAncestorIteratorh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/RenderAncestorIterator.h (0 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderAncestorIterator.h                                (rev 0)
+++ trunk/Source/WebCore/rendering/RenderAncestorIterator.h        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -0,0 +1,186 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RenderAncestorIterator_h
+#define RenderAncestorIterator_h
+
+#include &quot;RenderIterator.h&quot;
+
+namespace WebCore {
+
+template &lt;typename T&gt;
+class RenderAncestorIterator : public RenderIterator&lt;T&gt; {
+public:
+    RenderAncestorIterator();
+    explicit RenderAncestorIterator(T* current);
+    RenderAncestorIterator&amp; operator++();
+};
+
+template &lt;typename T&gt;
+class RenderAncestorConstIterator : public RenderConstIterator&lt;T&gt; {
+public:
+    RenderAncestorConstIterator();
+    explicit RenderAncestorConstIterator(const T* current);
+    RenderAncestorConstIterator&amp; operator++();
+};
+
+template &lt;typename T&gt;
+class RenderAncestorIteratorAdapter {
+public:
+    RenderAncestorIteratorAdapter(T* first);
+    RenderAncestorIterator&lt;T&gt; begin();
+    RenderAncestorIterator&lt;T&gt; end();
+    T* first();
+
+private:
+    T* m_first;
+};
+
+template &lt;typename T&gt;
+class RenderAncestorConstIteratorAdapter {
+public:
+    RenderAncestorConstIteratorAdapter(const T* first);
+    RenderAncestorConstIterator&lt;T&gt; begin() const;
+    RenderAncestorConstIterator&lt;T&gt; end() const;
+    const T* first() const;
+
+private:
+    const T* m_first;
+};
+
+template &lt;typename T&gt; RenderAncestorIteratorAdapter&lt;T&gt; ancestorsOfType(RenderObject&amp;);
+template &lt;typename T&gt; RenderAncestorConstIteratorAdapter&lt;T&gt; ancestorsOfType(const RenderObject&amp;);
+
+// RenderAncestorIterator
+
+template &lt;typename T&gt;
+inline RenderAncestorIterator&lt;T&gt;::RenderAncestorIterator()
+    : RenderIterator&lt;T&gt;(nullptr)
+{
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorIterator&lt;T&gt;::RenderAncestorIterator(T* current)
+    : RenderIterator&lt;T&gt;(nullptr, current)
+{
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorIterator&lt;T&gt;&amp; RenderAncestorIterator&lt;T&gt;::operator++()
+{
+    return static_cast&lt;RenderAncestorIterator&lt;T&gt;&amp;&gt;(RenderIterator&lt;T&gt;::traverseNextSibling());
+}
+
+// RenderAncestorConstIterator
+
+template &lt;typename T&gt;
+inline RenderAncestorConstIterator&lt;T&gt;::RenderAncestorConstIterator()
+    : RenderConstIterator&lt;T&gt;(nullptr)
+{
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorConstIterator&lt;T&gt;::RenderAncestorConstIterator(const T* current)
+    : RenderConstIterator&lt;T&gt;(nullptr, current)
+{
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorConstIterator&lt;T&gt;&amp; RenderAncestorConstIterator&lt;T&gt;::operator++()
+{
+    return static_cast&lt;RenderAncestorConstIterator&lt;T&gt;&amp;&gt;(RenderConstIterator&lt;T&gt;::traverseAncestor());
+}
+
+// RenderAncestorIteratorAdapter
+
+template &lt;typename T&gt;
+inline RenderAncestorIteratorAdapter&lt;T&gt;::RenderAncestorIteratorAdapter(T* first)
+    : m_first(first)
+{
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorIterator&lt;T&gt; RenderAncestorIteratorAdapter&lt;T&gt;::begin()
+{
+    return RenderAncestorIterator&lt;T&gt;(m_first);
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorIterator&lt;T&gt; RenderAncestorIteratorAdapter&lt;T&gt;::end()
+{
+    return RenderAncestorIterator&lt;T&gt;();
+}
+
+template &lt;typename T&gt;
+inline T* RenderAncestorIteratorAdapter&lt;T&gt;::first()
+{
+    return m_first;
+}
+
+// RenderAncestorConstIteratorAdapter
+
+template &lt;typename T&gt;
+inline RenderAncestorConstIteratorAdapter&lt;T&gt;::RenderAncestorConstIteratorAdapter(const T* first)
+    : m_first(first)
+{
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorConstIterator&lt;T&gt; RenderAncestorConstIteratorAdapter&lt;T&gt;::begin() const
+{
+    return RenderAncestorConstIterator&lt;T&gt;(m_first);
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorConstIterator&lt;T&gt; RenderAncestorConstIteratorAdapter&lt;T&gt;::end() const
+{
+    return RenderAncestorConstIterator&lt;T&gt;();
+}
+
+template &lt;typename T&gt;
+inline const T* RenderAncestorConstIteratorAdapter&lt;T&gt;::first() const
+{
+    return m_first;
+}
+
+// Standalone functions
+
+template &lt;typename T&gt;
+inline RenderAncestorIteratorAdapter&lt;T&gt; ancestorsOfType(RenderObject&amp; descendant)
+{
+    T* first = RenderTraversal::findAncestorOfType&lt;T&gt;(descendant);
+    return RenderAncestorIteratorAdapter&lt;T&gt;(first);
+}
+
+template &lt;typename T&gt;
+inline RenderAncestorConstIteratorAdapter&lt;T&gt; ancestorsOfType(const RenderObject&amp; descendant)
+{
+    const T* first = RenderTraversal::findAncestorOfType&lt;const T&gt;(descendant);
+    return RenderAncestorConstIteratorAdapter&lt;T&gt;(first);
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.h (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.h        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderBlock.h        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -419,6 +419,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void updateHitTestResult(HitTestResult&amp;, const LayoutPoint&amp;) OVERRIDE;
</span><span class="cx"> 
</span><ins>+    virtual bool canHaveChildren() const OVERRIDE { return true; }
+
</ins><span class="cx"> protected:
</span><span class="cx">     virtual void willBeDestroyed() OVERRIDE;
</span><span class="cx"> 
</span><span class="lines">@@ -525,7 +527,6 @@
</span><span class="cx">     virtual const char* renderName() const OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     virtual bool isInlineBlockOrInlineTable() const OVERRIDE FINAL { return isInline() &amp;&amp; isReplaced(); }
</span><del>-    virtual bool canHaveChildren() const OVERRIDE { return true; }
</del><span class="cx"> 
</span><span class="cx">     void makeChildrenNonInline(RenderObject* insertionPoint = nullptr);
</span><span class="cx">     virtual void removeLeftoverAnonymousBlock(RenderBlock* child);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;InlineTextBox.h&quot;
</span><span class="cx"> #include &quot;LayoutRepainter.h&quot;
</span><span class="cx"> #include &quot;RenderFlowThread.h&quot;
</span><ins>+#include &quot;RenderIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderLayer.h&quot;
</span><span class="cx"> #include &quot;RenderNamedFlowFragment.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="lines">@@ -1734,19 +1735,17 @@
</span><span class="cx">     if (diff == StyleDifferenceLayout &amp;&amp; s_canPropagateFloatIntoSibling &amp;&amp; !canPropagateFloatIntoSibling &amp;&amp; hasOverhangingFloats()) {
</span><span class="cx">         RenderBlockFlow* parentBlock = this;
</span><span class="cx">         const FloatingObjectSet&amp; floatingObjectSet = m_floatingObjects-&gt;set();
</span><del>-        auto end = floatingObjectSet.end();
</del><span class="cx"> 
</span><del>-        for (auto curr = parent(); curr &amp;&amp; !curr-&gt;isRenderView(); curr = curr-&gt;parent()) {
-            if (curr-&gt;isRenderBlockFlow()) {
-                RenderBlockFlow* currBlock = toRenderBlockFlow(curr);
-
-                if (currBlock-&gt;hasOverhangingFloats()) {
-                    for (auto it = floatingObjectSet.begin(); it != end; ++it) {
-                        RenderBox&amp; renderer = (*it)-&gt;renderer();
-                        if (currBlock-&gt;hasOverhangingFloat(renderer)) {
-                            parentBlock = currBlock;
-                            break;
-                        }
</del><ins>+        auto ancestors = ancestorsOfType&lt;RenderBlockFlow&gt;(*this);
+        for (auto ancestor = ancestors.begin(), end = ancestors.end(); ancestor != end; ++ancestor) {
+            if (ancestor-&gt;isRenderView())
+                break;
+            if (ancestor-&gt;hasOverhangingFloats()) {
+                for (auto it = floatingObjectSet.begin(), end = floatingObjectSet.end(); it != end; ++it) {
+                    RenderBox&amp; renderer = (*it)-&gt;renderer();
+                    if (ancestor-&gt;hasOverhangingFloat(renderer)) {
+                        parentBlock = &amp;*ancestor;
+                        break;
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -523,6 +523,7 @@
</span><span class="cx">     friend class LineWidth; // Needs to know FloatingObject
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; inline bool isRendererOfType&lt;const RenderBlockFlow&gt;(const RenderObject&amp; renderer) { return renderer.isRenderBlockFlow(); }
</ins><span class="cx"> RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow())
</span><span class="cx"> 
</span><span class="cx"> inline bool RenderElement::isRenderNamedFlowFragmentContainer() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -235,13 +235,13 @@
</span><span class="cx"> RenderBlockFlow* RenderBox::outermostBlockContainingFloatingObject()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isFloating());
</span><del>-    RenderBlockFlow* parentBlock = 0;
-    for (auto curr = parent(); curr &amp;&amp; !curr-&gt;isRenderView(); curr = curr-&gt;parent()) {
-        if (curr-&gt;isRenderBlockFlow()) {
-            RenderBlockFlow* currBlock = toRenderBlockFlow(curr);
-            if (!parentBlock || currBlock-&gt;containsFloat(*this))
-                parentBlock = currBlock;
-        }
</del><ins>+    RenderBlockFlow* parentBlock = nullptr;
+    auto ancestors = ancestorsOfType&lt;RenderBlockFlow&gt;(*this);
+    for (auto ancestor = ancestors.begin(), end = ancestors.end(); ancestor != end; ++ancestor) {
+        if (ancestor-&gt;isRenderView())
+            break;
+        if (!parentBlock || ancestor-&gt;containsFloat(*this))
+            parentBlock = &amp;*ancestor;
</ins><span class="cx">     }
</span><span class="cx">     return parentBlock;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFrameSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFrameSet.cpp (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFrameSet.cpp        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.cpp        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 2000 Simon Hausmann &lt;hausmann@kde.org&gt;
</span><span class="cx">  *           (C) 2000 Stefan Schimanski (1Stein@gmx.de)
</span><del>- * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
</del><ins>+ * Copyright (C) 2004, 2005, 2006, 2013 Apple Computer, Inc.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;MouseEvent.h&quot;
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><span class="cx"> #include &quot;RenderFrame.h&quot;
</span><ins>+#include &quot;RenderIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderLayer.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="lines">@@ -708,10 +709,9 @@
</span><span class="cx"> void RenderFrameSet::setIsResizing(bool isResizing)
</span><span class="cx"> {
</span><span class="cx">     m_isResizing = isResizing;
</span><del>-    for (auto ancestor = parent(); ancestor; ancestor = ancestor-&gt;parent()) {
-        if (ancestor-&gt;isFrameSet())
-            toRenderFrameSet(ancestor)-&gt;m_isChildResizing = isResizing;
-    }
</del><ins>+    auto ancestors = ancestorsOfType&lt;RenderFrameSet&gt;(*this);
+    for (auto ancestor = ancestors.begin(), end = ancestors.end(); ancestor != end; ++ancestor)
+        ancestor-&gt;m_isChildResizing = isResizing;
</ins><span class="cx">     frame().eventHandler().setResizingFrameSet(isResizing ? &amp;frameSetElement() : 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderFrameSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderFrameSet.h (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderFrameSet.h        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.h        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -126,6 +126,7 @@
</span><span class="cx">     bool m_isChildResizing;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; inline bool isRendererOfType&lt;const RenderFrameSet&gt;(const RenderObject&amp; renderer) { return renderer.isFrameSet(); }
</ins><span class="cx"> RENDER_OBJECT_TYPE_CASTS(RenderFrameSet, isFrameSet())
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderIterator.h (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderIterator.h        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderIterator.h        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     RenderIterator&amp; traverseNextSibling();
</span><span class="cx">     RenderIterator&amp; traversePreviousSibling();
</span><ins>+    RenderIterator&amp; traverseAncestor();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const RenderElement* m_root;
</span><span class="lines">@@ -64,6 +65,7 @@
</span><span class="cx"> 
</span><span class="cx">     RenderConstIterator&amp; traverseNextSibling();
</span><span class="cx">     RenderConstIterator&amp; traversePreviousSibling();
</span><ins>+    RenderConstIterator&amp; traverseAncestor();
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const RenderElement* m_root;
</span><span class="lines">@@ -110,6 +112,16 @@
</span><span class="cx">     return static_cast&lt;T*&gt;(object);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template &lt;typename T&gt;
+inline T* findAncestorOfType(const RenderObject&amp; current)
+{
+    for (auto ancestor = current.parent(); ancestor; ancestor = ancestor-&gt;parent()) {
+        if (isRendererOfType&lt;const T&gt;(*ancestor))
+            return static_cast&lt;T*&gt;(ancestor);
+    }
+    return nullptr;
+}
+
</ins><span class="cx"> } // namespace WebCore::RenderTraversal
</span><span class="cx"> 
</span><span class="cx"> // RenderIterator
</span><span class="lines">@@ -145,6 +157,15 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename T&gt;
</span><ins>+inline RenderIterator&lt;T&gt;&amp; RenderIterator&lt;T&gt;::traverseAncestor()
+{
+    ASSERT(m_current);
+    ASSERT(m_current != m_root);
+    m_current = RenderTraversal::findAncestorOfType&lt;T&gt;(*m_current);
+    return *this;
+}
+
+template &lt;typename T&gt;
</ins><span class="cx"> inline T&amp; RenderIterator&lt;T&gt;::operator*()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_current);
</span><span class="lines">@@ -203,7 +224,17 @@
</span><span class="cx">     return *this;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> template &lt;typename T&gt;
</span><ins>+inline RenderConstIterator&lt;T&gt;&amp; RenderConstIterator&lt;T&gt;::traverseAncestor()
+{
+    ASSERT(m_current);
+    ASSERT(m_current != m_root);
+    m_current = RenderTraversal::findAncestorOfType&lt;const T&gt;(*m_current);
+    return *this;
+}
+
+template &lt;typename T&gt;
</ins><span class="cx"> inline const T&amp; RenderConstIterator&lt;T&gt;::operator*() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_current);
</span><span class="lines">@@ -232,6 +263,7 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#include &quot;RenderAncestorIterator.h&quot;
</ins><span class="cx"> #include &quot;RenderChildIterator.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextFragmentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextFragment.cpp (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextFragment.cpp        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderTextFragment.cpp        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;RenderTextFragment.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><ins>+#include &quot;RenderIterator.h&quot;
</ins><span class="cx"> #include &quot;Text.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -121,15 +122,16 @@
</span><span class="cx">     return RenderText::previousCharacter();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RenderBlock* RenderTextFragment::blockForAccompanyingFirstLetter() const
</del><ins>+RenderBlock* RenderTextFragment::blockForAccompanyingFirstLetter()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_firstLetter)
</span><del>-        return 0;
-    for (RenderObject* block = m_firstLetter-&gt;parent(); block; block = block-&gt;parent()) {
-        if (block-&gt;style().hasPseudoStyle(FIRST_LETTER) &amp;&amp; block-&gt;canHaveChildren() &amp;&amp; block-&gt;isRenderBlock())
-            return toRenderBlock(block);
</del><ins>+        return nullptr;
+    auto ancestorBlocks = ancestorsOfType&lt;RenderBlock&gt;(*m_firstLetter);
+    for (auto block = ancestorBlocks.begin(), end = ancestorBlocks.end(); block != end; ++block) {
+        if (block-&gt;style().hasPseudoStyle(FIRST_LETTER) &amp;&amp; block-&gt;canHaveChildren())
+            return &amp;*block;
</ins><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextFragmenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTextFragment.h (158560 => 158561)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTextFragment.h        2013-11-04 08:40:07 UTC (rev 158560)
+++ trunk/Source/WebCore/rendering/RenderTextFragment.h        2013-11-04 08:46:06 UTC (rev 158561)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     virtual void willBeDestroyed() OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     virtual UChar previousCharacter() const OVERRIDE;
</span><del>-    RenderBlock* blockForAccompanyingFirstLetter() const;
</del><ins>+    RenderBlock* blockForAccompanyingFirstLetter();
</ins><span class="cx"> 
</span><span class="cx">     unsigned m_start;
</span><span class="cx">     unsigned m_end;
</span></span></pre>
</div>
</div>

</body>
</html>