<!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>[205096] trunk</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/205096">205096</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-08-27 22:29:05 -0700 (Sat, 27 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update generated bindings to throw a SecurityError when denying cross-origin access to properties
https://bugs.webkit.org/show_bug.cgi?id=161270

Reviewed by Darin Adler.

Source/WebCore:

Update generated bindings to throw a SecurityError when denying cross-origin
access to properties, as per the HTML specification:
- https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
- https://html.spec.whatwg.org/#crossoriginproperties-(-o-)

Firefox and Chrome already throw but Webkit was logging an error message and
returning undefined instead.

No new tests, updated existing tests.

* bindings/js/JSDOMBinding.cpp:
(WebCore::canAccessDocument):
(WebCore::BindingSecurity::shouldAllowAccessToNode):
* bindings/js/JSDOMBinding.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

LayoutTests:

Update / rebaseline existing tests to reflect behavior change.

* http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt:
* http/tests/security/cross-frame-access-call-expected.txt:
* http/tests/security/cross-frame-access-call.html:
* http/tests/security/cross-origin-window-property-access-expected.txt:
* http/tests/security/location-cross-origin-expected.txt:
* http/tests/security/location-cross-origin.html:
* http/tests/security/xss-DENIED-assign-location-href-javascript-expected.txt:
* http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt:
* http/tests/security/xss-DENIED-method-with-iframe-proto.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityaboutBlankxssDENIEDsetopenerexpectedtxt">trunk/LayoutTests/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossframeaccesscallexpectedtxt">trunk/LayoutTests/http/tests/security/cross-frame-access-call-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossframeaccesscallhtml">trunk/LayoutTests/http/tests/security/cross-frame-access-call.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritycrossoriginwindowpropertyaccessexpectedtxt">trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritylocationcrossoriginexpectedtxt">trunk/LayoutTests/http/tests/security/location-cross-origin-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecuritylocationcrossoriginhtml">trunk/LayoutTests/http/tests/security/location-cross-origin.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityxssDENIEDassignlocationhrefjavascriptexpectedtxt">trunk/LayoutTests/http/tests/security/xss-DENIED-assign-location-href-javascript-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityxssDENIEDmethodwithiframeprotoexpectedtxt">trunk/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityxssDENIEDmethodwithiframeprotohtml">trunk/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/ChangeLog        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-08-27  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Update generated bindings to throw a SecurityError when denying cross-origin access to properties
+        https://bugs.webkit.org/show_bug.cgi?id=161270
+
+        Reviewed by Darin Adler.
+
+        Update / rebaseline existing tests to reflect behavior change.
+
+        * http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt:
+        * http/tests/security/cross-frame-access-call-expected.txt:
+        * http/tests/security/cross-frame-access-call.html:
+        * http/tests/security/cross-origin-window-property-access-expected.txt:
+        * http/tests/security/location-cross-origin-expected.txt:
+        * http/tests/security/location-cross-origin.html:
+        * http/tests/security/xss-DENIED-assign-location-href-javascript-expected.txt:
+        * http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt:
+        * http/tests/security/xss-DENIED-method-with-iframe-proto.html:
+
</ins><span class="cx"> 2016-08-27  Jonathan Bedard  &lt;jbedard@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WTR needs an implementation of setAutomaticLinkDetectionEnabled
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityaboutBlankxssDENIEDsetopenerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/aboutBlank/xss-DENIED-set-opener-expected.txt        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-CONSOLE MESSAGE: line 55: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</del><ins>+CONSOLE MESSAGE: line 55: SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> CONSOLE MESSAGE: line 2: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 1: TypeError: undefined is not an object (evaluating 'target.document.body')
</span><span class="cx"> This page opens a window to &quot;&quot;, injects malicious code, and then uses window.open.call to set its opener to the victim. The opened window then tries to scripts its opener.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossframeaccesscallexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-call-expected.txt (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-frame-access-call-expected.txt        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/cross-frame-access-call-expected.txt        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,66 +1,42 @@
</span><del>-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</del><span class="cx"> CONSOLE MESSAGE: line 10: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> 
</span><ins>+Tests for calling methods of another frame using Function.call
</ins><span class="cx"> 
</span><del>------ tests for calling methods of another frame using Function.call -----
</del><ins>+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</ins><span class="cx"> 
</span><del>-PASS: window.setTimeout.call(targetWindow, 'void(0);', 0) should be 'undefined' and is.
-PASS: window.setInterval.call(targetWindow, 'void(0);', 0) should be 'undefined' and is.
-PASS: window.getSelection.call(targetWindow) should be 'undefined' and is.
-PASS: window.find.call(targetWindow, 'string', false, false, false, false, false, false) should be 'undefined' and is.
-PASS: window.confirm.call(targetWindow, 'message') should be 'undefined' and is.
-PASS: window.prompt.call(targetWindow, 'message', 'defaultValue') should be 'undefined' and is.
-PASS: window.getComputedStyle.call(targetWindow, document.body, '') should be 'undefined' and is.
-PASS: window.getMatchedCSSRules.call(targetWindow, document.body, '') should be 'undefined' and is.
-PASS: window.openDatabase.call(targetWindow, 'name', '1.0', 'description', 0) should be 'undefined' and is.
-PASS: window.atob.call(targetWindow, 'string') should be 'undefined' and is.
-PASS: window.btoa.call(targetWindow, 'string') should be 'undefined' and is.
-PASS: window.open.call(targetWindow, '') should be 'undefined' and is.
-PASS: window.addEventListener.call(targetWindow, 'load', null, false); should be 'undefined' and is.
-PASS: window.removeEventListener.call(targetWindow, 'load', null, false); should be 'undefined' and is.
-PASS: window.dispatchEvent.call(targetWindow, new Event('click')); should be 'undefined' and is.
-PASS: window.clearTimeout.call(targetWindow, 0); should be 'undefined' and is.
-PASS: window.clearInterval.call(targetWindow, 0); should be 'undefined' and is.
-PASS: window.print.call(targetWindow); should be 'undefined' and is.
-PASS: window.stop.call(targetWindow); should be 'undefined' and is.
-PASS: window.alert.call(targetWindow, 'message'); should be 'undefined' and is.
-PASS: window.scrollBy.call(targetWindow, 0, 0); should be 'undefined' and is.
-PASS: window.scrollTo.call(targetWindow, 0, 0); should be 'undefined' and is.
-PASS: window.scroll.call(targetWindow, 0, 0); should be 'undefined' and is.
-PASS: window.moveBy.call(targetWindow, 0, 0); should be 'undefined' and is.
-PASS: window.moveTo.call(targetWindow, 0, 0); should be 'undefined' and is.
-PASS: window.resizeBy.call(targetWindow, 0, 0); should be 'undefined' and is.
-PASS: window.resizeTo.call(targetWindow, 0, 0); should be 'undefined' and is.
-PASS: window.showModalDialog.call(targetWindow); should be 'undefined' and is.
</del><ins>+
+PASS window.setTimeout.call(targetWindow, 'void(0);', 0) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.setInterval.call(targetWindow, 'void(0);', 0) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.getSelection.call(targetWindow) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.find.call(targetWindow, 'string', false, false, false, false, false, false) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.confirm.call(targetWindow, 'message') threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.prompt.call(targetWindow, 'message', 'defaultValue') threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.getComputedStyle.call(targetWindow, document.body, '') threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.getMatchedCSSRules.call(targetWindow, document.body, '') threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.openDatabase.call(targetWindow, 'name', '1.0', 'description', 0) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.atob.call(targetWindow, 'string') threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.btoa.call(targetWindow, 'string') threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.open.call(targetWindow, '') threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.addEventListener.call(targetWindow, 'load', null, false); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.removeEventListener.call(targetWindow, 'load', null, false); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.dispatchEvent.call(targetWindow, new Event('click')); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.clearTimeout.call(targetWindow, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.clearInterval.call(targetWindow, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.print.call(targetWindow); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.stop.call(targetWindow); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.alert.call(targetWindow, 'message'); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.scrollBy.call(targetWindow, 0, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.scrollTo.call(targetWindow, 0, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.scroll.call(targetWindow, 0, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.moveBy.call(targetWindow, 0, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.moveTo.call(targetWindow, 0, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.resizeBy.call(targetWindow, 0, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.resizeTo.call(targetWindow, 0, 0); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS window.showModalDialog.call(targetWindow); threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
</ins><span class="cx"> PASS: window.eval.call(targetWindow, '1+2'); should be '3' and is.
</span><del>-PASS: window.location.toString.call(targetWindow.location) should be 'undefined' and is.
</del><ins>+PASS window.location.toString.call(targetWindow.location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
</ins><span class="cx"> PASS: targetWindow.history should be 'undefined' and is.
</span><ins>+PASS: successfullyParsed should be 'true' and is.
</ins><span class="cx"> 
</span><ins>+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossframeaccesscallhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-frame-access-call.html (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-frame-access-call.html        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/cross-frame-access-call.html        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><ins>+    &lt;script src=&quot;/js-test-resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx">     &lt;script src=&quot;resources/cross-frame-access.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="lines">@@ -6,18 +7,16 @@
</span><span class="cx"> &lt;iframe src=&quot;http://localhost:8000/security/resources/cross-frame-iframe-for-get-test.html&quot; style=&quot;&quot;&gt;&lt;/iframe&gt;
</span><span class="cx"> &lt;pre id=&quot;console&quot;&gt;&lt;/pre&gt;
</span><span class="cx"> &lt;script&gt;
</span><ins>+description(&quot;Tests for calling methods of another frame using Function.call&quot;);
+jsTestIsAsync = true;
</ins><span class="cx"> 
</span><span class="cx"> window.targetWindow = frames[0];
</span><span class="cx"> 
</span><span class="cx"> window.onload = function()
</span><span class="cx"> {
</span><del>-    if (window.testRunner) {
</del><ins>+    if (window.testRunner)
</ins><span class="cx">         testRunner.setCanOpenWindows(true);
</span><del>-        testRunner.dumpAsText();
-    }
</del><span class="cx"> 
</span><del>-    log(&quot;\n----- tests for calling methods of another frame using Function.call -----\n&quot;);
-
</del><span class="cx">     // Allowed
</span><span class="cx">     // void focus();
</span><span class="cx">     // void blur();
</span><span class="lines">@@ -26,36 +25,36 @@
</span><span class="cx"> 
</span><span class="cx">     // - Tests for the Window object - 
</span><span class="cx">     // undefined value indicates failure
</span><del>-    shouldBe(&quot;window.setTimeout.call(targetWindow, 'void(0);', 0)&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.setInterval.call(targetWindow, 'void(0);', 0)&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.getSelection.call(targetWindow)&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.find.call(targetWindow, 'string', false, false, false, false, false, false)&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.confirm.call(targetWindow, 'message')&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.prompt.call(targetWindow, 'message', 'defaultValue')&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.getComputedStyle.call(targetWindow, document.body, '')&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.getMatchedCSSRules.call(targetWindow, document.body, '')&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.openDatabase.call(targetWindow, 'name', '1.0', 'description', 0)&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.atob.call(targetWindow, 'string')&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.btoa.call(targetWindow, 'string')&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.open.call(targetWindow, '')&quot;, &quot;undefined&quot;);
</del><ins>+    shouldThrowErrorName(&quot;window.setTimeout.call(targetWindow, 'void(0);', 0)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.setInterval.call(targetWindow, 'void(0);', 0)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.getSelection.call(targetWindow)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.find.call(targetWindow, 'string', false, false, false, false, false, false)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.confirm.call(targetWindow, 'message')&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.prompt.call(targetWindow, 'message', 'defaultValue')&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.getComputedStyle.call(targetWindow, document.body, '')&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.getMatchedCSSRules.call(targetWindow, document.body, '')&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.openDatabase.call(targetWindow, 'name', '1.0', 'description', 0)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.atob.call(targetWindow, 'string')&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.btoa.call(targetWindow, 'string')&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.open.call(targetWindow, '')&quot;, &quot;SecurityError&quot;);
</ins><span class="cx"> 
</span><span class="cx">     // These always return undefined so we use the error console to detect failure
</span><del>-    shouldBe(&quot;window.addEventListener.call(targetWindow, 'load', null, false);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.removeEventListener.call(targetWindow, 'load', null, false);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.dispatchEvent.call(targetWindow, new Event('click'));&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.clearTimeout.call(targetWindow, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.clearInterval.call(targetWindow, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.print.call(targetWindow);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.stop.call(targetWindow);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.alert.call(targetWindow, 'message');&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.scrollBy.call(targetWindow, 0, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.scrollTo.call(targetWindow, 0, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.scroll.call(targetWindow, 0, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.moveBy.call(targetWindow, 0, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.moveTo.call(targetWindow, 0, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.resizeBy.call(targetWindow, 0, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.resizeTo.call(targetWindow, 0, 0);&quot;, &quot;undefined&quot;);
-    shouldBe(&quot;window.showModalDialog.call(targetWindow);&quot;, &quot;undefined&quot;);
</del><ins>+    shouldThrowErrorName(&quot;window.addEventListener.call(targetWindow, 'load', null, false);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.removeEventListener.call(targetWindow, 'load', null, false);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.dispatchEvent.call(targetWindow, new Event('click'));&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.clearTimeout.call(targetWindow, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.clearInterval.call(targetWindow, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.print.call(targetWindow);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.stop.call(targetWindow);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.alert.call(targetWindow, 'message');&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.scrollBy.call(targetWindow, 0, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.scrollTo.call(targetWindow, 0, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.scroll.call(targetWindow, 0, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.moveBy.call(targetWindow, 0, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.moveTo.call(targetWindow, 0, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.resizeBy.call(targetWindow, 0, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.resizeTo.call(targetWindow, 0, 0);&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;window.showModalDialog.call(targetWindow);&quot;, &quot;SecurityError&quot;);
</ins><span class="cx"> 
</span><span class="cx">     // Throws an EvalError and logs to the error console
</span><span class="cx">     shouldBe(&quot;window.eval.call(targetWindow, '1+2');&quot;, '3');
</span><span class="lines">@@ -62,7 +61,7 @@
</span><span class="cx"> 
</span><span class="cx">     // - Tests for the Location object -
</span><span class="cx">     // undefined value indicates failure
</span><del>-    shouldBe(&quot;window.location.toString.call(targetWindow.location)&quot;, &quot;undefined&quot;);
</del><ins>+    shouldThrowErrorName(&quot;window.location.toString.call(targetWindow.location)&quot;, &quot;SecurityError&quot;);
</ins><span class="cx"> 
</span><span class="cx">     // - Tests for the History object -
</span><span class="cx">     shouldBeUndefined(&quot;targetWindow.history&quot;);
</span><span class="lines">@@ -69,7 +68,10 @@
</span><span class="cx"> 
</span><span class="cx">     // Work around DRT bug that causes subsequent tests to fail.
</span><span class="cx">     window.stop();
</span><ins>+
+    finishJSTest();
</ins><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span><ins>+&lt;script src=&quot;/js-test-resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritycrossoriginwindowpropertyaccessexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/cross-origin-window-property-access-expected.txt        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,9 +1,3 @@
</span><del>-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</del><span class="cx"> CONSOLE MESSAGE: line 15: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> CONSOLE MESSAGE: line 15: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><span class="cx"> Tests that using another window's property getter does not bypass cross-origin checks.
</span><span class="lines">@@ -11,12 +5,12 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS Object.getOwnPropertyDescriptor(window, &quot;document&quot;).get.call(crossOriginWindow) returned undefined.
-PASS Object.getOwnPropertyDescriptor(window, &quot;name&quot;).get.call(crossOriginWindow) returned undefined.
-PASS Object.getOwnPropertyDescriptor(window, &quot;menubar&quot;).get.call(crossOriginWindow) returned undefined.
-PASS Object.getOwnPropertyDescriptor(window, &quot;scrollbars&quot;).get.call(crossOriginWindow) returned undefined.
-PASS Object.getOwnPropertyDescriptor(window, &quot;navigator&quot;).get.call(crossOriginWindow) returned undefined.
-PASS Object.getOwnPropertyDescriptor(window, &quot;screenX&quot;).get.call(crossOriginWindow) returned undefined.
</del><ins>+PASS Object.getOwnPropertyDescriptor(window, &quot;document&quot;).get.call(crossOriginWindow) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window, &quot;name&quot;).get.call(crossOriginWindow) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window, &quot;menubar&quot;).get.call(crossOriginWindow) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window, &quot;scrollbars&quot;).get.call(crossOriginWindow) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window, &quot;navigator&quot;).get.call(crossOriginWindow) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window, &quot;screenX&quot;).get.call(crossOriginWindow) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
</ins><span class="cx"> PASS Object.getOwnPropertyDescriptor(window.__proto__, &quot;constructor&quot;).get.call(crossOriginWindow) threw exception TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(window.__proto__, &quot;constructor&quot;).get.call').
</span><span class="cx"> PASS Object.getOwnPropertyDescriptor(window.__proto__, &quot;constructor&quot;).get.call(crossOriginWindow.__proto__) threw exception TypeError: undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(window.__proto__, &quot;constructor&quot;).get.call').
</span><span class="cx"> PASS crossOriginWindow.constructor returned undefined.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritylocationcrossoriginexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/location-cross-origin-expected.txt (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/location-cross-origin-expected.txt        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/location-cross-origin-expected.txt        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,14 +1,3 @@
</span><del>-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 1: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</del><span class="cx"> Test security checking for access to Location.
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="lines">@@ -27,17 +16,17 @@
</span><span class="cx"> PASS frames[0].location.reload() threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
</span><span class="cx"> PASS frames[0].location.assign('about:blank') threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
</span><span class="cx"> PASS frames[0].location.href threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
</span><del>-PASS Object.getOwnPropertyDescriptor(window.location, 'protocol').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'host').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'hostname').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'port').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'pathname').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'search').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'hash').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'origin').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'ancestorOrigins').get.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'toString').value.call(frames[0].location) is undefined.
-PASS Object.getOwnPropertyDescriptor(window.location, 'href').get.call(frames[0].location) is undefined.
</del><ins>+PASS Object.getOwnPropertyDescriptor(window.location, 'protocol').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'host').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'hostname').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'port').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'pathname').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'search').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'hash').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'origin').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'ancestorOrigins').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'toString').value.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
+PASS Object.getOwnPropertyDescriptor(window.location, 'href').get.call(frames[0].location) threw exception SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match..
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecuritylocationcrossoriginhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/location-cross-origin.html (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/location-cross-origin.html        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/location-cross-origin.html        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -22,18 +22,17 @@
</span><span class="cx">     shouldThrowErrorName(&quot;frames[0].location.assign('about:blank')&quot;, &quot;SecurityError&quot;);
</span><span class="cx">     shouldThrowErrorName(&quot;frames[0].location.href&quot;, &quot;SecurityError&quot;);
</span><span class="cx"> 
</span><del>-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'protocol').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'host').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'hostname').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'port').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'pathname').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'search').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'hash').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'origin').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'ancestorOrigins').get.call(frames[0].location)&quot;);
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'toString').value.call(frames[0].location)&quot;);
-    // The specification seems to allow access to href but Firefox does not.
-    shouldBeUndefined(&quot;Object.getOwnPropertyDescriptor(window.location, 'href').get.call(frames[0].location)&quot;);
</del><ins>+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'protocol').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'host').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'hostname').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'port').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'pathname').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'search').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'hash').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'origin').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'ancestorOrigins').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'toString').value.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
+    shouldThrowErrorName(&quot;Object.getOwnPropertyDescriptor(window.location, 'href').get.call(frames[0].location)&quot;, &quot;SecurityError&quot;);
</ins><span class="cx"> 
</span><span class="cx">     finishJSTest();
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityxssDENIEDassignlocationhrefjavascriptexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/xss-DENIED-assign-location-href-javascript-expected.txt (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/xss-DENIED-assign-location-href-javascript-expected.txt        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/xss-DENIED-assign-location-href-javascript-expected.txt        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> CONSOLE MESSAGE: line 13: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><del>-CONSOLE MESSAGE: line 13: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</del><ins>+CONSOLE MESSAGE: line 9: SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> --------
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityxssDENIEDmethodwithiframeprotoexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> CONSOLE MESSAGE: line 37: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</span><del>-CONSOLE MESSAGE: line 42: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
-CONSOLE MESSAGE: line 47: Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</del><ins>+CONSOLE MESSAGE: line 40: TypeError: targetWindow.setTimeout is not a function. (In 'targetWindow.setTimeout(callback, 0, this)', 'targetWindow.setTimeout' is undefined)
+CONSOLE MESSAGE: line 47: SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
+CONSOLE MESSAGE: line 54: SecurityError (DOM Exception 18): Blocked a frame with origin &quot;http://127.0.0.1:8000&quot; from accessing a frame with origin &quot;http://localhost:8000&quot;. Protocols, domains, and ports must match.
</ins><span class="cx"> 
</span><span class="cx"> Tests that making other frame window a prototype doesn't expose that window methods
</span><del>-PASS: this.wasInvoked should be 'false' and is.
</del><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityxssDENIEDmethodwithiframeprotohtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto.html (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto.html        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/LayoutTests/http/tests/security/xss-DENIED-method-with-iframe-proto.html        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -36,17 +36,23 @@
</span><span class="cx">   try {
</span><span class="cx">     targetWindow.setTimeout(callback, 0, this);
</span><span class="cx">     needsCheck = true;
</span><del>-  } catch (e) { }
</del><ins>+  } catch (e) {
+    console.log(e);
+  }
</ins><span class="cx"> 
</span><span class="cx">   try {
</span><span class="cx">     setTimeout.call(targetWindow, callback, 0, this);
</span><span class="cx">     needsCheck = true;
</span><del>-  } catch(e) { }
</del><ins>+  } catch(e) {
+    console.log(e);
+  }
</ins><span class="cx"> 
</span><span class="cx">   try {
</span><span class="cx">     originalSetTimeout.call(targetWindow, callback, 0, this);
</span><span class="cx">     needsCheck = true;
</span><del>-  } catch(e) { }
</del><ins>+  } catch(e) {
+    console.log(e);
+  }
</ins><span class="cx"> 
</span><span class="cx">   if (needsCheck) {
</span><span class="cx">     originalSetTimeout(check, 10);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/Source/WebCore/ChangeLog        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2016-08-27  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Update generated bindings to throw a SecurityError when denying cross-origin access to properties
+        https://bugs.webkit.org/show_bug.cgi?id=161270
+
+        Reviewed by Darin Adler.
+
+        Update generated bindings to throw a SecurityError when denying cross-origin
+        access to properties, as per the HTML specification:
+        - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
+        - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
+
+        Firefox and Chrome already throw but Webkit was logging an error message and
+        returning undefined instead.
+
+        No new tests, updated existing tests.
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::canAccessDocument):
+        (WebCore::BindingSecurity::shouldAllowAccessToNode):
+        * bindings/js/JSDOMBinding.h:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+
+2016-08-27  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Follow-up fixes after r205030.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=161216
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -760,7 +760,7 @@
</span><span class="cx">     return asJSDOMWindow(exec-&gt;vmEntryGlobalObject())-&gt;wrapped();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool canAccessDocument(JSC::ExecState* state, Document* targetDocument, SecurityReportingOption reportingOption = ReportSecurityError)
</del><ins>+static inline bool canAccessDocument(JSC::ExecState* state, Document* targetDocument, SecurityReportingOption reportingOption)
</ins><span class="cx"> {
</span><span class="cx">     if (!targetDocument)
</span><span class="cx">         return false;
</span><span class="lines">@@ -770,8 +770,16 @@
</span><span class="cx">     if (active.document()-&gt;securityOrigin()-&gt;canAccess(targetDocument-&gt;securityOrigin()))
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><del>-    if (reportingOption == ReportSecurityError)
</del><ins>+    switch (reportingOption) {
+    case ThrowSecurityError:
+        throwSecurityError(*state, targetDocument-&gt;domWindow()-&gt;crossDomainAccessErrorMessage(active));
+        break;
+    case LogSecurityError:
</ins><span class="cx">         printErrorMessageForFrame(targetDocument-&gt;frame(), targetDocument-&gt;domWindow()-&gt;crossDomainAccessErrorMessage(active));
</span><ins>+        break;
+    case DoNotReportSecurityError:
+        break;
+    }
</ins><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="lines">@@ -788,7 +796,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool BindingSecurity::shouldAllowAccessToNode(JSC::ExecState* state, Node* target)
</span><span class="cx"> {
</span><del>-    return target &amp;&amp; canAccessDocument(state, &amp;target-&gt;document());
</del><ins>+    return target &amp;&amp; canAccessDocument(state, &amp;target-&gt;document(), LogSecurityError);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> static EncodedJSValue throwTypeError(JSC::ExecState&amp; state, const String&amp; errorMessage)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -297,13 +297,17 @@
</span><span class="cx"> bool shouldAllowAccessToFrame(JSC::ExecState*, Frame*, String&amp; message);
</span><span class="cx"> bool shouldAllowAccessToDOMWindow(JSC::ExecState*, DOMWindow&amp;, String&amp; message);
</span><span class="cx"> 
</span><del>-enum SecurityReportingOption { DoNotReportSecurityError, ReportSecurityError };
</del><ins>+enum SecurityReportingOption {
+    DoNotReportSecurityError,
+    LogSecurityError, // Legacy behavior.
+    ThrowSecurityError
+};
</ins><span class="cx"> 
</span><span class="cx"> class BindingSecurity {
</span><span class="cx"> public:
</span><span class="cx">     static bool shouldAllowAccessToNode(JSC::ExecState*, Node*);
</span><del>-    static bool shouldAllowAccessToDOMWindow(JSC::ExecState*, DOMWindow&amp;, SecurityReportingOption = ReportSecurityError);
-    static bool shouldAllowAccessToFrame(JSC::ExecState*, Frame*, SecurityReportingOption = ReportSecurityError);
</del><ins>+    static bool shouldAllowAccessToDOMWindow(JSC::ExecState*, DOMWindow&amp;, SecurityReportingOption = LogSecurityError);
+    static bool shouldAllowAccessToFrame(JSC::ExecState*, Frame*, SecurityReportingOption = LogSecurityError);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> void printErrorMessageForFrame(Frame*, const String&amp; message);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -2863,9 +2863,9 @@
</span><span class="cx">                 !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DoNotCheckSecurity&quot;} &amp;&amp;
</span><span class="cx">                 !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DoNotCheckSecurityOnGetter&quot;}) {
</span><span class="cx">                 if ($interfaceName eq &quot;DOMWindow&quot;) {
</span><del>-                    push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis-&gt;wrapped()))\n&quot;);
</del><ins>+                    push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis-&gt;wrapped(), ThrowSecurityError))\n&quot;);
</ins><span class="cx">                 } else {
</span><del>-                    push(@implContent, &quot;    if (!shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame()))\n&quot;);
</del><ins>+                    push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame(), ThrowSecurityError))\n&quot;);
</ins><span class="cx">                 }
</span><span class="cx">                 push(@implContent, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             }
</span><span class="lines">@@ -3127,9 +3127,9 @@
</span><span class="cx">             }
</span><span class="cx">             if ($interface-&gt;extendedAttributes-&gt;{&quot;CheckSecurity&quot;} &amp;&amp; !$attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DoNotCheckSecurity&quot;}) {
</span><span class="cx">                 if ($interfaceName eq &quot;DOMWindow&quot;) {
</span><del>-                    push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis-&gt;wrapped()))\n&quot;);
</del><ins>+                    push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis-&gt;wrapped(), ThrowSecurityError))\n&quot;);
</ins><span class="cx">                 } else {
</span><del>-                    push(@implContent, &quot;    if (!shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame()))\n&quot;);
</del><ins>+                    push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame(), ThrowSecurityError))\n&quot;);
</ins><span class="cx">                 }
</span><span class="cx">                 push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">             }
</span><span class="lines">@@ -3425,9 +3425,9 @@
</span><span class="cx"> 
</span><span class="cx">                 if ($interface-&gt;extendedAttributes-&gt;{&quot;CheckSecurity&quot;} and !$function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;DoNotCheckSecurity&quot;}) {
</span><span class="cx">                     if ($interfaceName eq &quot;DOMWindow&quot;) {
</span><del>-                        push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis-&gt;wrapped()))\n&quot;);
</del><ins>+                        push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis-&gt;wrapped(), ThrowSecurityError))\n&quot;);
</ins><span class="cx">                     } else {
</span><del>-                        push(@implContent, &quot;    if (!shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame()))\n&quot;);
</del><ins>+                        push(@implContent, &quot;    if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame(), ThrowSecurityError))\n&quot;);
</ins><span class="cx">                     }
</span><span class="cx">                     push(@implContent, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">                 }
</span><span class="lines">@@ -3449,7 +3449,7 @@
</span><span class="cx">                     if ($interface-&gt;name eq &quot;EventTarget&quot;) {
</span><span class="cx">                         $implIncludes{&quot;DOMWindow.h&quot;} = 1;
</span><span class="cx">                         push(@implContent, &quot;    if (auto* window = castedThis-&gt;wrapped().toDOMWindow()) {\n&quot;);
</span><del>-                        push(@implContent, &quot;        if (!window-&gt;frame() || !BindingSecurity::shouldAllowAccessToDOMWindow(state, *window))\n&quot;);
</del><ins>+                        push(@implContent, &quot;        if (!window-&gt;frame() || !BindingSecurity::shouldAllowAccessToDOMWindow(state, *window, ThrowSecurityError))\n&quot;);
</ins><span class="cx">                         push(@implContent, &quot;            return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">                         push(@implContent, &quot;    }\n&quot;);
</span><span class="cx">                     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (205095 => 205096)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-08-28 05:24:39 UTC (rev 205095)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-08-28 05:29:05 UTC (rev 205096)
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="cx">         return throwGetterTypeError(*state, &quot;TestActiveDOMObject&quot;, &quot;excitingAttr&quot;);
</span><span class="cx">     }
</span><del>-    if (!shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame()))
</del><ins>+    if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame(), ThrowSecurityError))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     JSValue result = jsNumber(impl.excitingAttr());
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx">     if (UNLIKELY(!castedThis))
</span><span class="cx">         return throwThisTypeError(*state, &quot;TestActiveDOMObject&quot;, &quot;excitingFunction&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestActiveDOMObject::info());
</span><del>-    if (!shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame()))
</del><ins>+    if (!BindingSecurity::shouldAllowAccessToFrame(state, castedThis-&gt;wrapped().frame(), ThrowSecurityError))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span></span></pre>
</div>
</div>

</body>
</html>