Changeset 195628 in webkit


Ignore:
Timestamp:
Jan 26, 2016 3:22:18 PM (8 years ago)
Author:
Chris Dumez
Message:

document.open() / write() should be prevented in beforeunload event handlers
https://bugs.webkit.org/show_bug.cgi?id=153432

Reviewed by Ryosuke Niwa.

Source/WebCore:

document.open() / write() should be prevented in beforeunload event handlers:

Test: fast/frames/page-beforeunload-document-open.html

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::dispatchBeforeUnloadEvent):

LayoutTests:

Add a layout test to check that document.open() / write() is indeed
prevented inside 'beforeunload' event handlers.

  • fast/frames/page-beforeunload-document-open-expected.txt: Added.
  • fast/frames/page-beforeunload-document-open.html: Added.
  • fast/frames/resources/page-beforeunload-document-open-frame.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195627 r195628  
     12016-01-26  Chris Dumez  <cdumez@apple.com>
     2
     3        document.open() / write() should be prevented in beforeunload event handlers
     4        https://bugs.webkit.org/show_bug.cgi?id=153432
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Add a layout test to check that document.open() / write() is indeed
     9        prevented inside 'beforeunload' event handlers.
     10
     11        * fast/frames/page-beforeunload-document-open-expected.txt: Added.
     12        * fast/frames/page-beforeunload-document-open.html: Added.
     13        * fast/frames/resources/page-beforeunload-document-open-frame.html: Added.
     14
    1152016-01-26  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r195627 r195628  
     12016-01-26  Chris Dumez  <cdumez@apple.com>
     2
     3        document.open() / write() should be prevented in beforeunload event handlers
     4        https://bugs.webkit.org/show_bug.cgi?id=153432
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        document.open() / write() should be prevented in beforeunload event handlers:
     9        - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
     10        - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
     11        - https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
     12        - https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
     13
     14        Test: fast/frames/page-beforeunload-document-open.html
     15
     16        * loader/FrameLoader.cpp:
     17        (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
     18
    1192016-01-26  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r195605 r195628  
    29522952    {
    29532953        ForbidPromptsScope forbidPrompts(m_frame.page());
     2954        IgnoreOpensDuringUnloadCountIncrementer ignoreOpensDuringUnloadCountIncrementer(m_frame.document());
    29542955        domWindow->dispatchEvent(beforeUnloadEvent, domWindow->document());
    29552956    }
Note: See TracChangeset for help on using the changeset viewer.