<!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>[193737] branches/safari-601-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/193737">193737</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-12-08 00:53:08 -0800 (Tue, 08 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/192604">r192604</a>. rdar://problem/23787086</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsChangeLog">branches/safari-601-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari601branchLayoutTestsplatformmacwk2TestExpectations">branches/safari-601-branch/LayoutTests/platform/mac-wk2/TestExpectations</a></li>
<li><a href="#branchessafari601branchSourceWebCoreChangeLog">branches/safari-601-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebCorepagePerformanceTimingcpp">branches/safari-601-branch/Source/WebCore/page/PerformanceTiming.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601branchLayoutTestsfastdomWindow666869expectedtxt">branches/safari-601-branch/LayoutTests/fast/dom/Window/666869-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestsfastdomWindow666869html">branches/safari-601-branch/LayoutTests/fast/dom/Window/666869.html</a></li>
<li><a href="#branchessafari601branchLayoutTestsfastdomWindowpropertyaccessoncachedwindowafterframeremovedexpectedtxt">branches/safari-601-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt</a></li>
<li><a href="#branchessafari601branchLayoutTestsfastdomWindowpropertyaccessoncachedwindowafterframeremovedhtml">branches/safari-601-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed.html</a></li>
<li><a href="#branchessafari601branchLayoutTestsfastdomWindowresourceswindowpropertycollectorjs">branches/safari-601-branch/LayoutTests/fast/dom/Window/resources/window-property-collector.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/ChangeLog (193736 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/ChangeLog        2015-12-08 08:51:59 UTC (rev 193736)
+++ branches/safari-601-branch/LayoutTests/ChangeLog        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -1,5 +1,30 @@
</span><span class="cx"> 2015-12-08 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r192604.
+
+ 2015-11-18 Jiewen Tan <jiewen_tan@apple.com>
+
+ [WK1] Crash loading Blink layout test fast/dom/Window/property-access-on-cached-window-after-frame-removed.html
+ https://bugs.webkit.org/show_bug.cgi?id=150198
+ <rdar://problem/23136026>
+
+ Reviewed by Brent Fulgham.
+
+ * fast/dom/Window/666869-expected.txt: Added.
+ * fast/dom/Window/666869.html: Added.
+ Test case is from Mozilla.
+ * fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt: Added.
+ * fast/dom/Window/property-access-on-cached-window-after-frame-removed.html: Added.
+ * fast/dom/Window/resources/window-property-collector.js: Added.
+ (collectProperties):
+ (emitExpectedResult):
+ (collectPropertiesHelper):
+ Test case is from Blink r168256:
+ https://codereview.chromium.org/131113003
+ * platform/mac-wk2/TestExpectations:
+
+2015-12-08 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r192433.
</span><span class="cx">
</span><span class="cx"> 2015-11-13 Jiewen Tan <jiewen_tan@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchLayoutTestsfastdomWindow666869expectedtxtfromrev193708branchessafari60114660branchLayoutTestsfastdomWindow666869expectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/LayoutTests/fast/dom/Window/666869-expected.txt (from rev 193708, branches/safari-601.1.46.60-branch/LayoutTests/fast/dom/Window/666869-expected.txt) (0 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/fast/dom/Window/666869-expected.txt         (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/dom/Window/666869-expected.txt        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+PASS. WebKit didn't crash.
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsfastdomWindow666869htmlfromrev193708branchessafari60114660branchLayoutTestsfastdomWindow666869html"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/LayoutTests/fast/dom/Window/666869.html (from rev 193708, branches/safari-601.1.46.60-branch/LayoutTests/fast/dom/Window/666869.html) (0 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/fast/dom/Window/666869.html         (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/dom/Window/666869.html        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function boom()
+ {
+ var f = document.getElementById("f");
+ var frameWin = f.contentWindow;
+ document.body.removeChild(f);
+ frameWin.performance;
+
+ document.write("PASS. WebKit didn't crash.");
+ }
+</script>
+</head>
+<body onload="boom();"><iframe id="f" src="data:text/html,1"></iframe></body>
+</html>
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsfastdomWindowpropertyaccessoncachedwindowafterframeremovedexpectedtxtfromrev193708branchessafari60114660branchLayoutTestsfastdomWindowpropertyaccessoncachedwindowafterframeremovedexpectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt (from rev 193708, branches/safari-601.1.46.60-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt) (0 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt         (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+Pass. WebKit didn't crash.
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsfastdomWindowpropertyaccessoncachedwindowafterframeremovedhtmlfromrev193708branchessafari60114660branchLayoutTestsfastdomWindowpropertyaccessoncachedwindowafterframeremovedhtml"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed.html (from rev 193708, branches/safari-601.1.46.60-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed.html) (0 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed.html         (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed.html        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<script src="resources/window-property-collector.js"></script>
+<script>
+var childWindow;
+var propertiesToVerify = [];
+
+function insertExpectedResult(path, expected)
+{
+ var propertyPath = path.join('.');
+ propertiesToVerify.push({'property': "childWindow." + propertyPath, 'expected': expected});
+}
+
+function runTest()
+{
+ var frame = document.getElementById("frame");
+ childWindow = frame.contentWindow;
+ // Have expected results assume that the frame has been closed (=> window.closed = true.)
+ collectProperties(true);
+ frame.parentNode.removeChild(frame);
+ for (var i = 0; i < propertiesToVerify.length; ++i)
+ shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected);
+ document.write("Pass. WebKit didn't crash.");
+}
+</script>
+</head>
+<body>
+<iframe id="frame" src="about:blank" onload="runTest()"></iframe>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsfastdomWindowresourceswindowpropertycollectorjsfromrev193708branchessafari60114660branchLayoutTestsfastdomWindowresourceswindowpropertycollectorjs"></a>
<div class="copfile"><h4>Copied: branches/safari-601-branch/LayoutTests/fast/dom/Window/resources/window-property-collector.js (from rev 193708, branches/safari-601.1.46.60-branch/LayoutTests/fast/dom/Window/resources/window-property-collector.js) (0 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/fast/dom/Window/resources/window-property-collector.js         (rev 0)
+++ branches/safari-601-branch/LayoutTests/fast/dom/Window/resources/window-property-collector.js        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -0,0 +1,121 @@
</span><ins>+function collectProperties(windowHasBeenGCed)
+{
+ // Collect properties of the top-level window, since touching the properties
+ // of a DOMWindow affects its internal C++ state.
+ collectPropertiesHelper(window, windowHasBeenGCed, []);
+
+ propertiesToVerify.sort(function (a, b)
+ {
+ if (a.property < b.property)
+ return -1
+ if (a.property > b.property)
+ return 1;
+ return 0;
+ });
+}
+
+function emitExpectedResult(path, expected)
+{
+ // Skip internals properties, since they aren't web accessible.
+ if (path[0] == 'internals'
+ || path[0] == 'propertiesToVerify' // Skip the list we're building...
+ || path[0] == 'clientInformation' // Just an alias for navigator.
+ || path[0] == 'testRunner' // Skip testRunner since they are only for testing.
+ || path[0] == 'layoutTestController' // Just an alias for testRunner.
+ || path[0] == 'eventSender') { // Skip eventSender since they are only for testing.
+ return;
+ }
+
+ // Skip the properties which are hard to expect a stable result.
+ if (path[0] == 'accessibilityController' // we can hardly estimate the states of the cached WebAXObjects.
+ || path[0] == 'localStorage') { // local storage is not reliably cleared between tests.
+ return;
+ }
+
+ // FIXME: Skip MemoryInfo for now, since it's not implemented as a DOMWindowProperty, and has
+ // no way of knowing when it's detached. Eventually this should have the same behavior.
+ if (path.length >= 2 && (path[0] == 'console' || path[0] == 'performance') && path[1] == 'memory')
+ return;
+
+ // Skip things that are assumed to be constants.
+ if (path[path.length - 1].toUpperCase() == path[path.length - 1])
+ return;
+
+ // Various special cases for legacy reasons. Please do not add entries to this list.
+ var propertyPath = path.join('.');
+
+ // Connection type depends on the host, skip.
+ if (propertyPath == 'navigator.connection.type')
+ return;
+ if (propertyPath == 'navigator.connection.downlinkMax')
+ return;
+
+ switch (propertyPath) {
+ case "location.href":
+ expected = "'about:blank'";
+ break;
+ case "location.origin":
+ expected = "'null'";
+ break;
+ case "location.pathname":
+ expected = "'blank'";
+ break;
+ case "location.protocol":
+ expected = "'about:'";
+ break;
+ case "navigator.appCodeName":
+ case "navigator.appName":
+ case "navigator.hardwareConcurrency":
+ case "navigator.language":
+ case "navigator.onLine":
+ case "navigator.platform":
+ case "navigator.product":
+ case "navigator.productSub":
+ case "navigator.vendor":
+ expected = "window." + propertyPath;
+ break;
+ case "screen.orientation":
+ expected = "'portrait-primary'";
+ break;
+ case "history.scrollRestoration":
+ expected = "'auto'";
+ break;
+ }
+
+ insertExpectedResult(path, expected);
+}
+
+function collectPropertiesHelper(object, windowHasBeenGCed, path)
+{
+ if (path.length > 20)
+ throw 'Error: probably looping';
+
+ for (var property in object) {
+ // Skip internals properties, since they aren't web accessible.
+ if (property === 'internals')
+ continue;
+ path.push(property);
+ var type = typeof(object[property]);
+ if (type == "object") {
+ if (object[property] === null) {
+ emitExpectedResult(path, "null");
+ } else if (!object[property].Window
+ && !(object[property] instanceof Node)
+ && !(object[property] instanceof MimeTypeArray)
+ && !(object[property] instanceof PluginArray)) {
+ // Skip some traversing through types that will end up in cycles...
+ collectPropertiesHelper(object[property], windowHasBeenGCed, path);
+ }
+ } else if (type == "string") {
+ emitExpectedResult(path, "''");
+ } else if (type == "number") {
+ emitExpectedResult(path, "0");
+ } else if (type == "boolean") {
+ expected = "false";
+ if (path == "closed" && windowHasBeenGCed )
+ expected = "true";
+ emitExpectedResult(path, expected);
+ }
+ path.pop();
+ }
+}
</ins></span></pre></div>
<a id="branchessafari601branchLayoutTestsplatformmacwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/LayoutTests/platform/mac-wk2/TestExpectations (193736 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/LayoutTests/platform/mac-wk2/TestExpectations        2015-12-08 08:51:59 UTC (rev 193736)
+++ branches/safari-601-branch/LayoutTests/platform/mac-wk2/TestExpectations        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -340,6 +340,9 @@
</span><span class="cx">
</span><span class="cx"> [ Debug ] editing/undo/remove-css-property-and-remove-style.html [ Pass Failure ]
</span><span class="cx">
</span><ins>+# Test for WK1 only
+fast/dom/Window/property-access-on-cached-window-after-frame-removed.html [ Skip ]
+
</ins><span class="cx"> ### END OF (3) Unclassified failures
</span><span class="cx"> ########################################
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (193736 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/ChangeLog        2015-12-08 08:51:59 UTC (rev 193736)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2015-12-08 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r192604.
+
+ 2015-11-18 Jiewen Tan <jiewen_tan@apple.com>
+
+ [WK1] Crash loading Blink layout test fast/dom/Window/property-access-on-cached-window-after-frame-removed.html
+ https://bugs.webkit.org/show_bug.cgi?id=150198
+ <rdar://problem/23136026>
+
+ Reviewed by Brent Fulgham.
+
+ Test: fast/dom/Window/property-access-on-cached-window-after-frame-removed.html
+
+ Properties of a contentWindow could be accessed even if the frame who owns the window is
+ detached. Therefore, check whether the document loader is still alive before using it.
+
+ * page/PerformanceTiming.cpp:
+ (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
+
+2015-12-08 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r192433.
</span><span class="cx">
</span><span class="cx"> 2015-11-13 Jiewen Tan <jiewen_tan@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorepagePerformanceTimingcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/page/PerformanceTiming.cpp (193736 => 193737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/page/PerformanceTiming.cpp        2015-12-08 08:51:59 UTC (rev 193736)
+++ branches/safari-601-branch/Source/WebCore/page/PerformanceTiming.cpp        2015-12-08 08:53:08 UTC (rev 193737)
</span><span class="lines">@@ -340,9 +340,9 @@
</span><span class="cx"> unsigned long long PerformanceTiming::monotonicTimeToIntegerMilliseconds(double monotonicSeconds) const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(monotonicSeconds >= 0);
</span><del>- const DocumentLoadTiming* timing = documentLoadTiming();
- ASSERT(timing);
- return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonicSeconds));
</del><ins>+ if (const DocumentLoadTiming* timing = documentLoadTiming())
+ return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonicSeconds));
+ return 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>
</body>
</html>