ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will...
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Dec 2016 06:22:13 +0000 (06:22 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Dec 2016 06:22:13 +0000 (06:22 +0000)
commitf24fbc2cf99b82ca2bcf34a8500e85a091e7cb74
tree3ea64d20aa1c8774a1a1bfa23a6256f51b462ae8
parentb76d9ec43092b716809619e58729b14b9b7a8adf
ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will-fire-beforeload.html
https://bugs.webkit.org/show_bug.cgi?id=164883

Reviewed by Ryosuke Niwa.

Source/WebCore:

This is *attempt to fix* patch since I cannot reproduce the crash reported in this issue.
One possible scenario of this crash is the following.

1. There is pending deferred scripts, that is not fetched yet.
2. Then, we start watching on the script. And stop document parser.
3. The document parser is stopped/detached by calling finishJSTest in beforeload.
4. At this critical timing, (2)'s script is fetched, and notifyFinished is called since it is watched.

In this patch, we ignore the script execution if the document parser is stopped / detached.
Previously, it goes into the wrong path. And it causes assertion failure.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::notifyFinished):

LayoutTests:

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLDocumentParser.cpp