Make crossOriginObject.then undefined for promises
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Oct 2018 16:10:52 +0000 (16:10 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Oct 2018 16:10:52 +0000 (16:10 +0000)
commit26afa1188662562e789c50d5571e3c0e5fc1b28e
treeb2ab169a3858d1616d8e1537df7e61b71a5f3ee3
parent61c29ae1cf7f279ee54bff821f8652e6d3f9bbd6
Make crossOriginObject.then undefined for promises
https://bugs.webkit.org/show_bug.cgi?id=190094

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT test now that more checks are passing.

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

Source/WebCore:

Make crossOriginObject.then undefined for promises. This allows promises to work better with cross-origin WindowProxy
and Location objects.

Specification:
- https://github.com/whatwg/html/pull/3242
- https://github.com/whatwg/dom/issues/536

This aligns our behavior with Blink and Gecko.

No new tests, rebaselined existing test.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::addCrossOriginWindowOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::addCrossOriginLocationOwnPropertyNames):

LayoutTests:

Update existing tests to reflect behavior change.

* http/tests/navigation/process-swap-window-open-expected.txt:
* http/tests/navigation/process-swap-window-open.html:
* http/wpt/cross-origin-window-policy/resources/utils.js:
(testCrossOriginOption):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/navigation/process-swap-window-open-expected.txt
LayoutTests/http/tests/navigation/process-swap-window-open.html
LayoutTests/http/tests/security/cross-frame-access-enumeration.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.h
Source/WebCore/bindings/js/JSLocationCustom.cpp
Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp