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

Issue 1806133002: IntersectionObserver: use an idle callback to send notifications. (Closed)

Created:
4 years, 9 months ago by szager1
Modified:
4 years, 8 months ago
Reviewers:
haraken, esprehn, sof, ojan
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

IntersectionObserver: use an idle callback to send notifications. Re-landing after original: https://codereview.chromium.org/1780163002/ ... was reverted by: https://codereview.chromium.org/1776493002/ With this change, the tests can no longer use setTimeout(0) to wait for notifications to be delivered. Instead, use takeRecords() to proactively grab notifications right after they are generated (typically in a RAF right after a layout change). These tests tickle a bug in ScriptedIdleTaskController, hence the LeakExpectations entries. BUG=540528 R=ojan@chromium.org,haraken@chromium.org,sigbjornf@opera.com Committed: https://crrev.com/4cf47cb23a655b02d36e64ea3f986ff2900f5bdd Cr-Commit-Position: refs/heads/master@{#385021}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Use requestIdleCallback(finishJSTest, {timeout:100}) in tests. #

Patch Set 3 : typo #

Total comments: 2

Patch Set 4 : Added TODO about remove requestIdleCallback hack #

Patch Set 5 : Don't pause at end of tests #

Patch Set 6 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+828 lines, -699 lines) Patch
M third_party/WebKit/LayoutTests/LeakExpectations View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html View 1 2 3 4 1 chunk +6 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/cross-origin-subframe.html View 1 chunk +35 lines, -41 lines 0 comments Download
A third_party/WebKit/LayoutTests/intersection-observer/README View 1 2 3 4 1 chunk +78 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/containing-block.html View 1 2 3 4 1 chunk +67 lines, -69 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/iframe-no-root.html View 1 2 3 4 1 chunk +61 lines, -66 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/iframe-no-root-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds.html View 1 2 3 4 1 chunk +179 lines, -171 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/multiple-thresholds-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/observer-without-js-reference.html View 1 2 3 4 1 chunk +24 lines, -15 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/root-margin.html View 1 2 3 4 1 chunk +71 lines, -70 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/root-margin-expected.txt View 1 chunk +6 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/same-document-no-root.html View 1 2 3 4 1 chunk +56 lines, -57 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/same-document-root.html View 1 2 3 4 1 chunk +92 lines, -89 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/same-document-root-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/same-document-zero-size-target.html View 1 2 3 4 5 1 chunk +56 lines, -58 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/same-document-zero-size-target-expected.txt View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/timestamp.html View 1 2 3 4 3 chunks +40 lines, -34 lines 0 comments Download
M third_party/WebKit/LayoutTests/intersection-observer/timestamp-expected.txt View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IdleRequestCallback.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IntersectionObserverController.h View 1 2 3 4 5 3 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/dom/IntersectionObserverController.cpp View 4 chunks +27 lines, -14 lines 0 comments Download

Messages

