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.
Created attachment 321121 [details] EWS trial run
<rdar://problem/34544900>
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.