<!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>[214147] 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/214147">214147</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-03-19 14:51:19 -0700 (Sun, 19 Mar 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Implement self.origin
https://bugs.webkit.org/show_bug.cgi?id=168023
Reviewed by Sam Weinig.
LayoutTests/imported/w3c:
* resources/import-expectations.json:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/self-origin.any-expected.txt:
* web-platform-tests/html/dom/self-origin.sub-expected.txt:
Rebaseline several WPT tests now that more checks are passing.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt: Added.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html: Added.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginSharedWorker.js: Added.
(onconnect):
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginWorker.js: Added.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/w3c-import.log: Added.
* web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/w3c-import.log: Added.
Import test coverage for self.origin in workers.
Source/WebCore:
Implement self.origin:
- https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
Firefox and Chrome already support this.
Test: imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::origin):
* page/DOMWindow.h:
* page/WindowOrWorkerGlobalScope.idl:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::origin):
* workers/WorkerGlobalScope.h:
LayoutTests:
* http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-maxlength.html:
* http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-no-cr.html:
* http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status.html:
* http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null.html:
Rename origin to wsOrigin in tests to avoid conflict with window.origin.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybihandshakefailbymaxlengthexpectedtxt">trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybihandshakefailbymaxlengthhtml">trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-maxlength.html</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybihandshakefailbynocrexpectedtxt">trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybihandshakefailbynocrhtml">trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr.html</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybihandshakefailbynullcharinstatusexpectedtxt">trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybihandshakefailbynullcharinstatushtml">trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status.html</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybihandshakefailbyprependednullexpectedtxt">trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestswebsockettestshybihandshakefailbyprependednullhtml">trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cresourcesimportexpectationsjson">trunk/LayoutTests/imported/w3c/resources/import-expectations.json</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldomselforiginanyexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.any-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldomselforiginsubexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.sub-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowh">trunk/Source/WebCore/page/DOMWindow.h</a></li>
<li><a href="#trunkSourceWebCorepageWindowOrWorkerGlobalScopeidl">trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopecpp">trunk/Source/WebCore/workers/WorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeh">trunk/Source/WebCore/workers/WorkerGlobalScope.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinWorker_Self_Originexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinWorker_Self_Originhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html</a></li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinsupportWorkerSelfOriginSharedWorkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginSharedWorker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinsupportWorkerSelfOriginWorkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginWorker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinsupportw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/w3c-import.log</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinw3cimportlog">trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/w3c-import.log</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/ChangeLog        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2017-03-19 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><ins>+ Implement self.origin
+ https://bugs.webkit.org/show_bug.cgi?id=168023
+
+ Reviewed by Sam Weinig.
+
+ * http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt:
+ * http/tests/websocket/tests/hybi/handshake-fail-by-maxlength.html:
+ * http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt:
+ * http/tests/websocket/tests/hybi/handshake-fail-by-no-cr.html:
+ * http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status-expected.txt:
+ * http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status.html:
+ * http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt:
+ * http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null.html:
+ Rename origin to wsOrigin in tests to avoid conflict with window.origin.
+
+2017-03-19 Chris Dumez <cdumez@apple.com>
+
</ins><span class="cx"> `const location = "foo"` throws in a worker
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=169839
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybihandshakefailbymaxlengthexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">
</span><span class="cx"> PASS timedOut is false
</span><span class="cx"> PASS connected is false
</span><del>-PASS origin is undefined.
</del><ins>+PASS wsOrigin is undefined.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybihandshakefailbymaxlengthhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-maxlength.html (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-maxlength.html        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-maxlength.html        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -13,12 +13,12 @@
</span><span class="cx">
</span><span class="cx"> var timedOut = false;
</span><span class="cx"> var connected = false;
</span><del>-var origin;
</del><ins>+let wsOrigin;
</ins><span class="cx">
</span><span class="cx"> function endTest() {
</span><span class="cx"> shouldBeFalse('timedOut');
</span><span class="cx"> shouldBeFalse('connected');
</span><del>- shouldBeUndefined('origin');
</del><ins>+ shouldBeUndefined('wsOrigin');
</ins><span class="cx"> clearTimeout(timeoutID);
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx">
</span><span class="cx"> ws.onmessage = function(messageEvent)
</span><span class="cx"> {
</span><del>- origin = messageEvent.data;
- debug('origin = ' + origin);
</del><ins>+ wsOrigin = messageEvent.data;
+ debug('wsOrigin = ' + wsOrigin);
</ins><span class="cx"> ws.close();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybihandshakefailbynocrexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
</span><span class="cx">
</span><span class="cx"> PASS connected is false
</span><del>-PASS origin is undefined.
</del><ins>+PASS wsOrigin is undefined.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybihandshakefailbynocrhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr.html (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr.html        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-no-cr.html        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -12,11 +12,11 @@
</span><span class="cx"> window.jsTestIsAsync = true;
</span><span class="cx">
</span><span class="cx"> var connected = false;
</span><del>-var origin;
</del><ins>+let wsOrigin;
</ins><span class="cx">
</span><span class="cx"> function endTest() {
</span><span class="cx"> shouldBeFalse('connected');
</span><del>- shouldBeUndefined('origin');
</del><ins>+ shouldBeUndefined('wsOrigin');
</ins><span class="cx"> clearTimeout(timeoutID);
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span><span class="lines">@@ -32,8 +32,8 @@
</span><span class="cx">
</span><span class="cx"> ws.onmessage = function(messageEvent)
</span><span class="cx"> {
</span><del>- origin = messageEvent.data;
- debug('origin = ' + origin);
</del><ins>+ wsOrigin = messageEvent.data;
+ debug('wsOrigin = ' + wsOrigin);
</ins><span class="cx"> ws.close();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybihandshakefailbynullcharinstatusexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status-expected.txt (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status-expected.txt        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status-expected.txt        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">
</span><span class="cx"> PASS timedOut is false
</span><span class="cx"> PASS connected is false
</span><del>-PASS origin is undefined.
</del><ins>+PASS wsOrigin is undefined.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybihandshakefailbynullcharinstatushtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status.html (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status.html        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-char-in-status.html        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -13,12 +13,12 @@
</span><span class="cx">
</span><span class="cx"> var timedOut = false;
</span><span class="cx"> var connected = false;
</span><del>-var origin;
</del><ins>+let wsOrigin;
</ins><span class="cx">
</span><span class="cx"> function endTest() {
</span><span class="cx"> shouldBeFalse('timedOut');
</span><span class="cx"> shouldBeFalse('connected');
</span><del>- shouldBeUndefined('origin');
</del><ins>+ shouldBeUndefined('wsOrigin');
</ins><span class="cx"> clearTimeout(timeoutID);
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx">
</span><span class="cx"> ws.onmessage = function(messageEvent)
</span><span class="cx"> {
</span><del>- origin = messageEvent.data;
- debug('origin = ' + origin);
</del><ins>+ wsOrigin = messageEvent.data;
+ debug('wsOrigin = ' + wsOrigin);
</ins><span class="cx"> ws.close();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybihandshakefailbyprependednullexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">
</span><span class="cx"> PASS timedOut is false
</span><span class="cx"> PASS connected is false
</span><del>-PASS origin is undefined.
</del><ins>+PASS wsOrigin is undefined.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestshttptestswebsockettestshybihandshakefailbyprependednullhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null.html (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null.html        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null.html        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -13,12 +13,12 @@
</span><span class="cx">
</span><span class="cx"> var timedOut = false;
</span><span class="cx"> var connected = false;
</span><del>-var origin;
</del><ins>+let wsOrigin;
</ins><span class="cx">
</span><span class="cx"> function endTest() {
</span><span class="cx"> shouldBeFalse('timedOut');
</span><span class="cx"> shouldBeFalse('connected');
</span><del>- shouldBeUndefined('origin');
</del><ins>+ shouldBeUndefined('wsOrigin');
</ins><span class="cx"> clearTimeout(timeoutID);
</span><span class="cx"> finishJSTest();
</span><span class="cx"> }
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx">
</span><span class="cx"> ws.onmessage = function(messageEvent)
</span><span class="cx"> {
</span><del>- origin = messageEvent.data;
- debug('origin = ' + origin);
</del><ins>+ wsOrigin = messageEvent.data;
+ debug('wsOrigin = ' + wsOrigin);
</ins><span class="cx"> ws.close();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2017-03-19 Chris Dumez <cdumez@apple.com>
+
+ Implement self.origin
+ https://bugs.webkit.org/show_bug.cgi?id=168023
+
+ Reviewed by Sam Weinig.
+
+ * resources/import-expectations.json:
+ * web-platform-tests/html/dom/interfaces-expected.txt:
+ * web-platform-tests/html/dom/self-origin.any-expected.txt:
+ * web-platform-tests/html/dom/self-origin.sub-expected.txt:
+ Rebaseline several WPT tests now that more checks are passing.
+
+ * web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt: Added.
+ * web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html: Added.
+ * web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginSharedWorker.js: Added.
+ (onconnect):
+ * web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginWorker.js: Added.
+ * web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/w3c-import.log: Added.
+ * web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/w3c-import.log: Added.
+ Import test coverage for self.origin in workers.
+
</ins><span class="cx"> 2017-03-18 Jon Lee <jonlee@apple.com>
</span><span class="cx">
</span><span class="cx"> Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cresourcesimportexpectationsjson"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/resources/import-expectations.json (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/resources/import-expectations.json        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/imported/w3c/resources/import-expectations.json        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> "csswg-test/css-grid-1": "import",
</span><span class="cx"> "csswg-test/css-images-3": "skip",
</span><span class="cx"> "csswg-test/css-lists-3": "skip",
</span><del>- "csswg-test/css-logical-properties-1" : "skip",
</del><ins>+ "csswg-test/css-logical-properties-1": "skip",
</ins><span class="cx"> "csswg-test/css-masking-1": "skip",
</span><span class="cx"> "csswg-test/css-multicol-1": "skip",
</span><span class="cx"> "csswg-test/css-namespaces-1": "skip",
</span><span class="lines">@@ -228,8 +228,8 @@
</span><span class="cx"> "web-platform-tests/html/semantics/embedded-content/media-elements/video_loop_base.html": "skip",
</span><span class="cx"> "web-platform-tests/html/semantics/embedded-content/the-area-element/area_nohref.xhtml": "skip",
</span><span class="cx"> "web-platform-tests/html/semantics/embedded-content/the-area-element/test-area.xhtml": "skip",
</span><ins>+ "web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html": "skip",
</ins><span class="cx"> "web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html": "skip",
</span><del>- "web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html": "skip",
</del><span class="cx"> "web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html": "skip",
</span><span class="cx"> "web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-image-data": "skip",
</span><span class="cx"> "web-platform-tests/html/semantics/embedded-content/the-object-element/object-events.html": "skip",
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx"> "web-platform-tests/html/webappapis/scripting/event-loops/microtask_after_raf.html": "skip",
</span><span class="cx"> "web-platform-tests/html/webappapis/scripting/events/event-handler-processing-algorithm-error": "skip",
</span><span class="cx"> "web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections": "skip",
</span><del>- "web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin": "skip",
</del><ins>+ "web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin": "import",
</ins><span class="cx"> "web-platform-tests/http": "skip",
</span><span class="cx"> "web-platform-tests/imagebitmap-renderingcontext": "skip",
</span><span class="cx"> "web-platform-tests/infrastructure": "skip",
</span><span class="lines">@@ -320,4 +320,4 @@
</span><span class="cx"> "web-platform-tests/webvr": "skip",
</span><span class="cx"> "web-platform-tests/webvtt": "skip",
</span><span class="cx"> "web-platform-tests/workers": "skip"
</span><del>-}
</del><ins>+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -5025,7 +5025,7 @@
</span><span class="cx"> PASS Window interface: attribute onpopstate
</span><span class="cx"> PASS Window interface: attribute onstorage
</span><span class="cx"> PASS Window interface: attribute onunload
</span><del>-FAIL Window interface: attribute origin assert_own_property: The global object must have a property "origin" expected property "origin" missing
</del><ins>+PASS Window interface: attribute origin
</ins><span class="cx"> PASS Window interface: operation btoa(DOMString)
</span><span class="cx"> PASS Window interface: operation atob(DOMString)
</span><span class="cx"> PASS Window interface: operation setTimeout(TimerHandler,long,any)
</span><span class="lines">@@ -5153,7 +5153,7 @@
</span><span class="cx"> PASS Window interface: window must inherit property "onpopstate" with the proper type (109)
</span><span class="cx"> PASS Window interface: window must inherit property "onstorage" with the proper type (110)
</span><span class="cx"> PASS Window interface: window must inherit property "onunload" with the proper type (111)
</span><del>-FAIL Window interface: window must inherit property "origin" with the proper type (112) assert_own_property: expected property "origin" missing
</del><ins>+PASS Window interface: window must inherit property "origin" with the proper type (112)
</ins><span class="cx"> PASS Window interface: window must inherit property "btoa" with the proper type (113)
</span><span class="cx"> PASS Window interface: calling btoa(DOMString) on window with too few arguments must throw TypeError
</span><span class="cx"> PASS Window interface: window must inherit property "atob" with the proper type (114)
</span><span class="lines">@@ -5190,7 +5190,7 @@
</span><span class="cx"> PASS History interface: existence and properties of interface prototype object
</span><span class="cx"> PASS History interface: existence and properties of interface prototype object's "constructor" property
</span><span class="cx"> PASS History interface: attribute length
</span><del>-FAIL History interface: attribute scrollRestoration assert_true: The prototype object must have a property "scrollRestoration" expected true got false
</del><ins>+PASS History interface: attribute scrollRestoration
</ins><span class="cx"> PASS History interface: attribute state
</span><span class="cx"> PASS History interface: operation go(long)
</span><span class="cx"> PASS History interface: operation back()
</span><span class="lines">@@ -5200,7 +5200,7 @@
</span><span class="cx"> PASS History must be primary interface of window.history
</span><span class="cx"> PASS Stringification of window.history
</span><span class="cx"> PASS History interface: window.history must inherit property "length" with the proper type (0)
</span><del>-FAIL History interface: window.history must inherit property "scrollRestoration" with the proper type (1) assert_inherits: property "scrollRestoration" not found in prototype chain
</del><ins>+PASS History interface: window.history must inherit property "scrollRestoration" with the proper type (1)
</ins><span class="cx"> PASS History interface: window.history must inherit property "state" with the proper type (2)
</span><span class="cx"> PASS History interface: window.history must inherit property "go" with the proper type (3)
</span><span class="cx"> PASS History interface: calling go(long) on window.history with too few arguments must throw TypeError
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldomselforiginanyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.any-expected.txt (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.any-expected.txt        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.any-expected.txt        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -1,3 +1,3 @@
</span><span class="cx">
</span><del>-FAIL self.origin should be correct assert_equals: expected (string) "http://localhost:8800" but got (undefined) undefined
</del><ins>+PASS self.origin should be correct
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldomselforiginsubexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.sub-expected.txt (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.sub-expected.txt        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/self-origin.sub-expected.txt        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -9,9 +9,9 @@
</span><span class="cx"> NOTRUN Should have the right origin for IDN subframe
</span><span class="cx"> NOTRUN Should have the right origin for IDN subframe after setting document.domain
</span><span class="cx"> NOTRUN Should have the right origin for sandboxed iframe
</span><del>-FAIL We should have the right origin for our page assert_equals: expected (string) "http://localhost:8800" but got (undefined) undefined
-FAIL about:blank subframe origins assert_equals: Should have the right origin for about:blank iframe expected (string) "http://localhost:8800" but got (undefined) undefined
</del><ins>+PASS We should have the right origin for our page
+PASS about:blank subframe origins
</ins><span class="cx"> FAIL blob: subframe origins assert_equals: Should have the right location origin for blob: iframe expected "http://localhost:8800" but got "null"
</span><del>-FAIL javascript: subframe origins assert_equals: Should have the right origin for javascript: iframe expected (string) "http://localhost:8800" but got (undefined) undefined
-FAIL srcdoc subframe origins assert_equals: Should have the right origin for srcdoc iframe expected (string) "http://localhost:8800" but got (undefined) undefined
</del><ins>+PASS javascript: subframe origins
+PASS srcdoc subframe origins
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinWorker_Self_Originexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt (0 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+PASS Same Origin Worker
+FAIL Same Origin SharedWorker Can't find variable: SharedWorker
+FAIL Data Url Worker The operation is insecure.
+FAIL Data Url SharedWorker Can't find variable: SharedWorker
+PASS Blob Url Worker
+FAIL Blob Url SharedWorker Can't find variable: SharedWorker
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinWorker_Self_Originhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html (0 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Test workers self.origin</title>
+<script src="../../../../../../resources/testharness.js"></script>
+<script src="../../../../../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+function assertOriginWorker(workerSource, expectedOrigin, testName) {
+ async_test(function(t) {
+ w = new Worker(workerSource);
+ w.onmessage = t.step_func(function(e) {
+ assert_equals(e.data, expectedOrigin);
+ t.done();
+ });
+ }, testName + ' Worker');
+}
+
+function assertOriginSharedWorker(workerSource, expectedOrigin, testName) {
+ async_test(function(t) {
+ w = new SharedWorker(workerSource);
+ w.port.start();
+ w.port.onmessage = t.step_func(function(e) {
+ assert_equals(e.data, expectedOrigin);
+ t.done();
+ });
+ }, testName + ' SharedWorker');
+}
+
+// Test same-origin workers
+assertOriginWorker("./support/WorkerSelfOriginWorker.js", self.origin, "Same Origin");
+assertOriginSharedWorker("./support/WorkerSelfOriginSharedWorker.js", self.origin, "Same Origin");
+
+// Test data url workers have opaque origin
+assertOriginWorker("data:application/javascript,postMessage(self.origin);", "null", "Data Url");
+assertOriginSharedWorker("data:application/javascript,onconnect = function(e) { e.ports[0].postMessage(self.origin); }", "null", "Data Url");
+
+// Test blob url workers
+blob = new Blob(["postMessage(self.origin);"]);
+blobUrl = URL.createObjectURL(blob);
+assertOriginWorker(blobUrl, self.origin, "Blob Url");
+
+blob = new Blob(["onconnect = function(e) { e.ports[0].postMessage(self.origin); }"]);
+blobUrl = URL.createObjectURL(blob);
+assertOriginSharedWorker(blobUrl, self.origin, "Blob Url");
+</script>
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinsupportWorkerSelfOriginSharedWorkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginSharedWorker.js (0 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginSharedWorker.js         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginSharedWorker.js        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+// Post back the location of the worker
+
+onconnect = function(e) {
+ e.ports[0].postMessage(self.origin);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinsupportWorkerSelfOriginWorkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginWorker.js (0 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginWorker.js         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginWorker.js        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+// Post back the location of the worker
+
+postMessage(self.origin);
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinsupportw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/w3c-import.log (0 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/w3c-import.log         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/w3c-import.log        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginSharedWorker.js
+/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/support/WorkerSelfOriginWorker.js
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlwebappapisthewindoworworkerglobalscopemixinw3cimportlog"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/w3c-import.log (0 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/w3c-import.log         (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/w3c-import.log        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the W3C CSS or WPT github:
+        https://github.com/w3c/csswg-test
+        https://github.com/w3c/web-platform-tests
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/Source/WebCore/ChangeLog        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2017-03-19 Chris Dumez <cdumez@apple.com>
+
+ Implement self.origin
+ https://bugs.webkit.org/show_bug.cgi?id=168023
+
+ Reviewed by Sam Weinig.
+
+ Implement self.origin:
+ - https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
+
+ Firefox and Chrome already support this.
+
+ Test: imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin.html
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::origin):
+ * page/DOMWindow.h:
+ * page/WindowOrWorkerGlobalScope.idl:
+ * workers/WorkerGlobalScope.cpp:
+ (WebCore::WorkerGlobalScope::origin):
+ * workers/WorkerGlobalScope.h:
+
</ins><span class="cx"> 2017-03-18 Jon Lee <jonlee@apple.com>
</span><span class="cx">
</span><span class="cx"> Add support for ImplementedAs, Clamp, EnforceRange, TreatNullAs for dictionary members
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -1442,6 +1442,12 @@
</span><span class="cx"> return m_frame->tree().top().document()->domWindow();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String DOMWindow::origin() const
+{
+ auto document = this->document();
+ return document ? document->securityOrigin().toString() : emptyString();
+}
+
</ins><span class="cx"> Document* DOMWindow::document() const
</span><span class="cx"> {
</span><span class="cx"> return downcast<Document>(ContextDestructionObserver::scriptExecutionContext());
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.h (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.h        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/Source/WebCore/page/DOMWindow.h        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -194,6 +194,8 @@
</span><span class="cx"> DOMWindow* parent() const;
</span><span class="cx"> DOMWindow* top() const;
</span><span class="cx">
</span><ins>+ String origin() const;
+
</ins><span class="cx"> // DOM Level 2 AbstractView Interface
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT Document* document() const;
</span></span></pre></div>
<a id="trunkSourceWebCorepageWindowOrWorkerGlobalScopeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/Source/WebCore/page/WindowOrWorkerGlobalScope.idl        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx"> [
</span><span class="cx"> NoInterfaceObject,
</span><span class="cx"> ] interface WindowOrWorkerGlobalScope {
</span><ins>+ [Replaceable] readonly attribute USVString origin;
+
</ins><span class="cx"> // Timers.
</span><span class="cx"> [Custom] long setTimeout(any handler, optional long timeout = 0);
</span><span class="cx"> void clearTimeout(optional long handle = 0);
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -105,6 +105,12 @@
</span><span class="cx"> thread().workerReportingProxy().workerGlobalScopeDestroyed();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String WorkerGlobalScope::origin() const
+{
+ auto* securityOrigin = this->securityOrigin();
+ return securityOrigin ? securityOrigin->toString() : emptyString();
+}
+
</ins><span class="cx"> void WorkerGlobalScope::removeAllEventListeners()
</span><span class="cx"> {
</span><span class="cx"> EventTarget::removeAllEventListeners();
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (214146 => 214147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.h        2017-03-19 21:11:50 UTC (rev 214146)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h        2017-03-19 21:51:19 UTC (rev 214147)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx"> virtual bool isDedicatedWorkerGlobalScope() const { return false; }
</span><span class="cx">
</span><span class="cx"> const URL& url() const final { return m_url; }
</span><ins>+ String origin() const;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> IDBClient::IDBConnectionProxy* idbConnectionProxy() final;
</span></span></pre>
</div>
</div>
</body>
</html>