|
|
Created:
4 years, 4 months ago by michaelpg Modified:
4 years, 4 months ago Reviewers:
dschuyler 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@RefactorMainPageBehavior2 Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMD Settings: Never underscroll
Changing the overscroll amount can force the page to scroll unexpectedly.
Never change the overscroll to less than the current visible overscroll.
R=dschuyler@chromium.org
BUG=634582
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/59ce449c58b384906bcd2c0c66826c6ce69ad047
Cr-Commit-Position: refs/heads/master@{#413058}
Patch Set 1 #
Total comments: 8
Patch Set 2 : comments #Patch Set 3 : rebase #Patch Set 4 : changes #Patch Set 5 : rebase #
Total comments: 2
Patch Set 6 : distance #Patch Set 7 : rebase #Messages
Total messages: 25 (12 generated)
Description was changed from ========== MD Settings: Never underscroll Changing the overscroll amount can force the page to scroll unexpectedly. Never change the overscroll to less than the current visible overscroll. R=dschuyler@chromium.org BUG=none ========== to ========== MD Settings: Never underscroll Changing the overscroll amount can force the page to scroll unexpectedly. Never change the overscroll to less than the current visible overscroll. R=dschuyler@chromium.org BUG=none CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
Description was changed from ========== MD Settings: Never underscroll Changing the overscroll amount can force the page to scroll unexpectedly. Never change the overscroll to less than the current visible overscroll. R=dschuyler@chromium.org BUG=none CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== MD Settings: Never underscroll Changing the overscroll amount can force the page to scroll unexpectedly. Never change the overscroll to less than the current visible overscroll. R=dschuyler@chromium.org BUG=634582 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
PTAL. This is soooo much simpler than the event-based freeze/unfreeze/recalc logic I had played with earlier.
lgtm Nice!
dbeam@chromium.org changed reviewers: + dbeam@chromium.org
https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_main/settings_main.js:96: * @param {number=} minHeight The minimum overscroll height needed. opt_minHeight https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_main/settings_main.js:108: this.overscroll_ = Math.max(opt_minHeight, visibleOverscroll); nit: opt_minHeight || 0 https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_main/settings_main.js:186: return Math.max(0, this.parentNode.scrollHeight - heightOfShownSections); so can we simplify any of this yet?
https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_main/settings_main.js:96: * @param {number=} minHeight The minimum overscroll height needed. On 2016/08/09 23:26:40, Dan Beam wrote: > opt_minHeight Done. https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_main/settings_main.js:108: this.overscroll_ = Math.max(opt_minHeight, visibleOverscroll); On 2016/08/09 23:26:40, Dan Beam wrote: > nit: opt_minHeight || 0 Done. https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_main/settings_main.js:186: return Math.max(0, this.parentNode.scrollHeight - heightOfShownSections); On 2016/08/09 23:26:40, Dan Beam wrote: > so can we simplify any of this yet? dschuyler? I think this is still necessary to *grow* the overscroll. We could move the max(0, *) to setOverscroll_ but I don't mind it here.
https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_main/settings_main.js:186: return Math.max(0, this.parentNode.scrollHeight - heightOfShownSections); On 2016/08/09 23:46:09, michaelpg wrote: > On 2016/08/09 23:26:40, Dan Beam wrote: > > so can we simplify any of this yet? > > dschuyler? I think this is still necessary to *grow* the overscroll. We could > move the max(0, *) to setOverscroll_ but I don't mind it here. I think that something called overscrollHeight_ should return a value >= 0. Maybe some blank lines would help the readability? Or maybe the comments are making it look 'heavy', maybe 'lighten' it with something like: var heightOfShownSections = this.$.overscroll.offsetTop - topSection.offsetParent.offsetTop - topSection.offsetTop; return Math.max(0, this.parentNode.scrollHeight - heightOfShownSections); ?
CL grew, but the net is unchanged. Fixed a couple bugs and converted (this.parentNode) and (this.parentNode.scroller) to this.offsetParent which works in tests. https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2228783005/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_main/settings_main.js:186: return Math.max(0, this.parentNode.scrollHeight - heightOfShownSections); On 2016/08/10 00:06:26, dschuyler wrote: > On 2016/08/09 23:46:09, michaelpg wrote: > > On 2016/08/09 23:26:40, Dan Beam wrote: > > > so can we simplify any of this yet? > > > > dschuyler? I think this is still necessary to *grow* the overscroll. We could > > move the max(0, *) to setOverscroll_ but I don't mind it here. > > I think that something called overscrollHeight_ should > return a value >= 0. Ack (unchanged) > > > Maybe some blank lines would help the readability? > > > Or maybe the comments are making it look 'heavy', maybe 'lighten' > it with something like: > > var heightOfShownSections = this.$.overscroll.offsetTop - > topSection.offsetParent.offsetTop - topSection.offsetTop; > > return Math.max(0, this.parentNode.scrollHeight - heightOfShownSections); > > ? Did some things: * s/topSection/section * s/heightOfShownSections/distanceToBottom * s/scrollHeight/clientHeight (they're the same; we want the client height, anyway) * offshored the settings-section querySelector to the pages, which already have that method
PTAL: I had to deal with closure stuff, so I moved the new stuff to a precursor CL and rebased.
https://codereview.chromium.org/2228783005/diff/80001/chrome/browser/resource... File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2228783005/diff/80001/chrome/browser/resource... chrome/browser/resources/settings/settings_main/settings_main.js:181: var distanceToBottom = this.$.overscroll.offsetTop - sectionTop; Let's make this just 'distance' rather than distanceToBottom.
dbeam@chromium.org changed reviewers: - dbeam@chromium.org
https://codereview.chromium.org/2228783005/diff/80001/chrome/browser/resource... File chrome/browser/resources/settings/settings_main/settings_main.js (right): https://codereview.chromium.org/2228783005/diff/80001/chrome/browser/resource... chrome/browser/resources/settings/settings_main/settings_main.js:181: var distanceToBottom = this.$.overscroll.offsetTop - sectionTop; On 2016/08/10 17:00:16, dschuyler wrote: > Let's make this just 'distance' rather than distanceToBottom. Done.
The CQ bit was checked by michaelpg@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
The CQ bit was checked by michaelpg@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from dschuyler@chromium.org Link to the patchset: https://codereview.chromium.org/2228783005/#ps120001 (title: "rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== MD Settings: Never underscroll Changing the overscroll amount can force the page to scroll unexpectedly. Never change the overscroll to less than the current visible overscroll. R=dschuyler@chromium.org BUG=634582 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== MD Settings: Never underscroll Changing the overscroll amount can force the page to scroll unexpectedly. Never change the overscroll to less than the current visible overscroll. R=dschuyler@chromium.org BUG=634582 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ==========
Message was sent while issue was closed.
Committed patchset #7 (id:120001)
Message was sent while issue was closed.
Description was changed from ========== MD Settings: Never underscroll Changing the overscroll amount can force the page to scroll unexpectedly. Never change the overscroll to less than the current visible overscroll. R=dschuyler@chromium.org BUG=634582 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation ========== to ========== MD Settings: Never underscroll Changing the overscroll amount can force the page to scroll unexpectedly. Never change the overscroll to less than the current visible overscroll. R=dschuyler@chromium.org BUG=634582 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/59ce449c58b384906bcd2c0c66826c6ce69ad047 Cr-Commit-Position: refs/heads/master@{#413058} ==========
Message was sent while issue was closed.
Patchset 7 (id:??) landed as https://crrev.com/59ce449c58b384906bcd2c0c66826c6ce69ad047 Cr-Commit-Position: refs/heads/master@{#413058} |