Changeset 243661 in webkit


Ignore:
Timestamp:
Mar 29, 2019 1:46:57 PM (5 years ago)
Author:
Chris Dumez
Message:

Set window.closed immediately when close() is invoked
https://bugs.webkit.org/show_bug.cgi?id=195409

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

  • web-platform-tests/html/browsers/the-window-object/close-method.window-expected.txt:
  • web-platform-tests/html/browsers/the-window-object/closed-attribute.window-expected.txt:

Source/WebCore:

Window.closed should return true if it is closing:

Window.close() sets the 'is closing' flag to true synchronously, as per:

No new tests, rebaselined existing tests.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::closed const):

Location:
trunk
Files:
6 edited

Legend:

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

    r243646 r243661  
     12019-03-29  Chris Dumez  <cdumez@apple.com>
     2
     3        Set window.closed immediately when close() is invoked
     4        https://bugs.webkit.org/show_bug.cgi?id=195409
     5
     6        Reviewed by Alex Christensen.
     7
     8        Rebaseline WPT tests now that more checks are passing.
     9
     10        * web-platform-tests/html/browsers/the-window-object/close-method.window-expected.txt:
     11        * web-platform-tests/html/browsers/the-window-object/closed-attribute.window-expected.txt:
     12
    1132019-03-29  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/close-method.window-expected.txt

    r243634 r243661  
    11
    2 FAIL window.close() queues a task to discard, but window.closed knows immediately assert_equals: expected true but got false
    3 FAIL window.close() affects name targeting immediately assert_equals: expected true but got false
     2PASS window.close() queues a task to discard, but window.closed knows immediately
     3PASS window.close() affects name targeting immediately
    44
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/closed-attribute.window-expected.txt

    r243634 r243661  
    33
    44PASS closed and same-origin nested browsing context
    5 FAIL closed/close() and same-origin auxiliary browsing context assert_equals: expected true but got false
     5PASS closed/close() and same-origin auxiliary browsing context
    66TIMEOUT closed and cross-origin nested browsing context Test timed out
    77TIMEOUT closed/close() and cross-origin auxiliary browsing context Test timed out
  • trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/self-et-al.window-expected.txt

    r243634 r243661  
    11
    22FAIL iframeWindow.frames before and after removal assert_equals: frames got cleared after browsing context removal expected object "[object Window]" but got null
    3 FAIL popupWindow.frames before, after closing, and after discarding assert_true: expected true got false
     3FAIL popupWindow.frames before, after closing, and after discarding assert_equals: frames got cleared after browsing context removal expected object "[object Window]" but got null
    44PASS iframeWindow.globalThis before and after removal
    5 FAIL popupWindow.globalThis before, after closing, and after discarding assert_true: expected true got false
     5PASS popupWindow.globalThis before, after closing, and after discarding
    66FAIL iframeWindow.self before and after removal assert_equals: self got cleared after browsing context removal expected object "[object Window]" but got null
    7 FAIL popupWindow.self before, after closing, and after discarding assert_true: expected true got false
     7FAIL popupWindow.self before, after closing, and after discarding assert_equals: self got cleared after browsing context removal expected object "[object Window]" but got null
    88FAIL iframeWindow.window before and after removal assert_equals: window got cleared after browsing context removal expected object "[object Window]" but got null
    9 FAIL popupWindow.window before, after closing, and after discarding assert_true: expected true got false
     9FAIL popupWindow.window before, after closing, and after discarding assert_equals: window got cleared after browsing context removal expected object "[object Window]" but got null
    1010
  • trunk/Source/WebCore/ChangeLog

    r243660 r243661  
     12019-03-29  Chris Dumez  <cdumez@apple.com>
     2
     3        Set window.closed immediately when close() is invoked
     4        https://bugs.webkit.org/show_bug.cgi?id=195409
     5
     6        Reviewed by Alex Christensen.
     7
     8        Window.closed should return true if it is closing:
     9        - https://html.spec.whatwg.org/#dom-window-closed
     10
     11        Window.close() sets the 'is closing' flag to true synchronously, as per:
     12        - https://html.spec.whatwg.org/#dom-window-close (step 3.1)
     13
     14        No new tests, rebaselined existing tests.
     15
     16        * page/DOMWindow.cpp:
     17        (WebCore::DOMWindow::closed const):
     18
    1192019-03-29  Zalan Bujtas  <zalan@apple.com>
    220
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r243319 r243661  
    13151315bool DOMWindow::closed() const
    13161316{
    1317     return !frame();
     1317    auto* frame = this->frame();
     1318    if (!frame)
     1319        return true;
     1320
     1321    auto* page = frame->page();
     1322    return !page || page->isClosing();
    13181323}
    13191324
Note: See TracChangeset for help on using the changeset viewer.