Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Locat...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2017 23:50:39 +0000 (23:50 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Feb 2017 23:50:39 +0000 (23:50 +0000)
commit1d475f09dea513a2228dd6e782442c2b90edaf80
tree17aded51dfdf9b6fdca4e70b890c26777202ba30
parent8d2ab5591f19a1b39661c76cc8aaea05eedd5c2b
Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects
https://bugs.webkit.org/show_bug.cgi?id=167647
<rdar://problem/30339489>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline web platform test now that more checks are passing.

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

Source/WebCore:

Align [[OwnPropertyKeys]] with the HTML specification for cross-origin Window / Location objects:
- https://html.spec.whatwg.org/#windowproxy-ownpropertykeys [1]
- https://html.spec.whatwg.org/#crossoriginownpropertykeys-(-o-) [2]
- https://html.spec.whatwg.org/#crossoriginproperties-(-o-) [3]

In particular, the following changes were made:
- Location:
  - We now return the following symbols as well: @@toStringTag, @@hasInstance,
    @@isConcatSpreadable as per [2].
- Window:
  - We now return the following symbols as well: @@toStringTag, @@hasInstance,
    @@isConcatSpreadable as per [2].
  - We now return the indices of the child browsing contexts as per [1].
  - We now return the names of the child browsing contexts as per [3].

No new tests, updated / rebaselined existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
Index properties should be configurable as per:
- https://html.spec.whatwg.org/#windowproxy-getownproperty (step 2.5)

(WebCore::inScope):
(WebCore::addScopedChildrenNames):
(WebCore::addCrossOriginPropertyNames):
(WebCore::addScopedChildrenIndexes):
(WebCore::addCrossOriginOwnPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::addCrossOriginPropertyNames):
(WebCore::addCrossOriginOwnPropertyNames):
(WebCore::JSLocation::getOwnPropertyNames):

LayoutTests:

Extend test coverage for [[OwnPropertyKeys]] for cross-origin Window / Location objects.

* http/tests/security/cross-frame-access-enumeration-expected.txt:
* http/tests/security/cross-frame-access-enumeration.html:
* http/tests/security/resources/cross-frame-iframe-for-enumeration-test.html:
* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/security/cross-frame-access-enumeration-expected.txt
LayoutTests/http/tests/security/cross-frame-access-enumeration.html
LayoutTests/http/tests/security/resources/cross-frame-iframe-for-enumeration-test.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt
LayoutTests/js/dom/getOwnPropertyDescriptor-expected.txt
LayoutTests/js/resources/getOwnPropertyDescriptor.js
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSLocationCustom.cpp