Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Issue 214383008: Rework MediaQueryMatcher to batch up listener notification (Closed)

Created:
6 years, 8 months ago by esprehn
Modified:
6 years, 5 months ago
CC:
blink-reviews, kenneth.christiansen, sof, eae+blinkwatch, ed+blinkwatch_opera.com, dglazkov+blink, apavlov+blink_chromium.org, adamk+blink_chromium.org, darktears, rune+blink, Inactive, rwlbuis
Visibility:
Public.

Description

Rework 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -121 lines) Patch
M Source/core/css/MediaQueryList.h View 1 chunk +13 lines, -7 lines 0 comments Download
M Source/core/css/MediaQueryList.cpp View 3 chunks +34 lines, -25 lines 0 comments Download
M Source/core/css/MediaQueryListListener.h View 2 chunks +8 lines, -1 line 0 comments Download
M Source/core/css/MediaQueryListListener.cpp View 2 chunks +5 lines, -2 lines 0 comments Download
M Source/core/css/MediaQueryMatcher.h View 1 chunk +14 lines, -28 lines 0 comments Download
M Source/core/css/MediaQueryMatcher.cpp View 4 chunks +40 lines, -55 lines 1 comment Download
M Source/core/dom/Document.cpp View 3 chunks +3 lines, -3 lines 2 comments Download

Messages

Total messages: 10 (0 generated)
esprehn
It occurred to me after I made this patch that we only have _two_ tests ...
6 years, 8 months ago (2014-04-03 21:42:33 UTC) #1
kenneth.r.christiansen
https://codereview.chromium.org/214383008/diff/1/Source/core/css/MediaQueryMatcher.cpp File Source/core/css/MediaQueryMatcher.cpp (right): https://codereview.chromium.org/214383008/diff/1/Source/core/css/MediaQueryMatcher.cpp#newcode134 Source/core/css/MediaQueryMatcher.cpp:134: (*it)->mediaChanged(toNotify); couldn't the name be made more clear to ...
6 years, 8 months ago (2014-04-03 21:54:14 UTC) #2
eseidel
Yoav is mr. MediaQueries these days. Looks like this CL may be dead anyway. (if ...
6 years, 6 months ago (2014-05-28 22:31:21 UTC) #3
esprehn
On 2014/05/28 22:31:21, eseidel wrote: > Yoav is mr. MediaQueries these days. Looks like this ...
6 years, 6 months ago (2014-05-28 23:43:52 UTC) #4
Yoav Weiss
On 2014/05/28 23:43:52, esprehn wrote: > On 2014/05/28 22:31:21, eseidel wrote: > > Yoav is ...
6 years, 6 months ago (2014-06-08 19:39:10 UTC) #5
rune
On 2014/06/08 19:39:10, Yoav Weiss wrote: > As mentioned on #blink, the Opera test suite ...
6 years, 6 months ago (2014-06-09 20:47:39 UTC) #6
rune
https://codereview.chromium.org/214383008/diff/1/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/214383008/diff/1/Source/core/dom/Document.cpp#newcode3328 Source/core/dom/Document.cpp:3328: m_mediaQueryMatcher->mediaChanged(); On 2014/04/03 21:54:15, kenneth.r.christiansen wrote: > handleMediaChanged? actually ...
6 years, 6 months ago (2014-06-10 06:17:07 UTC) #7
kenneth.r.christiansen
Are you moving forward with this patch?
6 years, 6 months ago (2014-06-17 12:19:40 UTC) #8
esprehn
On 2014/06/17 at 12:19:40, kenneth.r.christiansen wrote: > Are you moving forward with this patch? I'd ...
6 years, 6 months ago (2014-06-18 05:53:16 UTC) #9
cbiesinger
6 years, 6 months ago (2014-06-26 04:05:13 UTC) #10
I took over this CL and uploaded a new version to
https://codereview.chromium.org/348893004

Powered by Google App Engine
This is Rietveld 408576698