Document::resume should delay resetting of form control elements.
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2019 19:58:50 +0000 (19:58 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2019 19:58:50 +0000 (19:58 +0000)
commitda5a94f76369a16e8baea7e57d9f19a021f3c439
tree46770412da55a5eb1c94624bc7551846f1d8a29c
parent3dc4b153ba606dbd0e758592c3859daa98b7ff8e
Document::resume should delay resetting of form control elements.
https://bugs.webkit.org/show_bug.cgi?id=200376

Reviewed by Geoffrey Garen.

Source/WebCore:

Delay the execution of form control element resets until the next task
to avoid synchronously mutating DOM during page cache restoration.

Test: fast/frames/restoring-page-cache-should-not-run-scripts.html

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::resumeFromDocumentSuspension):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::resumeFromDocumentSuspension):

LayoutTests:

Added a regression test.

* fast/frames/restoring-page-cache-should-not-run-scripts-expected.txt: Added.
* fast/frames/restoring-page-cache-should-not-run-scripts.html: Added.
* platform/win/TestExpectations: Skip this test on Windows since navigating to blob fails on Windows.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/frames/restoring-page-cache-should-not-run-scripts-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/restoring-page-cache-should-not-run-scripts.html [new file with mode: 0644]
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLInputElement.cpp