Changeset 206233 in webkit


Ignore:
Timestamp:
Sep 21, 2016 1:47:00 PM (8 years ago)
Author:
Chris Dumez
Message:

Fix enumeration of properties cross origin
https://bugs.webkit.org/show_bug.cgi?id=162328

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

  • web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:

Source/WebCore:

All cross origin properties for Window / Location are supposed to be not enumerable:

Therefore, there should be no properties to iterate on for cross origin Window /
Location objects.

No new tests, rebaselined existing test.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertyNames):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::JSLocation::getOwnPropertyNames):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r206221 r206233  
     12016-09-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix enumeration of properties cross origin
     4        https://bugs.webkit.org/show_bug.cgi?id=162328
     5
     6        Reviewed by Darin Adler.
     7
     8        Rebaseline W3C test now that one more check is passing.
     9
     10        * web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:
     11
    1122016-09-21  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt

    r206221 r206233  
    1212PASS [[Delete]] Should throw on cross-origin objects
    1313PASS [[DefineOwnProperty]] Should throw for cross-origin objects
    14 FAIL [[Enumerate]] should return an empty iterator assert_unreached: Shouldn't have been able to enumerate href on cross-origin Location Reached unreachable code
     14PASS [[Enumerate]] should return an empty iterator
    1515PASS [[OwnPropertyKeys]] should return all properties from cross-origin objects
    1616PASS A and B jointly observe the same identity for cross-origin Window and Location
  • trunk/Source/WebCore/ChangeLog

    r206231 r206233  
     12016-09-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Fix enumeration of properties cross origin
     4        https://bugs.webkit.org/show_bug.cgi?id=162328
     5
     6        Reviewed by Darin Adler.
     7
     8        All cross origin properties for Window / Location are supposed to be not enumerable:
     9        - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
     10
     11        Therefore, there should be no properties to iterate on for cross origin Window /
     12        Location objects.
     13
     14        No new tests, rebaselined existing test.
     15
     16        * bindings/js/JSDOMWindowCustom.cpp:
     17        (WebCore::JSDOMWindow::getOwnPropertyNames):
     18        * bindings/js/JSLocationCustom.cpp:
     19        (WebCore::JSLocation::getOwnPropertyNames):
     20
    1212016-09-21  Alex Christensen  <achristensen@webkit.org>
    222
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r206221 r206233  
    340340    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
    341341    if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObject->wrapped(), DoNotReportSecurityError)) {
    342         addCrossOriginWindowPropertyNames(*exec, propertyNames);
     342        if (mode.includeDontEnumProperties())
     343            addCrossOriginWindowPropertyNames(*exec, propertyNames);
    343344        return;
    344345    }
  • trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp

    r206221 r206233  
    129129    JSLocation* thisObject = jsCast<JSLocation*>(object);
    130130    if (!BindingSecurity::shouldAllowAccessToFrame(exec, thisObject->wrapped().frame(), DoNotReportSecurityError)) {
    131         addCrossOriginLocationPropertyNames(*exec, propertyNames);
     131        if (mode.includeDontEnumProperties())
     132            addCrossOriginLocationPropertyNames(*exec, propertyNames);
    132133        return;
    133134    }
Note: See TracChangeset for help on using the changeset viewer.