Bug 170087 - REGRESSION (r214014): media/restore-from-page-cache.html causes NoEventDispatchAssertion::isEventAllowedInMainThread() assertion failure
Summary: REGRESSION (r214014): media/restore-from-page-cache.html causes NoEventDispat...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar, Regression
Depends on: 169703
Blocks:
  Show dependency treegraph
 
Reported: 2017-03-24 16:56 PDT by Daniel Bates
Modified: 2017-03-24 18:21 PDT (History)
8 users (show)

See Also:


Attachments
Patch (7.53 KB, patch)
2017-03-24 17:47 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch (11.34 KB, patch)
2017-03-24 18:09 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2017-03-24 16:56:20 PDT
The test media/restore-from-page-cache.html dispatches a non-bubbling, non-cancelable DOM resize event when the page is being restored from the page cache. Following <https://trac.webkit.org/changeset/214014> (bug #169703) we assert that DOM events should not be dispatched when a page is being restored from the page cache.

[[
ASSERTION FAILED: NoEventDispatchAssertion::isEventAllowedInMainThread()
/Volumes/Data/slave/sierra-debug/build/Source/WebCore/dom/EventDispatcher.cpp(131) : bool WebCore::EventDispatcher::dispatchEvent(WebCore::Node &, WebCore::Event &)
1   0x11076682d WTFCrash
2   0x110766849 WTFCrashWithSecurityImplication
3   0x1188d7ef4 WebCore::EventDispatcher::dispatchEvent(WebCore::Node&, WebCore::Event&)
4   0x119fdda1d WebCore::Node::dispatchEvent(WebCore::Event&)
5   0x118d59d75 WebCore::HTMLMediaElement::layoutSizeChanged()::$_2::operator()() const
6   0x118d59b39 WTF::Function<void ()>::CallableWrapper<WebCore::HTMLMediaElement::layoutSizeChanged()::$_2>::call()
7   0x11805679e WTF::Function<void ()>::operator()() const
8   0x118b152b6 WebCore::FrameView::flushPostLayoutTasksQueue()
9   0x118b028a5 WebCore::FrameView::performPostLayoutTasks()
10  0x118b0939d WebCore::FrameView::layout(bool)
11  0x118b12a2a WebCore::FrameView::updateContentsSize()
12  0x1182413a0 WebCore::CachedPage::restore(WebCore::Page&)
13  0x118ad6683 WebCore::FrameLoader::commitProvisionalLoad()
14  0x118adc0f5 WebCore::FrameLoader::loadProvisionalItemFromCachedPage()
15  0x118ad44a6 WebCore::FrameLoader::continueLoadAfterNavigationPolicy(WebCore::ResourceRequest const&, WebCore::FormState*, bool, WebCore::AllowNavigationToInvalidURL)
16  0x118aeb338 WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WebCore::FormState*, WebCore::AllowNavigationToInvalidURL)::$_4::operator()(WebCore::ResourceRequest const&, WebCore::FormState*, bool) const
17  0x118aeb2da void std::__1::__invoke_void_return_wrapper<void>::__call<WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WebCore::FormState*, WebCore::AllowNavigationToInvalidURL)::$_4&, WebCore::ResourceRequest const&, WebCore::FormState*, bool>(WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WebCore::FormState*, WebCore::AllowNavigationToInvalidURL)::$_4&&&, WebCore::ResourceRequest const&&&, WebCore::FormState*&&, bool&&)
18  0x118aeb219 std::__1::__function::__func<WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WebCore::FormState*, WebCore::AllowNavigationToInvalidURL)::$_4, std::__1::allocator<WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WebCore::FormState*, WebCore::AllowNavigationToInvalidURL)::$_4>, void (WebCore::ResourceRequest const&, WebCore::FormState*, bool)>::operator()(WebCore::ResourceRequest const&, WebCore::FormState*&&, bool&&)
19  0x11a0f21fa std::__1::function<void (WebCore::ResourceRequest const&, WebCore::FormState*, bool)>::operator()(WebCore::ResourceRequest const&, WebCore::FormState*, bool) const
20  0x11a0f20bb WebCore::PolicyCallback::call(bool)
21  0x11a0f3388 WebCore::PolicyChecker::continueAfterNavigationPolicy(WebCore::PolicyAction)
22  0x11a0f705e WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, bool, WebCore::DocumentLoader*, WebCore::FormState*, std::__1::function<void (WebCore::ResourceRequest const&, WebCore::FormState*, bool)>)::$_1::operator()(WebCore::PolicyAction) const
23  0x11a0f702f void std::__1::__invoke_void_return_wrapper<void>::__call<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, bool, WebCore::DocumentLoader*, WebCore::FormState*, std::__1::function<void (WebCore::ResourceRequest const&, WebCore::FormState*, bool)>)::$_1&, WebCore::PolicyAction>(WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, bool, WebCore::DocumentLoader*, WebCore::FormState*, std::__1::function<void (WebCore::ResourceRequest const&, WebCore::FormState*, bool)>)::$_1&&&, WebCore::PolicyAction&&)
24  0x11a0f6fb9 std::__1::__function::__func<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, bool, WebCore::DocumentLoader*, WebCore::FormState*, std::__1::function<void (WebCore::ResourceRequest const&, WebCore::FormState*, bool)>)::$_1, std::__1::allocator<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, bool, WebCore::DocumentLoader*, WebCore::FormState*, std::__1::function<void (WebCore::ResourceRequest const&, WebCore::FormState*, bool)>)::$_1>, void (WebCore::PolicyAction)>::operator()(WebCore::PolicyAction&&)
25  0x122c9f12c std::__1::function<void (WebCore::PolicyAction)>::operator()(WebCore::PolicyAction) const
26  0x122ca75a0 -[WebFramePolicyListener receivedPolicyDecision:]
27  0x122ca777d -[WebFramePolicyListener use]
28  0x10ea675da -[DefaultPolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]
29  0x7fffcfc5a6dc __invoking___
30  0x7fffcfc5a561 -[NSInvocation invoke]
31  0x7fffcfc73736 -[NSInvocation invokeWithTarget:]
]]
<https://build.webkit.org/results/Apple%20Sierra%20Debug%20WK1%20(Tests)/r214369%20(166)/media/restore-from-page-cache-crash-log.txt>
Comment 1 Daniel Bates 2017-03-24 17:47:28 PDT
Created attachment 305344 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2017-03-24 17:56:59 PDT
<rdar://problem/31254822>
Comment 3 Daniel Bates 2017-03-24 18:09:01 PDT
Created attachment 305349 [details]
Patch

Update patch to rename Document::enqueue{Pageshow, Popstate}Event() to dispatch{Pageshow, Popstate}Event(), respectively, to better reflect their purpose.
Comment 4 Daniel Bates 2017-03-24 18:13:27 PDT
Comment on attachment 305349 [details]
Patch

Clearing flags on attachment: 305349

Committed r214392: <http://trac.webkit.org/changeset/214392>
Comment 5 Daniel Bates 2017-03-24 18:13:30 PDT
All reviewed patches have been landed.  Closing bug.