Bug 177096 - Experiment with deferring MediaQueryListListener dispatch until the end of the current EventQueueScope
Summary: Experiment with deferring MediaQueryListListener dispatch until the end of th...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-18 12:42 PDT by Wenson Hsieh
Modified: 2018-09-19 21:21 PDT (History)
6 users (show)

See Also:


Attachments
EWS trial run (6.80 KB, patch)
2017-09-18 13:01 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2017-09-18 12:42:52 PDT
Experiment with deferring MediaQueryListListener dispatch until the end of the current EventQueueScope. While not ideal, this is a way to mitigate abuse of MediaQueryList.addEventListener in combination with Document.execCommand to cause various issues in editing code. This was the original motivation behind introducing scoped Events in the first place, but the existing mechanism to dispatch scoped events doesn't help us here, since MediaQueryList evaluation does not fire WebCore::Events.
Comment 1 Wenson Hsieh 2017-09-18 13:01:54 PDT
Created attachment 321121 [details]
EWS trial run
Comment 2 Radar WebKit Bug Importer 2017-09-20 02:40:29 PDT
<rdar://problem/34544900>
Comment 3 Ryosuke Niwa 2018-09-19 21:21:34 PDT
Comment on attachment 321121 [details]
EWS trial run

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

> Source/WebCore/css/MediaQueryMatcher.cpp:135
> -            listener.listener->handleEvent(listener.query);
> +            ScopedEventQueue::singleton().enqueueMediaQueryListener(WTFMove(listener.listener), WTFMove(listener.query));

We should try making this completely async.