Title: [216753] trunk
Revision
216753
Author
pvol...@apple.com
Date
2017-05-12 01:08:45 -0700 (Fri, 12 May 2017)

Log Message

Geolocation requests should not be blocked when the security origin is local.
https://bugs.webkit.org/show_bug.cgi?id=171857
Source/WebCore:

rdar://problem/29318409

Reviewed by Brent Fulgham.

Geolocation requests from security origins where the url scheme is registered as local,
should not be blocked. This applies to the file url scheme, but also to other local url
schemes.

Test: fast/misc/geolocation-local-security-origin.html

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::shouldBlockGeolocationRequests):

LayoutTests:


Reviewed by Brent Fulgham.

* fast/misc/geolocation-local-security-origin-expected.txt: Added.
* fast/misc/geolocation-local-security-origin.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (216752 => 216753)


--- trunk/LayoutTests/ChangeLog	2017-05-12 07:52:50 UTC (rev 216752)
+++ trunk/LayoutTests/ChangeLog	2017-05-12 08:08:45 UTC (rev 216753)
@@ -1,3 +1,13 @@
+2017-05-11  Per Arne Vollan  <pvol...@apple.com>
+
+        Geolocation requests should not be blocked when the security origin is local.
+        https://bugs.webkit.org/show_bug.cgi?id=171857
+
+        Reviewed by Brent Fulgham.
+
+        * fast/misc/geolocation-local-security-origin-expected.txt: Added.
+        * fast/misc/geolocation-local-security-origin.html: Added.
+
 2017-05-11  Manuel Rego Casasnovas  <r...@igalia.com>
 
         [selectors4] :focus-within tests using shadow DOM don't pass on WK1

Added: trunk/LayoutTests/fast/misc/geolocation-local-security-origin-expected.txt (0 => 216753)


--- trunk/LayoutTests/fast/misc/geolocation-local-security-origin-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/misc/geolocation-local-security-origin-expected.txt	2017-05-12 08:08:45 UTC (rev 216753)
@@ -0,0 +1 @@
+This test makes sure we are not getting a console message stating that geolocation is blocked when the url scheme is local (e.g. file://).

Added: trunk/LayoutTests/fast/misc/geolocation-local-security-origin.html (0 => 216753)


--- trunk/LayoutTests/fast/misc/geolocation-local-security-origin.html	                        (rev 0)
+++ trunk/LayoutTests/fast/misc/geolocation-local-security-origin.html	2017-05-12 08:08:45 UTC (rev 216753)
@@ -0,0 +1,14 @@
+<html>
+<body>
+<p>This test makes sure we are not getting a console message stating that geolocation is blocked when the url scheme is local (e.g. file://).</p>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (navigator.geolocation)
+    navigator.geolocation.getCurrentPosition(showPosition);
+function showPosition(position) {
+    console.log("Latitude: " + position.coords.latitude + "Longitude: " + position.coords.longitude);
+}
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (216752 => 216753)


--- trunk/Source/WebCore/ChangeLog	2017-05-12 07:52:50 UTC (rev 216752)
+++ trunk/Source/WebCore/ChangeLog	2017-05-12 08:08:45 UTC (rev 216753)
@@ -1,3 +1,20 @@
+2017-05-11  Per Arne Vollan  <pvol...@apple.com>
+
+        Geolocation requests should not be blocked when the security origin is local.
+        https://bugs.webkit.org/show_bug.cgi?id=171857
+        rdar://problem/29318409
+
+        Reviewed by Brent Fulgham.
+
+        Geolocation requests from security origins where the url scheme is registered as local,
+        should not be blocked. This applies to the file url scheme, but also to other local url
+        schemes.
+
+        Test: fast/misc/geolocation-local-security-origin.html
+
+        * Modules/geolocation/Geolocation.cpp:
+        (WebCore::Geolocation::shouldBlockGeolocationRequests):
+
 2017-05-11  Chris Dumez  <cdu...@apple.com>
 
         Drop remaining uses of PassRefPtr in WebCore

Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp (216752 => 216753)


--- trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp	2017-05-12 07:52:50 UTC (rev 216752)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp	2017-05-12 08:08:45 UTC (rev 216753)
@@ -350,9 +350,9 @@
 {
     bool isSecure = SecurityOrigin::isSecure(document()->url());
     bool hasMixedContent = document()->foundMixedContent();
-    bool isLocalFile = document()->url().isLocalFile();
+    bool isLocalOrigin = securityOrigin()->isLocal();
     if (securityOrigin()->canRequestGeolocation()) {
-        if (isLocalFile || (isSecure && !hasMixedContent))
+        if (isLocalOrigin || (isSecure && !hasMixedContent))
             return false;
     }
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to