Title: [196673] trunk
Revision
196673
Author
[email protected]
Date
2016-02-16 17:11:29 -0800 (Tue, 16 Feb 2016)

Log Message

Navigator.geolocation should not be marked a [Replaceable] and should be on the prototype
https://bugs.webkit.org/show_bug.cgi?id=154304
<rdar://problem/24685092>

Reviewed by Gavin Barraclough.

LayoutTests/imported/w3c:

Rebaseline test now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

1. Drop the [Replaceable] IDL extended attribute for navigator.geolocation
   as this does not match other browsers or the specification:
   - https://dev.w3.org/geo/api/spec-source.html#geolocation_interface
2. Move Navigator attributes to the prototype, where they should be as
   per the Web IDL specification.

The previous behavior was meant as a workaround for a bug in the Amazon
iOS app (rdar://problem/16332749). However, I have confirmed that the
latest Amazon App no longer has any issue with those changes.

Test: js/navigator-set-geolocation.html

* Modules/geolocation/NavigatorGeolocation.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(InterfaceRequiresAttributesOnInstanceForCompatibility): Deleted.

LayoutTests:

* fast/dom/Geolocation/enabled-expected.txt:
* fast/dom/Geolocation/script-tests/enabled.js:
* js/dom/delete-syntax-expected.txt:
* js/dom/script-tests/delete-syntax.js:
Update tests as they expected the navigator properties to be on the
instance rather than the prototype.

* js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js: Removed.
* js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt: Removed.
* js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html: Removed.
Drop outdated test.

* js/navigator-set-geolocation-expected.txt: Added.
* js/navigator-set-geolocation.html: Added.
Add test to make sure that Navigator.geolocation cannot be set. I verified that
this test passes in both Firefox and Chrome.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (196672 => 196673)


--- trunk/LayoutTests/ChangeLog	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/ChangeLog	2016-02-17 01:11:29 UTC (rev 196673)
@@ -1,3 +1,28 @@
+2016-02-16  Chris Dumez  <[email protected]>
+
+        Navigator.geolocation should not be marked a [Replaceable] and should be on the prototype
+        https://bugs.webkit.org/show_bug.cgi?id=154304
+        <rdar://problem/24685092>
+
+        Reviewed by Gavin Barraclough.
+
+        * fast/dom/Geolocation/enabled-expected.txt:
+        * fast/dom/Geolocation/script-tests/enabled.js:
+        * js/dom/delete-syntax-expected.txt:
+        * js/dom/script-tests/delete-syntax.js:
+        Update tests as they expected the navigator properties to be on the
+        instance rather than the prototype.
+
+        * js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js: Removed.
+        * js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt: Removed.
+        * js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html: Removed.
+        Drop outdated test.
+
+        * js/navigator-set-geolocation-expected.txt: Added.
+        * js/navigator-set-geolocation.html: Added.
+        Add test to make sure that Navigator.geolocation cannot be set. I verified that
+        this test passes in both Firefox and Chrome.
+
 2016-02-16  Said Abou-Hallawa  <[email protected]>
 
         REGRESSION (r190430): WTFCrashWithSecurityImplication in:void SVGRootInlineBox::layoutCharactersInTextBoxes()

Modified: trunk/LayoutTests/fast/dom/Geolocation/enabled-expected.txt (196672 => 196673)


--- trunk/LayoutTests/fast/dom/Geolocation/enabled-expected.txt	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/fast/dom/Geolocation/enabled-expected.txt	2016-02-17 01:11:29 UTC (rev 196673)
@@ -6,8 +6,8 @@
 PASS typeof navigator.geolocation == 'object' is true
 PASS hasGeolocationProperty() is true
 PASS 'geolocation' in navigator is true
-PASS navigator.hasOwnProperty('geolocation') is true
-PASS navigator.__proto__.hasOwnProperty('geolocation') is false
+PASS navigator.hasOwnProperty('geolocation') is false
+PASS navigator.__proto__.hasOwnProperty('geolocation') is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/dom/Geolocation/script-tests/enabled.js (196672 => 196673)


--- trunk/LayoutTests/fast/dom/Geolocation/script-tests/enabled.js	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/fast/dom/Geolocation/script-tests/enabled.js	2016-02-17 01:11:29 UTC (rev 196673)
@@ -12,7 +12,7 @@
 shouldBeTrue("typeof navigator.geolocation == 'object'");
 shouldBeTrue("hasGeolocationProperty()");
 shouldBeTrue("'geolocation' in navigator");
-shouldBeTrue("navigator.hasOwnProperty('geolocation')");
-shouldBeFalse("navigator.__proto__.hasOwnProperty('geolocation')");
+shouldBeFalse("navigator.hasOwnProperty('geolocation')");
+shouldBeTrue("navigator.__proto__.hasOwnProperty('geolocation')");
 
 window.jsTestIsAsync = false;

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196672 => 196673)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-02-17 01:11:29 UTC (rev 196673)
@@ -1,5 +1,17 @@
 2016-02-16  Chris Dumez  <[email protected]>
 
