<!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>[195271] releases/WebKitGTK/webkit-2.10</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/195271">195271</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-19 01:30:17 -0800 (Tue, 19 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/195075">r195075</a> - Disallow use of Geolocation service from unique origins
https://bugs.webkit.org/show_bug.cgi?id=153102
&lt;rdar://problem/23055645&gt;

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html
       fast/dom/Geolocation/dataURL-watchPosition.html
       fast/dom/Geolocation/srcdoc-getCurrentPosition.html
       fast/dom/Geolocation/srcdoc-watchPosition.html
       http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html
       http/tests/security/sandboxed-iframe-geolocation-watchPosition.html

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object
associated with this script execution context.
(WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested
from a document with a unique origin.
* Modules/geolocation/Geolocation.h:
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::canRequestGeolocation): Added.

LayoutTests:

* fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt: Added.
* fast/dom/Geolocation/dataURL-getCurrentPosition.html: Added.
* fast/dom/Geolocation/dataURL-watchPosition-expected.txt: Added.
* fast/dom/Geolocation/dataURL-watchPosition.html: Added.
* fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt: Added.
* fast/dom/Geolocation/srcdoc-getCurrentPosition.html: Added.
* fast/dom/Geolocation/srcdoc-watchPosition-expected.txt: Added.
* fast/dom/Geolocation/srcdoc-watchPosition.html: Added.
* http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js: Added.
(done):
(logMessage):
(didReceivePosition):
(didReceiveError):
(checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod):
(markupToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod):
(dataURLToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod):
* http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html: Added.
* http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html: Added.
* http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt: Added.
* http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html: Added.
* http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt: Added.
* http/tests/security/sandboxed-iframe-geolocation-watchPosition.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoreModulesgeolocationGeolocationcpp">releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/geolocation/Geolocation.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoreModulesgeolocationGeolocationh">releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/geolocation/Geolocation.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCorepageSecurityOriginh">releases/WebKitGTK/webkit-2.10/Source/WebCore/page/SecurityOrigin.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210ToolsTestWebKitAPITestsWebKit2GtkTestUIClientcpp">releases/WebKitGTK/webkit-2.10/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationdataURLgetCurrentPositionexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationdataURLgetCurrentPositionhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationdataURLwatchPositionexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationdataURLwatchPositionhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationsrcdocgetCurrentPositionexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationsrcdocgetCurrentPositionhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationsrcdocwatchPositionexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationsrcdocwatchPositionhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestssecurityresourcescheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethodjs">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestssecurityresourcessandboxediframegeolocationgetCurrentPositionhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestssecurityresourcessandboxediframegeolocationwatchPositionhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestssecuritysandboxediframegeolocationgetCurrentPositionexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestssecuritysandboxediframegeolocationgetCurrentPositionhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestssecuritysandboxediframegeolocationwatchPositionexpectedtxt">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestshttptestssecuritysandboxediframegeolocationwatchPositionhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit210LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (195270 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2016-01-19 09:07:16 UTC (rev 195270)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -1,5 +1,36 @@
</span><span class="cx"> 2016-01-14  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Disallow use of Geolocation service from unique origins
+        https://bugs.webkit.org/show_bug.cgi?id=153102
+        &lt;rdar://problem/23055645&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        * fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt: Added.
+        * fast/dom/Geolocation/dataURL-getCurrentPosition.html: Added.
+        * fast/dom/Geolocation/dataURL-watchPosition-expected.txt: Added.
+        * fast/dom/Geolocation/dataURL-watchPosition.html: Added.
+        * fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt: Added.
+        * fast/dom/Geolocation/srcdoc-getCurrentPosition.html: Added.
+        * fast/dom/Geolocation/srcdoc-watchPosition-expected.txt: Added.
+        * fast/dom/Geolocation/srcdoc-watchPosition.html: Added.
+        * http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js: Added.
+        (done):
+        (logMessage):
+        (didReceivePosition):
+        (didReceiveError):
+        (checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod):
+        (markupToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod):
+        (dataURLToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod):
+        * http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html: Added.
+        * http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html: Added.
+        * http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt: Added.
+        * http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html: Added.
+        * http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt: Added.
+        * http/tests/security/sandboxed-iframe-geolocation-watchPosition.html: Added.
+
+2016-01-14  Daniel Bates  &lt;dabates@apple.com&gt;
+
</ins><span class="cx">         [XSS Auditor] Partial bypass when web server collapses path components
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=152872
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationdataURLgetCurrentPositionexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+PASS error.code is error.POSITION_UNAVAILABLE.
+PASS error.message is &quot;Origin does not have permission to use Geolocation service&quot;.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationdataURLgetCurrentPositionhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition.html (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition.html        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;!-- Tests that navigator.geolocation.getCurrentPosition() returns error POSITION_UNAVAILABLE when called from a document with a data URL. --&gt;
+&lt;script src=&quot;../../../http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+var PositionUnavailableMockMessage = &quot;Origin does not have permission to use Geolocation service&quot;;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+    testRunner.setGeolocationPermission(true);
+    testRunner.setMockGeolocationPositionUnavailableError(PositionUnavailableMockMessage);
+    testRunner.setMockGeolocationPosition(37.3317115, -122.0323722, 100.0);
+}
+
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.location = dataURLToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(&quot;getCurrentPosition&quot;, PositionUnavailableMockMessage, done);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationdataURLwatchPositionexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition-expected.txt (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition-expected.txt        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+PASS error.code is error.POSITION_UNAVAILABLE.
+PASS error.message is &quot;Origin does not have permission to use Geolocation service&quot;.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationdataURLwatchPositionhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition.html (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition.html        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;!-- Tests that navigator.geolocation.watchPosition() returns error POSITION_UNAVAILABLE when called from a document with a data URL. --&gt;
+&lt;script src=&quot;../../../http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+var PositionUnavailableMockMessage = &quot;Origin does not have permission to use Geolocation service&quot;;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+    testRunner.setGeolocationPermission(true);
+    testRunner.setMockGeolocationPositionUnavailableError(PositionUnavailableMockMessage);
+    testRunner.setMockGeolocationPosition(37.3317115, -122.0323722, 100.0);
+}
+
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+window.location = dataURLToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(&quot;watchPosition&quot;, PositionUnavailableMockMessage, done);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationsrcdocgetCurrentPositionexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Tests that navigator.geolocation.getCurrentPosition() returns error POSITION_UNAVAILABLE when called from a srcdoc.
+
+
+
+--------
+Frame: 'frame'
+--------
+FAIL should have invoked error callback, but invoked success callback.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationsrcdocgetCurrentPositionhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition.html (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition.html        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that navigator.geolocation.getCurrentPosition() returns error POSITION_UNAVAILABLE when called from a srcdoc.&lt;/p&gt;
+&lt;iframe id=&quot;frame&quot; width=&quot;100%&quot; height=&quot;300&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+var PositionUnavailableMockMessage = &quot;Origin does not have permission to use Geolocation service&quot;;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpChildFramesAsText();
+    testRunner.waitUntilDone();
+    testRunner.setGeolocationPermission(true);
+    testRunner.setMockGeolocationPositionUnavailableError(PositionUnavailableMockMessage);
+    testRunner.setMockGeolocationPosition(37.3317115, -122.0323722, 100.0);
+}
+
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+document.getElementById(&quot;frame&quot;).srcdoc = markupToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(&quot;getCurrentPosition&quot;, PositionUnavailableMockMessage, done);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationsrcdocwatchPositionexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition-expected.txt (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition-expected.txt        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+Tests that navigator.geolocation.watchPosition() returns error POSITION_UNAVAILABLE when called from a srcdoc.
+
+
+
+--------
+Frame: 'frame'
+--------
+FAIL should have invoked error callback, but invoked success callback.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestsfastdomGeolocationsrcdocwatchPositionhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition.html (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition.html        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that navigator.geolocation.watchPosition() returns error POSITION_UNAVAILABLE when called from a srcdoc.&lt;/p&gt;
+&lt;iframe id=&quot;frame&quot; width=&quot;100%&quot; height=&quot;300&quot;&gt;&lt;/iframe&gt;
+&lt;script&gt;
+var PositionUnavailableMockMessage = &quot;Origin does not have permission to use Geolocation service&quot;;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpChildFramesAsText();
+    testRunner.waitUntilDone();
+    testRunner.setGeolocationPermission(true);
+    testRunner.setMockGeolocationPositionUnavailableError(PositionUnavailableMockMessage);
+    testRunner.setMockGeolocationPosition(37.3317115, -122.0323722, 100.0);
+}
+
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+document.getElementById(&quot;frame&quot;).srcdoc = markupToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(&quot;watchPosition&quot;, PositionUnavailableMockMessage, done);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestssecurityresourcescheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethodjs"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+function checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(geolocationMethodName, expectedPositionUnavailableErrorMessage, callbackFunction)
+{
+    function done()
+    {
+        if (callbackFunction)
+            callbackFunction();
+    }
+
+    function logMessage(message)
+    {
+        document.getElementById(&quot;console&quot;).appendChild(document.createTextNode(message + &quot;\n&quot;));
+    }
+
+    function didReceivePosition()
+    {
+        logMessage(&quot;FAIL should have invoked error callback, but invoked success callback.&quot;);
+        done();
+    }
+
+    function didReceiveError(error)
+    {
+        if (error.code === error.POSITION_UNAVAILABLE)
+            logMessage(&quot;PASS error.code is error.POSITION_UNAVAILABLE.&quot;);
+        else
+            logMessage(&quot;FAIL error.code should be &quot; + error.POSITION_UNAVAILABLE + &quot;. Was &quot; + error.code + &quot;.&quot;);
+
+        if (error.message === expectedPositionUnavailableErrorMessage)
+            logMessage('PASS error.message is &quot;' + expectedPositionUnavailableErrorMessage + '&quot;.');
+        else
+            logMessage('FAIL error.message should be &quot;' + expectedPositionUnavailableErrorMessage + '&quot;. Was &quot;' + error.message + '&quot;.');
+        done();
+    }
+
+    navigator.geolocation[geolocationMethodName](didReceivePosition, didReceiveError);
+}
+
+function markupToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(geolocationMethodNameAsString, expectedPositionUnavailableErrorMessage, callbackFunction)
+{
+    var result = &quot;&lt;!DOCTYPE html&gt;&quot;
+    result += &quot;&lt;html&gt;&quot;;
+    result += &quot;&lt;head&gt;&quot;;
+    result += &quot;&lt;script&gt;&quot;;
+    result += checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.toString() + &quot;;&quot;;
+    result += &quot;checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(&quot; + JSON.stringify(geolocationMethodNameAsString) + &quot;, &quot; + JSON.stringify(expectedPositionUnavailableErrorMessage) + &quot;, &quot; + callbackFunction.toString() + &quot;);&quot;;
+    result += &quot;&lt;/&quot; + &quot;script&gt;&quot;;
+    result += &quot;&lt;/head&gt;&quot;;
+    result += &quot;&lt;body&gt;&quot;;
+    result += '&lt;pre id=&quot;console&quot;&gt;&lt;/pre&gt;';
+    result += &quot;&lt;/body&gt;&quot;;
+    result += &quot;&lt;/html&gt;&quot;;
+    return result;
+}
+
+function dataURLToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(geolocationMethodNameAsString, expectedPositionUnavailableErrorMessage, callbackFunction)
+{
+    return &quot;data:text/html,&quot; + encodeURIComponent(markupToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(geolocationMethodNameAsString, expectedPositionUnavailableErrorMessage, callbackFunction));
+}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestssecurityresourcessandboxediframegeolocationgetCurrentPositionhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;http://127.0.0.1:8000/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+var PositionUnavailableMockMessage = &quot;Origin does not have permission to use Geolocation service&quot;;
+if (window.testRunner) {
+    testRunner.setGeolocationPermission(true);
+    testRunner.setMockGeolocationPositionUnavailableError(PositionUnavailableMockMessage);
+    testRunner.setMockGeolocationPosition(37.3317115, -122.0323722, 100.0);
+}
+
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(&quot;getCurrentPosition&quot;, PositionUnavailableMockMessage, done);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;pre id=&quot;console&quot;&gt;&lt;/pre&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestssecurityresourcessandboxediframegeolocationwatchPositionhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;http://127.0.0.1:8000/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+var PositionUnavailableMockMessage = &quot;Origin does not have permission to use Geolocation service&quot;;
+if (window.testRunner) {
+    testRunner.setGeolocationPermission(true);
+    testRunner.setMockGeolocationPositionUnavailableError(PositionUnavailableMockMessage);
+    testRunner.setMockGeolocationPosition(37.3317115, -122.0323722, 100.0);
+}
+
+function done()
+{
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod(&quot;watchPosition&quot;, PositionUnavailableMockMessage, done);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;pre id=&quot;console&quot;&gt;&lt;/pre&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestssecuritysandboxediframegeolocationgetCurrentPositionexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Tests that navigator.geolocation.getCurrentPosition() returns error POSITION_UNAVAILABLE when called from a document in a sandboxed iframe.
+
+
+
+--------
+Frame: '&lt;!--framePath //&lt;!--frame0--&gt;--&gt;'
+--------
+PASS error.code is error.POSITION_UNAVAILABLE.
+PASS error.message is &quot;Origin does not have permission to use Geolocation service&quot;.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestssecuritysandboxediframegeolocationgetCurrentPositionhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpChildFramesAsText();
+    testRunner.waitUntilDone();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that navigator.geolocation.getCurrentPosition() returns error POSITION_UNAVAILABLE when called from a document in a sandboxed iframe.&lt;/p&gt;
+&lt;iframe src=&quot;resources/sandboxed-iframe-geolocation-getCurrentPosition.html&quot; sandbox=&quot;allow-scripts&quot; width=&quot;100%&quot; height=&quot;300&quot;&gt;&lt;/iframe&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestssecuritysandboxediframegeolocationwatchPositionexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Tests that navigator.geolocation.watchPosition() returns error POSITION_UNAVAILABLE when called from a document in a sandboxed iframe.
+
+
+
+--------
+Frame: '&lt;!--framePath //&lt;!--frame0--&gt;--&gt;'
+--------
+PASS error.code is error.POSITION_UNAVAILABLE.
+PASS error.message is &quot;Origin does not have permission to use Geolocation service&quot;.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestshttptestssecuritysandboxediframegeolocationwatchPositionhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition.html (0 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition.html        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.dumpChildFramesAsText();
+    testRunner.waitUntilDone();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;Tests that navigator.geolocation.watchPosition() returns error POSITION_UNAVAILABLE when called from a document in a sandboxed iframe.&lt;/p&gt;
+&lt;iframe src=&quot;resources/sandboxed-iframe-geolocation-watchPosition.html&quot; sandbox=&quot;allow-scripts&quot; width=&quot;100%&quot; height=&quot;300&quot;&gt;&lt;/iframe&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195270 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog        2016-01-19 09:07:16 UTC (rev 195270)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2016-01-14  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Disallow use of Geolocation service from unique origins
+        https://bugs.webkit.org/show_bug.cgi?id=153102
+        &lt;rdar://problem/23055645&gt;
+
+        Reviewed by Alexey Proskuryakov.
+
+        Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html
+               fast/dom/Geolocation/dataURL-watchPosition.html
+               fast/dom/Geolocation/srcdoc-getCurrentPosition.html
+               fast/dom/Geolocation/srcdoc-watchPosition.html
+               http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html
+               http/tests/security/sandboxed-iframe-geolocation-watchPosition.html
+
+        * Modules/geolocation/Geolocation.cpp:
+        (WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object
+        associated with this script execution context.
+        (WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested
+        from a document with a unique origin.
+        * Modules/geolocation/Geolocation.h:
+        * page/SecurityOrigin.h:
+        (WebCore::SecurityOrigin::canRequestGeolocation): Added.
+
+2016-01-14  Daniel Bates  &lt;dabates@apple.com&gt;
+
</ins><span class="cx">         [XSS Auditor] Extract attribute truncation logic and formalize string canonicalization
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=152874
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoreModulesgeolocationGeolocationcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/geolocation/Geolocation.cpp (195270 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/geolocation/Geolocation.cpp        2016-01-19 09:07:16 UTC (rev 195270)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/geolocation/Geolocation.cpp        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;Geoposition.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PositionError.h&quot;
</span><ins>+#include &quot;SecurityOrigin.h&quot;
</ins><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -48,6 +49,7 @@
</span><span class="cx"> static const char permissionDeniedErrorMessage[] = &quot;User denied Geolocation&quot;;
</span><span class="cx"> static const char failedToStartServiceErrorMessage[] = &quot;Failed to start Geolocation service&quot;;
</span><span class="cx"> static const char framelessDocumentErrorMessage[] = &quot;Geolocation cannot be used in frameless documents&quot;;
</span><ins>+static const char originCannotRequestGeolocationErrorMessage[] = &quot;Origin does not have permission to use Geolocation service&quot;;
</ins><span class="cx"> 
</span><span class="cx"> static PassRefPtr&lt;Geoposition&gt; createGeoposition(GeolocationPosition* position)
</span><span class="cx"> {
</span><span class="lines">@@ -152,6 +154,11 @@
</span><span class="cx">     return downcast&lt;Document&gt;(scriptExecutionContext());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+SecurityOrigin* Geolocation::securityOrigin() const
+{
+    return scriptExecutionContext()-&gt;securityOrigin();
+}
+
</ins><span class="cx"> Frame* Geolocation::frame() const
</span><span class="cx"> {
</span><span class="cx">     return document() ? document()-&gt;frame() : nullptr;
</span><span class="lines">@@ -333,6 +340,11 @@
</span><span class="cx"> 
</span><span class="cx"> void Geolocation::startRequest(GeoNotifier *notifier)
</span><span class="cx"> {
</span><ins>+    if (!securityOrigin()-&gt;canRequestGeolocation()) {
+        notifier-&gt;setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(originCannotRequestGeolocationErrorMessage)));
+        return;
+    }
+
</ins><span class="cx">     // Check whether permissions have already been denied. Note that if this is the case,
</span><span class="cx">     // the permission state can not change again in the lifetime of this page.
</span><span class="cx">     if (isDenied())
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoreModulesgeolocationGeolocationh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/geolocation/Geolocation.h (195270 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/geolocation/Geolocation.h        2016-01-19 09:07:16 UTC (rev 195270)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/Modules/geolocation/Geolocation.h        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> class GeolocationPosition;
</span><span class="cx"> class Page;
</span><span class="cx"> class ScriptExecutionContext;
</span><ins>+class SecurityOrigin;
</ins><span class="cx"> 
</span><span class="cx"> class Geolocation : public ScriptWrappable, public RefCounted&lt;Geolocation&gt;, public ActiveDOMObject
</span><span class="cx"> {
</span><span class="lines">@@ -87,6 +88,7 @@
</span><span class="cx">     bool isDenied() const { return m_allowGeolocation == No; }
</span><span class="cx"> 
</span><span class="cx">     Page* page() const;
</span><ins>+    SecurityOrigin* securityOrigin() const;
</ins><span class="cx"> 
</span><span class="cx">     typedef Vector&lt;RefPtr&lt;GeoNotifier&gt;&gt; GeoNotifierVector;
</span><span class="cx">     typedef HashSet&lt;RefPtr&lt;GeoNotifier&gt;&gt; GeoNotifierSet;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCorepageSecurityOriginh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/page/SecurityOrigin.h (195270 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/page/SecurityOrigin.h        2016-01-19 09:07:16 UTC (rev 195270)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/page/SecurityOrigin.h        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -156,6 +156,7 @@
</span><span class="cx">     bool canAccessPluginStorage(const SecurityOrigin* topOrigin) const { return canAccessStorage(topOrigin); }
</span><span class="cx">     bool canAccessApplicationCache(const SecurityOrigin* topOrigin) const { return canAccessStorage(topOrigin); }
</span><span class="cx">     bool canAccessCookies() const { return !isUnique(); }
</span><ins>+    bool canRequestGeolocation() const { return !isUnique(); }
</ins><span class="cx">     Policy canShowNotifications() const;
</span><span class="cx"> 
</span><span class="cx">     // The local SecurityOrigin is the most privileged SecurityOrigin.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210ToolsTestWebKitAPITestsWebKit2GtkTestUIClientcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp (195270 => 195271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp        2016-01-19 09:07:16 UTC (rev 195270)
+++ releases/WebKitGTK/webkit-2.10/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestUIClient.cpp        2016-01-19 09:30:17 UTC (rev 195271)
</span><span class="lines">@@ -653,7 +653,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Test denying a permission request.
</span><span class="cx">     test-&gt;m_allowPermissionRequests = false;
</span><del>-    test-&gt;loadHtml(geolocationRequestHTML, 0);
</del><ins>+    test-&gt;loadHtml(geolocationRequestHTML, &quot;http://foo.com/bar&quot;);
</ins><span class="cx">     test-&gt;waitUntilTitleChanged();
</span><span class="cx"> 
</span><span class="cx">     // According to the Geolocation API specification, '1' is the
</span></span></pre>
</div>
</div>

</body>
</html>