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

Issue 2815623005: MD Settings: in cr_dialog, prevent intersectionObserver from firing early. (Closed)

Created:
3 years, 8 months ago by scottchen
Modified:
3 years, 7 months ago
Reviewers:
dpapad
CC:
chromium-reviews, dbeam+watch-elements_chromium.org, michaelpg+watch-elements_chromium.org, oshima+watch_chromium.org, stevenjb+watch-md-settings_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: in cr_dialog, prevent intersectionObserver from firing early. Currently the intersectionObesrver's handler gets triggered twice as cr-dialog renders, reporting that it's intersecting with topMarker even though scrollTop is 0. Delaying adding the observer until next render loop fixes the issue. BUG=710355 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2815623005 Cr-Commit-Position: refs/heads/master@{#464617} Committed: https://chromium.googlesource.com/chromium/src/+/fb69cfff512407b7d1e412a4a0ef71d9019daa8d

Patch Set 1 #

Total comments: 5

Patch Set 2 : check .isAttached and move intersectionObserver code to a method #

Patch Set 3 : add/remove intersection listener by observing dialog.open changes #

Patch Set 4 : add test #

Total comments: 2

Patch Set 5 : use mutationObserver to not mess with native dialog.open #

Total comments: 8

Patch Set 6 : updates based on comments #

Total comments: 2

Patch Set 7 : reduce indentation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -29 lines) Patch
M chrome/test/data/webui/cr_elements/cr_dialog_test.js View 1 2 3 4 5 1 chunk +23 lines, -0 lines 0 comments Download
M ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js View 1 2 3 4 5 6 2 chunks +61 lines, -29 lines 0 comments Download

Messages

Total messages: 38 (21 generated)
scottchen
Currently the intersectionObesrver's handler gets triggered twice as cr-dialog renders, reporting that it's intersecting with ...
3 years, 8 months ago (2017-04-12 00:58:18 UTC) #2
scottchen
3 years, 8 months ago (2017-04-12 00:58:47 UTC) #5
scottchen
3 years, 8 months ago (2017-04-12 00:58:49 UTC) #6
dpapad
https://codereview.chromium.org/2815623005/diff/1/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js File ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js (right): https://codereview.chromium.org/2815623005/diff/1/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js#newcode94 ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js:94: Polymer.RenderStatus.afterNextRender(this, function() { Should we be calling observe() in ...
3 years, 8 months ago (2017-04-12 01:05:51 UTC) #9
Dan Beam
https://codereview.chromium.org/2815623005/diff/1/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js File ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js (right): https://codereview.chromium.org/2815623005/diff/1/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js#newcode94 ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js:94: Polymer.RenderStatus.afterNextRender(this, function() { On 2017/04/12 01:05:51, dpapad wrote: > ...
3 years, 8 months ago (2017-04-12 01:07:13 UTC) #10
Dan Beam
https://codereview.chromium.org/2815623005/diff/1/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js File ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js (right): https://codereview.chromium.org/2815623005/diff/1/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js#newcode86 ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js:86: this.intersectionObserver_ = new IntersectionObserver( note: you might want to ...
3 years, 8 months ago (2017-04-12 01:09:44 UTC) #11
scottchen
https://codereview.chromium.org/2815623005/diff/1/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js File ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js (right): https://codereview.chromium.org/2815623005/diff/1/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js#newcode86 ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js:86: this.intersectionObserver_ = new IntersectionObserver( On 2017/04/12 01:09:43, Dan Beam ...
3 years, 8 months ago (2017-04-12 01:43:05 UTC) #14
dpapad
I am a little concerned that we are addressing the problem at the wrong layer. ...
3 years, 8 months ago (2017-04-12 17:25:17 UTC) #17
scottchen
On 2017/04/12 17:25:17, dpapad wrote: > I am a little concerned that we are addressing ...
3 years, 8 months ago (2017-04-12 23:51:05 UTC) #18
dpapad
I see some test failures. Will take another look after they've been fixed (assuming they ...
3 years, 8 months ago (2017-04-13 01:12:12 UTC) #23
scottchen
https://codereview.chromium.org/2815623005/diff/60001/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js File ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js (right): https://codereview.chromium.org/2815623005/diff/60001/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js#newcode48 ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js:48: observers: ['onOpenChanged_(open)'], On 2017/04/13 01:12:12, dpapad wrote: > You ...
3 years, 8 months ago (2017-04-13 20:17:51 UTC) #26
dpapad
Almost LG, see question below. https://codereview.chromium.org/2815623005/diff/80001/chrome/test/data/webui/cr_elements/cr_dialog_test.js File chrome/test/data/webui/cr_elements/cr_dialog_test.js (right): https://codereview.chromium.org/2815623005/diff/80001/chrome/test/data/webui/cr_elements/cr_dialog_test.js#newcode157 chrome/test/data/webui/cr_elements/cr_dialog_test.js:157: var dialog = document.body.querySelector('dialog'); ...
3 years, 8 months ago (2017-04-13 20:31:40 UTC) #27
scottchen
https://codereview.chromium.org/2815623005/diff/80001/chrome/test/data/webui/cr_elements/cr_dialog_test.js File chrome/test/data/webui/cr_elements/cr_dialog_test.js (right): https://codereview.chromium.org/2815623005/diff/80001/chrome/test/data/webui/cr_elements/cr_dialog_test.js#newcode157 chrome/test/data/webui/cr_elements/cr_dialog_test.js:157: var dialog = document.body.querySelector('dialog'); On 2017/04/13 20:31:39, dpapad wrote: ...
3 years, 8 months ago (2017-04-13 21:46:04 UTC) #30
dpapad
LGTM https://codereview.chromium.org/2815623005/diff/100001/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js File ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js (right): https://codereview.chromium.org/2815623005/diff/100001/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js#newcode95 ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js:95: addIntersectionObserver_: function() { Nit: You can reduce indentation ...
3 years, 8 months ago (2017-04-13 22:02:03 UTC) #31
scottchen
https://codereview.chromium.org/2815623005/diff/100001/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js File ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js (right): https://codereview.chromium.org/2815623005/diff/100001/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js#newcode95 ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js:95: addIntersectionObserver_: function() { On 2017/04/13 22:02:03, dpapad wrote: > ...
3 years, 8 months ago (2017-04-13 22:33:29 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2815623005/120001
3 years, 8 months ago (2017-04-13 22:34:56 UTC) #35
commit-bot: I haz the power
3 years, 8 months ago (2017-04-14 00:08:58 UTC) #38
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/fb69cfff512407b7d1e412a4a0ef...

Powered by Google App Engine
This is Rietveld 408576698