Make someWindow.frames, .self, .window always return someWindow
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Mar 2019 00:21:31 +0000 (00:21 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Mar 2019 00:21:31 +0000 (00:21 +0000)
commit0c1cef4915383f66d1dc30f4f92ccd45083bb777
treebcf4272392b421f46725db1d2ce79e0a470d5dc2
parent757c346c4f17018fdd06c20c7ea384163a25beb6
Make someWindow.frames, .self, .window always return someWindow
https://bugs.webkit.org/show_bug.cgi?id=195406

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT test now that all its checks are passing.

* web-platform-tests/html/browsers/the-window-object/self-et-al.window-expected.txt:

Source/WebCore:

Make someWindow.frames, .self, .window always return someWindow. Previously, they
would return null when the window would lose its browsing context.

This aligns our behavior with Firefox and the HTML specification:
- https://github.com/whatwg/html/pull/4410

Chrome has also recently aligned with Firefox and the HTML specification here so
it makes sense for WebKit to follow.

No new tests, rebaselined existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::self const):
(WebCore::JSDOMWindow::window const):
(WebCore::JSDOMWindow::frames const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus):
* page/DOMWindow.h:
* page/DOMWindow.idl:

LayoutTests:

Update / rebaseline existing test to reflect behavior change.

* fast/frames/detached-frame-property-expected.txt:
* fast/frames/detached-frame-property.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/frames/detached-frame-property-expected.txt
LayoutTests/fast/frames/detached-frame-property.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/self-et-al.window-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/DOMWindow.h
Source/WebCore/page/DOMWindow.idl
Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp