DescriptionRework MediaQueryMatcher to batch up listener notification
MediaQueryMatcher currently runs script synchronously inside layout and
recalc style which is bad. Instead we should collect all the listeners
that have changed and notify them asynchronously. Incidentally this is
what the spec says to do too, and also what Firefox and the polyfills
do.
This is the first step where we collect all the listeners that changed
in a Vector and then notify them as a group. This also fixes our behavior
where adding a listener in the middle of notification would get that one
called too, which is not what the spec says.
This also changes the notification order such that listeners are notified
in groups based on the creation time of their MediaQueryList which also
matches Firefox (and the polyfill) instead of in the order of global
calls to addListener.
Patch Set 1 #
Total comments: 3
Messages
Total messages: 10 (0 generated)
|