Changeset 169710 in webkit


Ignore:
Timestamp:
Jun 9, 2014 1:39:17 PM (10 years ago)
Author:
dbates@webkit.org
Message:

[iOS] Amazon app: Cannot interact with product page after tapping on product image
https://bugs.webkit.org/show_bug.cgi?id=133559
<rdar://problem/16332749>

Reviewed by Oliver Hunt.

Source/WebCore:
As a workaround for issues in the Amazon app, mark the attribute navigator.geolocation as
replaceable so that we don't throw a JavaScript type error when assigning to an instance
attribute that shadows it. At the time of writing the first such assignment to is ignored.
See <https://bugs.webkit.org/show_bug.cgi?id=133648> for more details.

When loading a product page in the Amazon app it overwrites the readonly property geolocation
on an object that extends the Navigator object. In strict mode, this operation is not honored
and is treated as a JavaScript type error, which stops JavaScript execution. Therefore, the
product page does not behave as intended. In contrast, this operation would not be honored in
non-strict mode and would not be treated as a JavaScript type error.

Test: js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html

  • Modules/geolocation/NavigatorGeolocation.idl:

LayoutTests:
Add a test to ensure that assigning to an instance attribute in strict mode that shadows
navigator.geolocation doesn't cause a JavaScript type error.

  • js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js: Added.

(createObjectWithPrototype.F):
(createObjectWithPrototype):

  • js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt: Added.
  • js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r169703 r169710  
     12014-06-09  Daniel Bates  <dabates@apple.com>
     2
     3        [iOS] Amazon app: Cannot interact with product page after tapping on product image
     4        https://bugs.webkit.org/show_bug.cgi?id=133559
     5        <rdar://problem/16332749>
     6
     7        Reviewed by Oliver Hunt.
     8
     9        Add a test to ensure that assigning to an instance attribute in strict mode that shadows
     10        navigator.geolocation doesn't cause a JavaScript type error.
     11
     12        * js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js: Added.
     13        (createObjectWithPrototype.F):
     14        (createObjectWithPrototype):
     15        * js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt: Added.
     16        * js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html: Added.
     17
    1182014-06-05  Mark Hahnenberg  <mhahnenberg@apple.com>
    219
  • trunk/Source/WebCore/ChangeLog

    r169709 r169710  
     12014-06-09  Daniel Bates  <dabates@apple.com>
     2
     3        [iOS] Amazon app: Cannot interact with product page after tapping on product image
     4        https://bugs.webkit.org/show_bug.cgi?id=133559
     5        <rdar://problem/16332749>
     6
     7        Reviewed by Oliver Hunt.
     8
     9        As a workaround for issues in the Amazon app, mark the attribute navigator.geolocation as
     10        replaceable so that we don't throw a JavaScript type error when assigning to an instance
     11        attribute that shadows it. At the time of writing the first such assignment to is ignored.
     12        See <https://bugs.webkit.org/show_bug.cgi?id=133648> for more details.
     13
     14        When loading a product page in the Amazon app it overwrites the readonly property geolocation
     15        on an object that extends the Navigator object. In strict mode, this operation is not honored
     16        and is treated as a JavaScript type error, which stops JavaScript execution. Therefore, the
     17        product page does not behave as intended. In contrast, this operation would not be honored in
     18        non-strict mode and would not be treated as a JavaScript type error.
     19
     20        Test: js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html
     21
     22        * Modules/geolocation/NavigatorGeolocation.idl:
     23
    1242014-06-09  Andreas Kling  <akling@apple.com>
    225
  • trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.idl

    r149170 r169710  
    2121    Conditional=GEOLOCATION,
    2222] partial interface Navigator {
    23     readonly attribute Geolocation geolocation;
     23    // FIXME: We should consider making this attribute replaceable only to the
     24    // Amazon app on iOS.
     25    [Replaceable] readonly attribute Geolocation geolocation;
    2426};
    2527
Note: See TracChangeset for help on using the changeset viewer.