[Webkit-unassigned] [Bug 133648] New: First assignment to [Replaceable] navigator.geolocation is ignored
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Jun 9 11:01:24 PDT 2014
https://bugs.webkit.org/show_bug.cgi?id=133648
Summary: First assignment to [Replaceable]
navigator.geolocation is ignored
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Bindings
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: dbates at webkit.org
CC: oliver at apple.com, mhahnenberg at apple.com
Attachment #232707 for bug #133559 marks attribute navigator.geolocation as [Replaceable]. As mentioned in bug #133559, comment 14, the tests included in this attachment don't pass "because the first assignment to an instance attribute called geolocation that shadows navigator.geolocation is ignored." Marking attribute navigator.geolocation as [Replaceable] should make it replaceable and hence the first assignment to an instance attribute that shadows navigator.geolocation should take effect.
You can observe this issue by following the steps in bug #133559, comment 15, reproduced here:
You can see this issue by applying the patch, attachment #232707, and [opening] the following URL in Safari linked against the built WebKit:
data:text/html,<script>'use strict'; var MyNavigator = function() {}; MyNavigator.prototype = window.navigator; var myNavigator = new MyNavigator(); myNavigator.geolocation = 1; alert(myNavigator.geolocation);</script>
Then the alert message text is "[object Geolocation]" (*). But should be "1". Modify the above URL to assign some arbitrary value to myNavigator.geolocation, say the string literal "dummy", before the statement that assigns 1 to it, such that it reads:
data:text/html,<script>'use strict'; var MyNavigator = function() {}; MyNavigator.prototype = window.navigator; var myNavigator = new MyNavigator(); myNavigator.geolocation = 'dummy'; myNavigator.geolocation = 1; alert(myNavigator.geolocation);</script>
Open this URL. Then the alert message reads "1" as expected.
(*) I noticed that executing a similar script directly in the Web Inspector console will cause the alert message text to read "1" as expected (why?).
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list