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

Issue 2182283003: MD Settings: Flush templates in settings-main before checking (Closed)

Created:
4 years, 4 months ago by michaelpg
Modified:
4 years, 4 months ago
Reviewers:
tommycli, Dan Beam
CC:
chromium-reviews, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, dbeam+watch-settings_chromium.org, stevenjb+watch-md-settings_chromium.org, arv+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@UpdateMocha
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: Flush templates in settings-main before checking An odd interleaving of async calls can cause dom-ifs not to be updated yet in a function scheduled by async(). This causes expected elements to not exist at the moment we look for them, even though the properties are correct. TBR=tommycli@chromium.org BUG=631891, 593989 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/7f2d9d4a9232dc7062689261a40a76e577d80a25 Cr-Commit-Position: refs/heads/master@{#408074}

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M chrome/browser/resources/settings/settings_main/settings_main.js View 2 chunks +4 lines, -1 line 4 comments Download

Messages

Total messages: 18 (10 generated)
michaelpg
TBR'ing and attempting CQ to unblock other work.
4 years, 4 months ago (2016-07-27 07:52:45 UTC) #8
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/2182283003/1
4 years, 4 months ago (2016-07-27 07:52:49 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 4 months ago (2016-07-27 07:56:09 UTC) #11
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/7f2d9d4a9232dc7062689261a40a76e577d80a25 Cr-Commit-Position: refs/heads/master@{#408074}
4 years, 4 months ago (2016-07-27 07:58:55 UTC) #13
Dan Beam
https://codereview.chromium.org/2182283003/diff/1/chrome/browser/resources/settings/settings_main/settings_main.js File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2182283003/diff/1/chrome/browser/resources/settings/settings_main/settings_main.js#newcode154 chrome/browser/resources/settings/settings_main/settings_main.js:154: Polymer.dom.flush(); :_(
4 years, 4 months ago (2016-07-29 00:11:45 UTC) #14
michaelpg
https://codereview.chromium.org/2182283003/diff/1/chrome/browser/resources/settings/settings_main/settings_main.js File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2182283003/diff/1/chrome/browser/resources/settings/settings_main/settings_main.js#newcode154 chrome/browser/resources/settings/settings_main/settings_main.js:154: Polymer.dom.flush(); On 2016/07/29 00:11:45, Dan Beam wrote: > :_( ...
4 years, 4 months ago (2016-07-29 17:27:15 UTC) #15
Dan Beam
https://codereview.chromium.org/2182283003/diff/1/chrome/browser/resources/settings/settings_main/settings_main.js File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2182283003/diff/1/chrome/browser/resources/settings/settings_main/settings_main.js#newcode154 chrome/browser/resources/settings/settings_main/settings_main.js:154: Polymer.dom.flush(); On 2016/07/29 17:27:15, michaelpg wrote: > On 2016/07/29 ...
4 years, 4 months ago (2016-07-29 18:28:40 UTC) #17
Dan Beam
4 years, 4 months ago (2016-07-29 18:28:55 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/2182283003/diff/1/chrome/browser/resources/se...
File chrome/browser/resources/settings/settings_main/settings_main.js (right):

https://codereview.chromium.org/2182283003/diff/1/chrome/browser/resources/se...
chrome/browser/resources/settings/settings_main/settings_main.js:154:
Polymer.dom.flush();
On 2016/07/29 18:28:39, Dan Beam wrote:
> On 2016/07/29 17:27:15, michaelpg wrote:
> > On 2016/07/29 00:11:45, Dan Beam wrote:
> > > :_(
> > 
> > there was a ton of discussion about this, but we can talk about it in the
> > stand-up if you like
> > 
> > but, some fun facts:
> > 
> > * "Insert, append, and remove operations are transacted lazily in certain
> cases
> > for performance. In order to interrogate the DOM (for example, offsetHeight,
> > getComputedStyle, etc.) immediately after one of these operations, call
> > Polymer.dom.flush() first"
> > 
> > * "It should be used sparingly as calling it frequently can negatively
impact
> > performance since work is often deferred for efficiency. Calling
> > `Polymer.dom.flush()` is useful, for example, when an element has to measure
> > itself and is unsure about the state of its internal or compoased DOM."
> > 
> > * dom-if has a render() function..... which just calls Polymer.dom.flush()
> 
> I didn't say it was wrong, I just said I was said to see it

I was just sad** to see it

Powered by Google App Engine
This is Rietveld 408576698