<!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>[191199] branches/safari-601.1.46-branch</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/191199">191199</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2015-10-16 13:05:20 -0700 (Fri, 16 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/190752">r190752</a>. rdar://problem/23110932</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsChangeLog">branches/safari-601.1.46-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601146branchLayoutTestsfastformsformandframeinteractionretainsvaluesexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/fast/forms/form-and-frame-interaction-retains-values-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestshttptestsnavigationimageloadinsubframeunloadhandlerexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/http/tests/navigation/image-load-in-subframe-unload-handler-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestshttptestssecuritydataURLxssDENIEDfromdataurlsubframe2levelexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestshttptestssecuritydataURLxssDENIEDtodataurlsubframe2levelexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestshttptestssecurityjavascriptURLxssALLOWEDfromjavascripturlsubframe2levelexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-sub-frame-2-level-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestshttptestssecurityjavascriptURLxssALLOWEDfromjavascripturltojavscripturlexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-to-javscript-url-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestshttptestssecurityjavascriptURLxssALLOWEDtojavascripturlfromjavscripturlexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-from-javscript-url-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestshttptestssecurityjavascriptURLxssALLOWEDtojavascripturlsubframe2levelexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level-expected.txt</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCorepageFrameTreecpp">branches/safari-601.1.46-branch/Source/WebCore/page/FrameTree.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorepageFrameTreeh">branches/safari-601.1.46-branch/Source/WebCore/page/FrameTree.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601146branchLayoutTestsfastframeslongnamesinnestedsubframesexpectedtxt">branches/safari-601.1.46-branch/LayoutTests/fast/frames/long-names-in-nested-subframes-expected.txt</a></li>
<li><a href="#branchessafari601146branchLayoutTestsfastframeslongnamesinnestedsubframeshtml">branches/safari-601.1.46-branch/LayoutTests/fast/frames/long-names-in-nested-subframes.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-10-16 Matthew Hanson <matthew_hanson@apple.com>
+
+ Merge r190752. rdar://problem/23110932
+
+ 2015-10-08 Andreas Kling <akling@apple.com>
+
+ Generated frame tree names should be kept reasonably long.
+ <https://webkit.org/b/149874>
+
+ Reviewed by Darin Adler.
+
+ Added a test to document our name generation behavior for subframes with long-named ancestors.
+ Also rebaselined some tests that exposed the old behavior.
+
+ * fast/forms/form-and-frame-interaction-retains-values-expected.txt:
+ * fast/frames/long-names-in-nested-subframes-expected.txt: Added.
+ * fast/frames/long-names-in-nested-subframes.html: Added.
+ * http/tests/navigation/image-load-in-subframe-unload-handler-expected.txt:
+ * http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt:
+ * http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt:
+ * http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-sub-frame-2-level-expected.txt:
+ * http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-to-javscript-url-expected.txt:
+ * http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-from-javscript-url-expected.txt:
+
</ins><span class="cx"> 2015-10-15 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r190604. rdar://problem/22993012
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastformsformandframeinteractionretainsvaluesexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/fast/forms/form-and-frame-interaction-retains-values-expected.txt (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/forms/form-and-frame-interaction-retains-values-expected.txt        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/forms/form-and-frame-interaction-retains-values-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -13,6 +13,6 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> --------
</span><del>-Frame: '<!--framePath //submitted/<!--frame0-->-->'
</del><ins>+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
</ins><span class="cx"> --------
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastframeslongnamesinnestedsubframesexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/frames/long-names-in-nested-subframes-expected.txt (0 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/frames/long-names-in-nested-subframes-expected.txt         (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/frames/long-names-in-nested-subframes-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+
+
+--------
+Frame: 'since_this_name_is_very_long_it_would_not_be_great_to_repeat_it_in_every_frame_path'
+--------
+
+
+--------
+Frame: 'and_this_name_is_long_too_so_we_would_get_pretty_long_names'
+--------
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->/<!--frame0-->-->'
+--------
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->/<!--frame1-->-->'
+--------
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->/<!--frame2-->-->'
+--------
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->/<!--frame3-->-->'
+--------
+
</ins></span></pre></div>
<a id="branchessafari601146branchLayoutTestsfastframeslongnamesinnestedsubframeshtml"></a>
<div class="addfile"><h4>Added: branches/safari-601.1.46-branch/LayoutTests/fast/frames/long-names-in-nested-subframes.html (0 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/fast/frames/long-names-in-nested-subframes.html         (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/frames/long-names-in-nested-subframes.html        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+<html>
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.dumpChildFramesAsText();
+}
+</script>
+</head>
+<body>
+<iframe
+ name="since_this_name_is_very_long_it_would_not_be_great_to_repeat_it_in_every_frame_path"
+ src="data:text/html,
+ <iframe name=and_this_name_is_long_too_so_we_would_get_pretty_long_names src='data:text/html,
+ <!-- finally some nameless frames to make WebKit run the name generator -->
+ <iframe></iframe>
+ <iframe></iframe>
+ <iframe></iframe>
+ <iframe></iframe>
+ '></iframe>">
+</iframe>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari601146branchLayoutTestshttptestsnavigationimageloadinsubframeunloadhandlerexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/http/tests/navigation/image-load-in-subframe-unload-handler-expected.txt (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/http/tests/navigation/image-load-in-subframe-unload-handler-expected.txt        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/navigation/image-load-in-subframe-unload-handler-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -1,2 +1,2 @@
</span><del>-frame "<!--framePath //target/<!--frame0-->-->" - has 1 onunload handler(s)
</del><ins>+frame "<!--framePath //<!--frame0-->/<!--frame0-->-->" - has 1 onunload handler(s)
</ins><span class="cx"> This test triggers an unload handler that starts an image load in a different frame (and deletes both frames), but ensures the main frame is not destroyed. We pass if we don't crash.
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestshttptestssecuritydataURLxssDENIEDfromdataurlsubframe2levelexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-2-level-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -13,6 +13,6 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> --------
</span><del>-Frame: '<!--framePath //aFrame/<!--frame0-->-->'
</del><ins>+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
</ins><span class="cx"> --------
</span><span class="cx"> Inner-inner iframe.
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestshttptestssecuritydataURLxssDENIEDtodataurlsubframe2levelexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-sub-frame-2-level-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> --------
</span><del>-Frame: '<!--framePath //aFrame/<!--frame0-->-->'
</del><ins>+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
</ins><span class="cx"> --------
</span><span class="cx"> PASS: Cross frame access to a data: URL 2 levels deep was denied.
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestshttptestssecurityjavascriptURLxssALLOWEDfromjavascripturlsubframe2levelexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-sub-frame-2-level-expected.txt (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-sub-frame-2-level-expected.txt        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-sub-frame-2-level-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -10,6 +10,6 @@
</span><span class="cx"> Inner iframe.
</span><span class="cx">
</span><span class="cx"> --------
</span><del>-Frame: '<!--framePath //aFrame/<!--frame0-->-->'
</del><ins>+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
</ins><span class="cx"> --------
</span><span class="cx"> Inner-inner iframe.
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestshttptestssecurityjavascriptURLxssALLOWEDfromjavascripturltojavscripturlexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-to-javscript-url-expected.txt (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-to-javscript-url-expected.txt        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-from-javascript-url-to-javscript-url-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> Inner iframe.
</span><span class="cx">
</span><span class="cx"> --------
</span><del>-Frame: '<!--framePath //aFrame/<!--frame0-->-->'
</del><ins>+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
</ins><span class="cx"> --------
</span><span class="cx"> PASS: Cross frame access from a javascript: URL was allowed!
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestshttptestssecurityjavascriptURLxssALLOWEDtojavascripturlfromjavscripturlexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-from-javscript-url-expected.txt (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-from-javscript-url-expected.txt        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-from-javscript-url-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -11,6 +11,6 @@
</span><span class="cx"> Inner iframe.
</span><span class="cx">
</span><span class="cx"> --------
</span><del>-Frame: '<!--framePath //aFrame/<!--frame0-->-->'
</del><ins>+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
</ins><span class="cx"> --------
</span><span class="cx"> Inner-inner iframe.
</span></span></pre></div>
<a id="branchessafari601146branchLayoutTestshttptestssecurityjavascriptURLxssALLOWEDtojavascripturlsubframe2levelexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level-expected.txt (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level-expected.txt        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level-expected.txt        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -11,7 +11,7 @@
</span><span class="cx"> Inner iframe.
</span><span class="cx">
</span><span class="cx"> --------
</span><del>-Frame: '<!--framePath //aFrame/<!--frame0-->-->'
</del><ins>+Frame: '<!--framePath //<!--frame0-->/<!--frame0-->-->'
</ins><span class="cx"> --------
</span><span class="cx"> PASS: Cross frame access to a javascript: URL 2 levels deep was allowed!
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2015-10-16 Matthew Hanson <matthew_hanson@apple.com>
+
+ Merge r190752. rdar://problem/23110932
+
+ 2015-10-08 Andreas Kling <akling@apple.com>
+
+ Generated frame tree names should be kept reasonably long.
+ <https://webkit.org/b/149874>
+
+ Reviewed by Darin Adler.
+
+ Some clumsy advertising script is going around assigning JavaScript source code
+ to the "name" attribute of iframes. This is causing WebKit to generate way too huge
+ names for anonymous descendants of such iframes.
+
+ Previously, the generated name of an anonymous subframe would be its slash-separated
+ path from the root frame, with the "name" attribute of each ancestor between the
+ slashes, or "<!--frame${index in parent}-->" for anonymous ancestors.
+
+ These ad scripts are often over 100kB in size, with multiple subframes, so we'd end
+ up with frame names looking like this:
+
+ "<!--framePath //<MONSTER BLOB OF JAVASCRIPT FROM HELL>/<!--frame0--><!--frame0-->-->"
+
+ While this is worth fixing for the memory usage alone, we've been making it way
+ worse by also using these paths when recording the back/forward history parts of
+ WebKit session state.
+
+ This patch makes generated paths always use index-in-parent as the "directory name"
+ for ancestors of anonymous subframes. The above example path will now instead be:
+
+ "<!--framePath //<!--frame0-->/<!--frame0-->/<!--frame0-->-->"
+
+ Test: fast/frames/long-names-in-nested-subframes.html
+
+ * page/FrameTree.cpp:
+ (WebCore::FrameTree::indexInParent):
+ (WebCore::FrameTree::uniqueChildName):
+ * page/FrameTree.h:
+
</ins><span class="cx"> 2015-10-15 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r190604. rdar://problem/22993012
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorepageFrameTreecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/page/FrameTree.cpp (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/page/FrameTree.cpp        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/Source/WebCore/page/FrameTree.cpp        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -82,6 +82,19 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+unsigned FrameTree::indexInParent() const
+{
+ if (!m_parent)
+ return 0;
+ unsigned index = 0;
+ for (Frame* frame = m_parent->tree().firstChild(); frame; frame = frame->tree().nextSibling()) {
+ if (&frame->tree() == this)
+ return index;
+ ++index;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+}
+
</ins><span class="cx"> void FrameTree::appendChild(PassRefPtr<Frame> child)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(child->page() == m_thisFrame.page());
</span><span class="lines">@@ -128,16 +141,17 @@
</span><span class="cx">
</span><span class="cx"> AtomicString FrameTree::uniqueChildName(const AtomicString& requestedName) const
</span><span class="cx"> {
</span><ins>+ // If the requested name (the frame's "name" attribute) is unique, just use that.
</ins><span class="cx"> if (!requestedName.isEmpty() && !child(requestedName) && requestedName != "_blank")
</span><span class="cx"> return requestedName;
</span><span class="cx">
</span><del>- // Create a repeatable name for a child about to be added to us. The name must be
- // unique within the frame tree. The string we generate includes a "path" of names
- // from the root frame down to us. For this path to be unique, each set of siblings must
- // contribute a unique name to the path, which can't collide with any HTML-assigned names.
- // We generate this path component by index in the child list along with an unlikely
- // frame name that can't be set in HTML because it collides with comment syntax.
</del><ins>+ // The "name" attribute was not unique or absent. Generate a name based on the
+ // new frame's location in the frame tree. The name uses HTML comment syntax to
+ // avoid collisions with author names.
</ins><span class="cx">
</span><ins>+ // An example path for the third child of the second child of the root frame:
+ // <!--framePath //<!--frame1-->/<!--frame2-->-->
+
</ins><span class="cx"> const char framePathPrefix[] = "<!--framePath ";
</span><span class="cx"> const int framePathPrefixLength = 14;
</span><span class="cx"> const int framePathSuffixLength = 3;
</span><span class="lines">@@ -159,7 +173,11 @@
</span><span class="cx"> for (int i = chain.size() - 1; i >= 0; --i) {
</span><span class="cx"> frame = chain[i];
</span><span class="cx"> name.append('/');
</span><del>- name.append(frame->tree().uniqueName());
</del><ins>+ if (frame->tree().parent()) {
+ name.appendLiteral("<!--frame");
+ name.appendNumber(frame->tree().indexInParent());
+ name.appendLiteral("-->");
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> name.appendLiteral("/<!--frame");
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorepageFrameTreeh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/page/FrameTree.h (191198 => 191199)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/page/FrameTree.h        2015-10-16 20:04:13 UTC (rev 191198)
+++ branches/safari-601.1.46-branch/Source/WebCore/page/FrameTree.h        2015-10-16 20:05:20 UTC (rev 191199)
</span><span class="lines">@@ -84,6 +84,8 @@
</span><span class="cx"> Frame* scopedChild(const AtomicString& name) const;
</span><span class="cx"> unsigned scopedChildCount() const;
</span><span class="cx">
</span><ins>+ unsigned indexInParent() const;
+
</ins><span class="cx"> private:
</span><span class="cx"> Frame* deepLastChild() const;
</span><span class="cx"> void actuallyAppendChild(PassRefPtr<Frame>);
</span></span></pre>
</div>
</div>
</body>
</html>