<!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  &lt;cdumez@apple.com&gt;
</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  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         `const location = &quot;foo&quot;` 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 &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</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  &lt;cdumez@apple.com&gt;
+
+        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  &lt;jonlee@apple.com&gt;
</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">     &quot;csswg-test/css-grid-1&quot;: &quot;import&quot;, 
</span><span class="cx">     &quot;csswg-test/css-images-3&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;csswg-test/css-lists-3&quot;: &quot;skip&quot;, 
</span><del>-    &quot;csswg-test/css-logical-properties-1&quot; : &quot;skip&quot;, 
</del><ins>+    &quot;csswg-test/css-logical-properties-1&quot;: &quot;skip&quot;, 
</ins><span class="cx">     &quot;csswg-test/css-masking-1&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;csswg-test/css-multicol-1&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;csswg-test/css-namespaces-1&quot;: &quot;skip&quot;, 
</span><span class="lines">@@ -228,8 +228,8 @@
</span><span class="cx">     &quot;web-platform-tests/html/semantics/embedded-content/media-elements/video_loop_base.html&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/html/semantics/embedded-content/the-area-element/area_nohref.xhtml&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/html/semantics/embedded-content/the-area-element/test-area.xhtml&quot;: &quot;skip&quot;, 
</span><ins>+    &quot;web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html&quot;: &quot;skip&quot;, 
</ins><span class="cx">     &quot;web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html&quot;: &quot;skip&quot;, 
</span><del>-    &quot;web-platform-tests/html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html&quot;: &quot;skip&quot;, 
</del><span class="cx">     &quot;web-platform-tests/html/semantics/embedded-content/the-img-element/relevant-mutations.html&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-image-data&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/html/semantics/embedded-content/the-object-element/object-events.html&quot;: &quot;skip&quot;, 
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx">     &quot;web-platform-tests/html/webappapis/scripting/event-loops/microtask_after_raf.html&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/html/webappapis/scripting/events/event-handler-processing-algorithm-error&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections&quot;: &quot;skip&quot;, 
</span><del>-    &quot;web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin&quot;: &quot;skip&quot;, 
</del><ins>+    &quot;web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin&quot;: &quot;import&quot;, 
</ins><span class="cx">     &quot;web-platform-tests/http&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/imagebitmap-renderingcontext&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/infrastructure&quot;: &quot;skip&quot;, 
</span><span class="lines">@@ -320,4 +320,4 @@
</span><span class="cx">     &quot;web-platform-tests/webvr&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/webvtt&quot;: &quot;skip&quot;, 
</span><span class="cx">     &quot;web-platform-tests/workers&quot;: &quot;skip&quot;
</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 &quot;origin&quot; expected property &quot;origin&quot; 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 &quot;onpopstate&quot; with the proper type (109) 
</span><span class="cx"> PASS Window interface: window must inherit property &quot;onstorage&quot; with the proper type (110) 
</span><span class="cx"> PASS Window interface: window must inherit property &quot;onunload&quot; with the proper type (111) 
</span><del>-FAIL Window interface: window must inherit property &quot;origin&quot; with the proper type (112) assert_own_property: expected property &quot;origin&quot; missing
</del><ins>+PASS Window interface: window must inherit property &quot;origin&quot; with the proper type (112) 
</ins><span class="cx"> PASS Window interface: window must inherit property &quot;btoa&quot; 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 &quot;atob&quot; 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 &quot;constructor&quot; 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 &quot;scrollRestoration&quot; 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 &quot;length&quot; with the proper type (0) 
</span><del>-FAIL History interface: window.history must inherit property &quot;scrollRestoration&quot; with the proper type (1) assert_inherits: property &quot;scrollRestoration&quot; not found in prototype chain
</del><ins>+PASS History interface: window.history must inherit property &quot;scrollRestoration&quot; with the proper type (1) 
</ins><span class="cx"> PASS History interface: window.history must inherit property &quot;state&quot; with the proper type (2) 
</span><span class="cx"> PASS History interface: window.history must inherit property &quot;go&quot; 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) &quot;http://localhost:8800&quot; 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) &quot;http://localhost:8800&quot; but got (undefined) undefined
-FAIL about:blank subframe origins assert_equals: Should have the right origin for about:blank iframe expected (string) &quot;http://localhost:8800&quot; 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 &quot;http://localhost:8800&quot; but got &quot;null&quot;
</span><del>-FAIL javascript: subframe origins assert_equals: Should have the right origin for javascript: iframe expected (string) &quot;http://localhost:8800&quot; but got (undefined) undefined
-FAIL srcdoc subframe origins assert_equals: Should have the right origin for srcdoc iframe expected (string) &quot;http://localhost:8800&quot; 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>+&lt;!DOCTYPE html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;Test workers self.origin&lt;/title&gt;
+&lt;script src=&quot;../../../../../../resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../../../../../../resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+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(&quot;./support/WorkerSelfOriginWorker.js&quot;, self.origin, &quot;Same Origin&quot;);
+assertOriginSharedWorker(&quot;./support/WorkerSelfOriginSharedWorker.js&quot;, self.origin, &quot;Same Origin&quot;);
+
+// Test data url workers have opaque origin
+assertOriginWorker(&quot;data:application/javascript,postMessage(self.origin);&quot;, &quot;null&quot;, &quot;Data Url&quot;);
+assertOriginSharedWorker(&quot;data:application/javascript,onconnect = function(e) { e.ports[0].postMessage(self.origin); }&quot;, &quot;null&quot;, &quot;Data Url&quot;);
+
+// Test blob url workers
+blob = new Blob([&quot;postMessage(self.origin);&quot;]);
+blobUrl = URL.createObjectURL(blob);
+assertOriginWorker(blobUrl, self.origin, &quot;Blob Url&quot;);
+
+blob = new Blob([&quot;onconnect = function(e) { e.ports[0].postMessage(self.origin); }&quot;]);
+blobUrl = URL.createObjectURL(blob);
+assertOriginSharedWorker(blobUrl, self.origin, &quot;Blob Url&quot;);
+&lt;/script&gt;
</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  &lt;cdumez@apple.com&gt;
+
+        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  &lt;jonlee@apple.com&gt;
</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-&gt;tree().top().document()-&gt;domWindow();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String DOMWindow::origin() const
+{
+    auto document = this-&gt;document();
+    return document ? document-&gt;securityOrigin().toString() : emptyString();
+}
+
</ins><span class="cx"> Document* DOMWindow::document() const
</span><span class="cx"> {
</span><span class="cx">     return downcast&lt;Document&gt;(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-&gt;securityOrigin();
+    return securityOrigin ? securityOrigin-&gt;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&amp; 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>