Bug 204397

Summary: MicrotaskQueue should be accessed via EventLoop
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, dbates, esprehn+autocc, ews-watchlist, ggaren, gyuyoung.kim, hi, Hironori.Fujii, joepeck, kangil.han, koivisto, sam, webkit-bug-importer, wenson_hsieh, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=204395
Bug Depends on:    
Bug Blocks: 204042    
Attachments:
Description Flags
Refactoring koivisto: review+

Description Ryosuke Niwa 2019-11-19 23:05:37 PST
In order to integrate MicrotaskQueue, refactor the existing code to always access it via EventLoop.
Comment 1 Ryosuke Niwa 2019-11-19 23:31:23 PST
Created attachment 383948 [details]
Refactoring
Comment 2 Radar WebKit Bug Importer 2019-11-19 23:33:46 PST
<rdar://problem/57351294>
Comment 3 Ryosuke Niwa 2019-11-19 23:45:25 PST
Once this patch is landed, there are a few bugs to fix:
 - MutationObserver's compound microtask queue must be per similar origin windows; i.e. per event loop. This should let us remove the hack we added in https://trac.webkit.org/r247222.
 - Custom Element's backup queue must be per micro per similar origin windows; i.e. per event loop. This will be observable via editing commands issued across sites.
 - EventLoopTaskQueue::queueMicrotaskCallback should automatically suspend or stop microtasks if the associated script execution context is suspend or stopped like regular EventLoopTasks. This will let us remove ActiveDOMCallbackMicrotask.
Comment 4 Antti Koivisto 2019-11-20 01:39:53 PST
Comment on attachment 383948 [details]
Refactoring

View in context: https://bugs.webkit.org/attachment.cgi?id=383948&action=review

> Source/WebCore/dom/MutationObserver.cpp:163
> +// This state must be per event loop.
> +static bool mutationObserverCompoundMicrotaskQueuedFlag = false;

I suppose this is a FIXME.

> Source/WebCore/dom/WindowEventLoop.cpp:78
> +    // MicrotaskQueue must be one per event loop.

FIXME
Comment 5 Ryosuke Niwa 2019-11-20 17:47:58 PST
Committed r252723: <https://trac.webkit.org/changeset/252723>
Comment 6 Fujii Hironori 2019-11-20 19:34:45 PST
Filed: Bug 204437 – [MSVC] error C2039: 'weakPtrFactory': is not a member of 'WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>'