Total messages: 40 (9 generated)
szager1
4 years, 9 months ago (2016-03-16 21:53:21 UTC) #3
sof
Thanks for determining the underlying leak condition. https://codereview.chromium.org/1806133002/diff/1/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html File third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html (right): https://codereview.chromium.org/1806133002/diff/1/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html#newcode57 third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html:57: setTimeout(finishJSTest, 150); ...
4 years, 9 months ago (2016-03-17 07:14:58 UTC) #4
haraken
core/ LGTM
4 years, 9 months ago (2016-03-17 10:10:53 UTC) #5
szager1
https://codereview.chromium.org/1806133002/diff/1/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html File third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html (right): https://codereview.chromium.org/1806133002/diff/1/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html#newcode57 third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html:57: setTimeout(finishJSTest, 150); On 2016/03/17 07:14:58, sof wrote: > Do ...
4 years, 9 months ago (2016-03-17 17:43:22 UTC) #6
esprehn
I don't think we can do this, you can have tests with 150ms waits in ...
4 years, 9 months ago (2016-03-17 17:45:58 UTC) #7
esprehn
On 2016/03/17 at 17:45:58, esprehn wrote: > I don't think we can do this, you ...
4 years, 9 months ago (2016-03-17 17:46:14 UTC) #8
ojan
https://codereview.chromium.org/1806133002/diff/1/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html File third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html (right): https://codereview.chromium.org/1806133002/diff/1/third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html#newcode57 third_party/WebKit/LayoutTests/http/tests/intersection-observer/iframe-cross-origin.html:57: setTimeout(finishJSTest, 150); On 2016/03/17 at 17:43:22, szager1 wrote: > ...
4 years, 9 months ago (2016-03-17 17:48:03 UTC) #9
szager1
I switched the tests to use: requestIdleCallback(finishJSTest, {timeout:100}) I also added an explanation to the ...
4 years, 9 months ago (2016-03-17 20:05:24 UTC) #10
szager1
ping
4 years, 9 months ago (2016-03-21 18:14:51 UTC) #11
ojan
lgtm https://codereview.chromium.org/1806133002/diff/40001/third_party/WebKit/LayoutTests/intersection-observer/README File third_party/WebKit/LayoutTests/intersection-observer/README (right): https://codereview.chromium.org/1806133002/diff/40001/third_party/WebKit/LayoutTests/intersection-observer/README#newcode43 third_party/WebKit/LayoutTests/intersection-observer/README:43: crbug.com/595155 explains that when one of those tasks ...
4 years, 9 months ago (2016-03-21 18:19:39 UTC) #12
esprehn
We should put this test in the virtual test suite where idle callbacks actually run. ...
4 years, 9 months ago (2016-03-21 18:27:03 UTC) #13
esprehn
We should put this test in the virtual test suite where idle callbacks actually run. ...
4 years, 9 months ago (2016-03-21 18:27:04 UTC) #14
szager1
https://codereview.chromium.org/1806133002/diff/40001/third_party/WebKit/LayoutTests/intersection-observer/README File third_party/WebKit/LayoutTests/intersection-observer/README (right): https://codereview.chromium.org/1806133002/diff/40001/third_party/WebKit/LayoutTests/intersection-observer/README#newcode43 third_party/WebKit/LayoutTests/intersection-observer/README:43: crbug.com/595155 explains that when one of those tasks runs, ...
4 years, 9 months ago (2016-03-21 18:27:49 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1806133002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1806133002/60001
4 years, 9 months ago (2016-03-21 18:28:36 UTC) #18
szager1
On 2016/03/21 18:27:04, esprehn wrote: > We should put this test in the virtual test ...
4 years, 9 months ago (2016-03-21 18:29:53 UTC) #20
szager1
On 2016/03/21 18:27:04, esprehn wrote: > We should put this test in the virtual test ...
4 years, 9 months ago (2016-03-21 18:30:39 UTC) #21
ojan
On 2016/03/21 at 18:30:39, szager wrote: > On 2016/03/21 18:27:04, esprehn wrote: > > We ...
4 years, 9 months ago (2016-03-22 01:13:51 UTC) #22
szager1
On 2016/03/22 01:13:51, ojan wrote: > On 2016/03/21 at 18:30:39, szager wrote: > > On ...
4 years, 9 months ago (2016-03-25 09:12:28 UTC) #23
szager1
On 2016/03/25 09:12:28, szager1 wrote: > On 2016/03/22 01:13:51, ojan wrote: > > On 2016/03/21 ...
4 years, 9 months ago (2016-03-25 09:22:22 UTC) #24
szager1
PTAL Note that there are still two slow tests: - timestamp.html, because it needs to ...
4 years, 9 months ago (2016-03-25 09:46:15 UTC) #25
esprehn
In general I'm a bit worried that so many of the tests use takeRecords() and ...
4 years, 9 months ago (2016-03-25 10:10:37 UTC) #26
szager1
On 2016/03/25 10:10:37, esprehn wrote: > In general I'm a bit worried that so many ...
4 years, 9 months ago (2016-03-25 14:32:36 UTC) #27
szager1
On 2016/03/25 14:32:36, szager1 wrote: > On 2016/03/25 10:10:37, esprehn wrote: > > In general ...
4 years, 9 months ago (2016-03-25 14:43:19 UTC) #28
szager1
On 2016/03/25 14:32:36, szager1 wrote: > On 2016/03/25 10:10:37, esprehn wrote: > > In general ...
4 years, 9 months ago (2016-03-25 14:45:31 UTC) #29
esprehn
On 2016/03/25 at 14:45:31, szager wrote: > On 2016/03/25 14:32:36, szager1 wrote: > > On ...
4 years, 9 months ago (2016-03-25 20:12:43 UTC) #30
eae
On 2016/03/25 20:12:43, esprehn wrote: > On 2016/03/25 at 14:45:31, szager wrote: > > On ...
4 years, 8 months ago (2016-03-30 17:39:16 UTC) #31
eae
Elliott?
4 years, 8 months ago (2016-04-01 00:28:50 UTC) #32
esprehn
On 2016/04/01 at 00:28:50, eae wrote: > Elliott? I think we should move forward here. ...
4 years, 8 months ago (2016-04-01 00:31:51 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1806133002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1806133002/100001
4 years, 8 months ago (2016-04-04 18:35:27 UTC) #36
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 8 months ago (2016-04-04 21:53:52 UTC) #38
commit-bot: I haz the power
4 years, 8 months ago (2016-04-04 21:55:42 UTC) #40
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/4cf47cb23a655b02d36e64ea3f986ff2900f5bdd
Cr-Commit-Position: refs/heads/master@{#385021}

Powered by Google App Engine
This is Rietveld 408576698