+        Navigator.geolocation should not be marked a [Replaceable] and should be on the prototype
+        https://bugs.webkit.org/show_bug.cgi?id=154304
+        <rdar://problem/24685092>
+
+        Reviewed by Gavin Barraclough.
+
+        Rebaseline test now that more checks are passing.
+
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
+2016-02-16  Chris Dumez  <[email protected]>
+
         [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
         https://bugs.webkit.org/show_bug.cgi?id=154120
         <rdar://problem/24613231>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (196672 => 196673)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt	2016-02-17 01:11:29 UTC (rev 196673)
@@ -4274,41 +4274,41 @@
 PASS Navigator interface object name 
 PASS Navigator interface: existence and properties of interface prototype object 
 PASS Navigator interface: existence and properties of interface prototype object's "constructor" property 
-FAIL Navigator interface: attribute appCodeName assert_true: The prototype object must have a property "appCodeName" expected true got false
-FAIL Navigator interface: attribute appName assert_true: The prototype object must have a property "appName" expected true got false
-FAIL Navigator interface: attribute appVersion assert_true: The prototype object must have a property "appVersion" expected true got false
-FAIL Navigator interface: attribute platform assert_true: The prototype object must have a property "platform" expected true got false
-FAIL Navigator interface: attribute product assert_true: The prototype object must have a property "product" expected true got false
+PASS Navigator interface: attribute appCodeName 
+PASS Navigator interface: attribute appName 
+PASS Navigator interface: attribute appVersion 
+PASS Navigator interface: attribute platform 
+PASS Navigator interface: attribute product 
 FAIL Navigator interface: operation taintEnabled() assert_own_property: interface prototype object missing non-static operation expected property "taintEnabled" missing
-FAIL Navigator interface: attribute userAgent assert_true: The prototype object must have a property "userAgent" expected true got false
-FAIL Navigator interface: attribute language assert_true: The prototype object must have a property "language" expected true got false
+PASS Navigator interface: attribute userAgent 
+PASS Navigator interface: attribute language 
 FAIL Navigator interface: attribute languages assert_true: The prototype object must have a property "languages" expected true got false
-FAIL Navigator interface: attribute onLine assert_true: The prototype object must have a property "onLine" expected true got false
+PASS Navigator interface: attribute onLine 
 FAIL Navigator interface: operation registerProtocolHandler(DOMString,DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "registerProtocolHandler" missing
 FAIL Navigator interface: operation registerContentHandler(DOMString,DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "registerContentHandler" missing
 FAIL Navigator interface: operation isProtocolHandlerRegistered(DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "isProtocolHandlerRegistered" missing
 FAIL Navigator interface: operation isContentHandlerRegistered(DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "isContentHandlerRegistered" missing
 FAIL Navigator interface: operation unregisterProtocolHandler(DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "unregisterProtocolHandler" missing
 FAIL Navigator interface: operation unregisterContentHandler(DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "unregisterContentHandler" missing
-FAIL Navigator interface: attribute cookieEnabled assert_true: The prototype object must have a property "cookieEnabled" expected true got false
+PASS Navigator interface: attribute cookieEnabled 
 FAIL Navigator interface: operation yieldForStorageUpdates() assert_own_property: interface prototype object missing non-static operation expected property "yieldForStorageUpdates" missing
-FAIL Navigator interface: attribute plugins assert_true: The prototype object must have a property "plugins" expected true got false
-FAIL Navigator interface: attribute mimeTypes assert_true: The prototype object must have a property "mimeTypes" expected true got false
+PASS Navigator interface: attribute plugins 
+PASS Navigator interface: attribute mimeTypes 
 FAIL Navigator interface: attribute javaEnabled assert_throws: getting property on prototype object must throw TypeError function "function () {
     [native code]
 }" did not throw
 PASS Navigator must be primary interface of window.navigator 
 PASS Stringification of window.navigator 
-FAIL Navigator interface: window.navigator must inherit property "appCodeName" with the proper type (0) assert_inherits: property "appCodeName" found on object expected in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "appName" with the proper type (1) assert_inherits: property "appName" found on object expected in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "appVersion" with the proper type (2) assert_inherits: property "appVersion" found on object expected in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "platform" with the proper type (3) assert_inherits: property "platform" found on object expected in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "product" with the proper type (4) assert_inherits: property "product" found on object expected in prototype chain
+PASS Navigator interface: window.navigator must inherit property "appCodeName" with the proper type (0) 
+PASS Navigator interface: window.navigator must inherit property "appName" with the proper type (1) 
+PASS Navigator interface: window.navigator must inherit property "appVersion" with the proper type (2) 
+PASS Navigator interface: window.navigator must inherit property "platform" with the proper type (3) 
+PASS Navigator interface: window.navigator must inherit property "product" with the proper type (4) 
 FAIL Navigator interface: window.navigator must inherit property "taintEnabled" with the proper type (5) assert_inherits: property "taintEnabled" not found in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "userAgent" with the proper type (6) assert_inherits: property "userAgent" found on object expected in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "language" with the proper type (7) assert_inherits: property "language" found on object expected in prototype chain
+PASS Navigator interface: window.navigator must inherit property "userAgent" with the proper type (6) 
+PASS Navigator interface: window.navigator must inherit property "language" with the proper type (7) 
 FAIL Navigator interface: window.navigator must inherit property "languages" with the proper type (8) assert_inherits: property "languages" not found in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "onLine" with the proper type (9) assert_inherits: property "onLine" found on object expected in prototype chain
+PASS Navigator interface: window.navigator must inherit property "onLine" with the proper type (9) 
 FAIL Navigator interface: window.navigator must inherit property "registerProtocolHandler" with the proper type (10) assert_inherits: property "registerProtocolHandler" not found in prototype chain
 FAIL Navigator interface: calling registerProtocolHandler(DOMString,DOMString,DOMString) on window.navigator with too few arguments must throw TypeError assert_inherits: property "registerProtocolHandler" not found in prototype chain
 FAIL Navigator interface: window.navigator must inherit property "registerContentHandler" with the proper type (11) assert_inherits: property "registerContentHandler" not found in prototype chain
@@ -4321,10 +4321,10 @@
 FAIL Navigator interface: calling unregisterProtocolHandler(DOMString,DOMString) on window.navigator with too few arguments must throw TypeError assert_inherits: property "unregisterProtocolHandler" not found in prototype chain
 FAIL Navigator interface: window.navigator must inherit property "unregisterContentHandler" with the proper type (15) assert_inherits: property "unregisterContentHandler" not found in prototype chain
 FAIL Navigator interface: calling unregisterContentHandler(DOMString,DOMString) on window.navigator with too few arguments must throw TypeError assert_inherits: property "unregisterContentHandler" not found in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "cookieEnabled" with the proper type (16) assert_inherits: property "cookieEnabled" found on object expected in prototype chain
+PASS Navigator interface: window.navigator must inherit property "cookieEnabled" with the proper type (16) 
 FAIL Navigator interface: window.navigator must inherit property "yieldForStorageUpdates" with the proper type (17) assert_inherits: property "yieldForStorageUpdates" not found in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "plugins" with the proper type (18) assert_inherits: property "plugins" found on object expected in prototype chain
-FAIL Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type (19) assert_inherits: property "mimeTypes" found on object expected in prototype chain
+PASS Navigator interface: window.navigator must inherit property "plugins" with the proper type (18) 
+PASS Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type (19) 
 FAIL Navigator interface: window.navigator must inherit property "javaEnabled" with the proper type (20) assert_equals: expected "boolean" but got "function"
 PASS PluginArray interface: existence and properties of interface object 
 PASS PluginArray interface object length 

Modified: trunk/LayoutTests/js/dom/delete-syntax-expected.txt (196672 => 196673)


--- trunk/LayoutTests/js/dom/delete-syntax-expected.txt	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/js/dom/delete-syntax-expected.txt	2016-02-17 01:11:29 UTC (rev 196673)
@@ -30,32 +30,32 @@
 PASS RegExp.prototype.exec is undefined
 PASS RegExp.prototype.test is null
 PASS Object.getOwnPropertyNames(Object.prototype).indexOf('__defineSetter__') is -1
-PASS navigatorPropertyNames.indexOf('appName') != -1 is true
-PASS navigatorPropertyNames.indexOf('appVersion') != -1 is true
-PASS navigatorPropertyNames.indexOf('language') != -1 is true
-PASS navigatorPropertyNames.indexOf('userAgent') != -1 is true
-PASS navigatorPropertyNames.indexOf('platform') != -1 is true
-PASS navigatorPropertyNames.indexOf('plugins') != -1 is true
-PASS navigatorPropertyNames.indexOf('mimeTypes') != -1 is true
-PASS navigatorPropertyNames.indexOf('product') != -1 is true
-PASS navigatorPropertyNames.indexOf('productSub') != -1 is true
-PASS navigatorPropertyNames.indexOf('vendor') != -1 is true
-PASS navigatorPropertyNames.indexOf('vendorSub') != -1 is true
-PASS navigatorPropertyNames.indexOf('cookieEnabled') != -1 is true
-PASS navigatorPropertyNames.indexOf('onLine') != -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('appName') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('appVersion') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('language') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('userAgent') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('platform') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('plugins') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('mimeTypes') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('product') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('productSub') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('vendor') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('vendorSub') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('cookieEnabled') == -1 is true
-PASS navigatorPrototypePropertyNames.indexOf('onLine') == -1 is true
+PASS navigatorPropertyNames.indexOf('appName') == -1 is true
+PASS navigatorPropertyNames.indexOf('appVersion') == -1 is true
+PASS navigatorPropertyNames.indexOf('language') == -1 is true
+PASS navigatorPropertyNames.indexOf('userAgent') == -1 is true
+PASS navigatorPropertyNames.indexOf('platform') == -1 is true
+PASS navigatorPropertyNames.indexOf('plugins') == -1 is true
+PASS navigatorPropertyNames.indexOf('mimeTypes') == -1 is true
+PASS navigatorPropertyNames.indexOf('product') == -1 is true
+PASS navigatorPropertyNames.indexOf('productSub') == -1 is true
+PASS navigatorPropertyNames.indexOf('vendor') == -1 is true
+PASS navigatorPropertyNames.indexOf('vendorSub') == -1 is true
+PASS navigatorPropertyNames.indexOf('cookieEnabled') == -1 is true
+PASS navigatorPropertyNames.indexOf('onLine') == -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('appName') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('appVersion') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('language') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('userAgent') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('platform') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('plugins') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('mimeTypes') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('product') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('productSub') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('vendor') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('vendorSub') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('cookieEnabled') != -1 is true
+PASS navigatorPrototypePropertyNames.indexOf('onLine') != -1 is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/js/dom/script-tests/delete-syntax.js (196672 => 196673)


--- trunk/LayoutTests/js/dom/script-tests/delete-syntax.js	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/js/dom/script-tests/delete-syntax.js	2016-02-17 01:11:29 UTC (rev 196673)
@@ -91,7 +91,7 @@
 ];
 
 for (var i = 0; i < expectedPropertyNames.length; ++i)
-    shouldBeTrue("navigatorPropertyNames.indexOf('" + expectedPropertyNames[i] +"') != -1");
+    shouldBeTrue("navigatorPropertyNames.indexOf('" + expectedPropertyNames[i] +"') == -1");
 var navigatorPrototypePropertyNames = Object.getOwnPropertyNames(navigator.__proto__);
 for (var i = 0; i < expectedPropertyNames.length; ++i)
-    shouldBeTrue("navigatorPrototypePropertyNames.indexOf('" + expectedPropertyNames[i] +"') == -1");
+    shouldBeTrue("navigatorPrototypePropertyNames.indexOf('" + expectedPropertyNames[i] +"') != -1");

Deleted: trunk/LayoutTests/js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js (196672 => 196673)


--- trunk/LayoutTests/js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js	2016-02-17 01:11:29 UTC (rev 196673)
@@ -1,17 +0,0 @@
-'use strict';
-
-description("Tests that we don't throw a type error in strict mode when assigning to an instance attribute that shadows navigator.geolocation. See <a href=''>https://bugs.webkit.org/show_bug.cgi?id=133559</a>");
-
-function createObjectWithPrototype(prototype)
-{
-    function F() {};
-    F.prototype = prototype;
-    return new F();
-}
-
-var myNavigator = createObjectWithPrototype(window.navigator)
-shouldBe("myNavigator.geolocation", "navigator.geolocation");
-shouldNotThrow("myNavigator.geolocation = 1");
-shouldBe("myNavigator.geolocation", "navigator.geolocation");
-
-window.jsTestIsAsync = false;

Deleted: trunk/LayoutTests/js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt (196672 => 196673)


--- trunk/LayoutTests/js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt	2016-02-17 01:11:29 UTC (rev 196673)
@@ -1,15 +0,0 @@
-CONSOLE MESSAGE: line 218: Deprecated attempt to access property 'geolocation' on a non-Navigator object.
-CONSOLE MESSAGE: line 588: Deprecated attempt to set property 'geolocation' on a non-Navigator object.
-CONSOLE MESSAGE: line 218: Deprecated attempt to access property 'geolocation' on a non-Navigator object.
-Tests that we don't throw a type error in strict mode when assigning to an instance attribute that shadows navigator.geolocation. See https://bugs.webkit.org/show_bug.cgi?id=133559
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS myNavigator.geolocation is navigator.geolocation
-PASS myNavigator.geolocation = 1 did not throw exception.
-PASS myNavigator.geolocation is navigator.geolocation
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html (196672 => 196673)


--- trunk/LayoutTests/js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/LayoutTests/js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html	2016-02-17 01:11:29 UTC (rev 196673)
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<script src=""
-<script src=""
-</body>
-</html>

Added: trunk/LayoutTests/js/navigator-set-geolocation-expected.txt (0 => 196673)


--- trunk/LayoutTests/js/navigator-set-geolocation-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/navigator-set-geolocation-expected.txt	2016-02-17 01:11:29 UTC (rev 196673)
@@ -0,0 +1,15 @@
+Tests that navigator.geolocation cannot be shadowed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+* Strict mode
+PASS navigator.geolocation = 1 threw exception TypeError: Attempted to assign to readonly property..
+PASS navigator.geolocation is not 1
+* Non-Strict mode
+PASS navigator.geolocation = 1 did not throw exception.
+PASS navigator.geolocation is not 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/navigator-set-geolocation.html (0 => 196673)


--- trunk/LayoutTests/js/navigator-set-geolocation.html	                        (rev 0)
+++ trunk/LayoutTests/js/navigator-set-geolocation.html	2016-02-17 01:11:29 UTC (rev 196673)
@@ -0,0 +1,29 @@
+<script src=""
+<script>
+description("Tests that navigator.geolocation cannot be shadowed.");
+
+function testInStrictMode()
+{
+    "use strict";
+    try {
+        navigator.geolocation = 1;
+        testFailed("navigator.geolocation = 1 did not throw exception.");
+    } catch (e) {
+        testPassed("navigator.geolocation = 1 threw exception " + e + ".");
+    }
+    shouldNotBe("navigator.geolocation", "1");
+}
+
+function testInNonStrictMode()
+{
+    shouldNotThrow("navigator.geolocation = 1");
+    shouldNotBe("navigator.geolocation", "1");
+}
+
+debug("* Strict mode");
+testInStrictMode();
+
+debug ("* Non-Strict mode");
+testInNonStrictMode();
+</script>
+<script src=""

Modified: trunk/Source/WebCore/ChangeLog (196672 => 196673)


--- trunk/Source/WebCore/ChangeLog	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/Source/WebCore/ChangeLog	2016-02-17 01:11:29 UTC (rev 196673)
@@ -1,3 +1,27 @@
+2016-02-16  Chris Dumez  <[email protected]>
+
+        Navigator.geolocation should not be marked a [Replaceable] and should be on the prototype
+        https://bugs.webkit.org/show_bug.cgi?id=154304
+        <rdar://problem/24685092>
+
+        Reviewed by Gavin Barraclough.
+
+        1. Drop the [Replaceable] IDL extended attribute for navigator.geolocation
+           as this does not match other browsers or the specification:
+           - https://dev.w3.org/geo/api/spec-source.html#geolocation_interface
+        2. Move Navigator attributes to the prototype, where they should be as
+           per the Web IDL specification.
+
+        The previous behavior was meant as a workaround for a bug in the Amazon
+        iOS app (rdar://problem/16332749). However, I have confirmed that the
+        latest Amazon App no longer has any issue with those changes.
+
+        Test: js/navigator-set-geolocation.html
+
+        * Modules/geolocation/NavigatorGeolocation.idl:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (InterfaceRequiresAttributesOnInstanceForCompatibility): Deleted.
+
 2016-02-16  Said Abou-Hallawa  <[email protected]>
 
         REGRESSION(r196268): WTFCrashWithSecurityImplication on SVG path animation tests

Modified: trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.idl (196672 => 196673)


--- trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.idl	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.idl	2016-02-17 01:11:29 UTC (rev 196673)
@@ -20,8 +20,6 @@
 [
     Conditional=GEOLOCATION,
 ] partial interface Navigator {
-    // FIXME: We should consider making this attribute replaceable only to the
-    // Amazon app on iOS.
-    [Replaceable] readonly attribute Geolocation geolocation;
+    readonly attribute Geolocation geolocation;
 };
 

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (196672 => 196673)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-02-17 00:45:51 UTC (rev 196672)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-02-17 01:11:29 UTC (rev 196673)
@@ -656,7 +656,6 @@
 
     # Needed for compatibility with existing content
     return 1 if $interfaceName =~ "Touch";
-    return 1 if $interfaceName =~ "Navigator";
     return 1 if $interfaceName =~ "ClientRect";
 
     return 0;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to