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

Issue 2039603002: MD Settings: Fix scroll to section (Closed)

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

Description

MD Settings: Fix scroll to section Scrolling to sections broke in crrev.com/2018753002 with errors about host being undefined. The host is just "this", anyway. BUG=569761 R=dpapad@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation

Patch Set 1 #

Patch Set 2 : test coverage #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -3 lines) Patch
M chrome/browser/resources/settings/settings_page/main_page_behavior.js View 2 chunks +2 lines, -2 lines 3 comments Download
M chrome/chrome_tests.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/webui/settings/navigation_browsertest.js View 1 1 chunk +36 lines, -0 lines 2 comments Download
A chrome/test/data/webui/settings/navigation_tests.js View 1 1 chunk +40 lines, -0 lines 4 comments Download
M chrome/test/data/webui/settings/settings_menu_test.js View 1 1 chunk +13 lines, -1 line 0 comments Download

Messages

Total messages: 19 (6 generated)
michaelpg
PTAL.
4 years, 6 months ago (2016-06-03 22:25:08 UTC) #2
dpapad
LGTM, with some questions. Should probably CC @dschuyler, since he is more familiar with navigation. ...
4 years, 6 months ago (2016-06-03 22:59:50 UTC) #3
Dan Beam
sure does look like this conflicts with: https://codereview.chromium.org/2022893003/
4 years, 6 months ago (2016-06-03 23:02:20 UTC) #5
michaelpg
On 2016/06/03 23:02:20, Dan Beam wrote: > sure does look like this conflicts with: > ...
4 years, 6 months ago (2016-06-03 23:28:51 UTC) #6
michaelpg
https://codereview.chromium.org/2039603002/diff/20001/chrome/test/data/webui/settings/navigation_browsertest.js File chrome/test/data/webui/settings/navigation_browsertest.js (right): https://codereview.chromium.org/2039603002/diff/20001/chrome/test/data/webui/settings/navigation_browsertest.js#newcode20 chrome/test/data/webui/settings/navigation_browsertest.js:20: 'navigation_tests.js', On 2016/06/03 22:59:50, dpapad wrote: > Can we ...
4 years, 6 months ago (2016-06-03 23:31:58 UTC) #7
dschuyler
https://codereview.chromium.org/2039603002/diff/20001/chrome/test/data/webui/settings/navigation_tests.js File chrome/test/data/webui/settings/navigation_tests.js (right): https://codereview.chromium.org/2039603002/diff/20001/chrome/test/data/webui/settings/navigation_tests.js#newcode15 chrome/test/data/webui/settings/navigation_tests.js:15: menu = document.querySelector('* /deep/ settings-menu'); Can we avoid this ...
4 years, 6 months ago (2016-06-06 21:57:48 UTC) #9
michaelpg
https://codereview.chromium.org/2039603002/diff/20001/chrome/test/data/webui/settings/navigation_tests.js File chrome/test/data/webui/settings/navigation_tests.js (right): https://codereview.chromium.org/2039603002/diff/20001/chrome/test/data/webui/settings/navigation_tests.js#newcode15 chrome/test/data/webui/settings/navigation_tests.js:15: menu = document.querySelector('* /deep/ settings-menu'); On 2016/06/06 21:57:48, dschuyler ...
4 years, 6 months ago (2016-06-06 22:16:48 UTC) #10
dschuyler
It looks like the unit test here may superseed the unit test in basic_page_browsertest.js that ...
4 years, 6 months ago (2016-06-06 23:51:43 UTC) #11
dschuyler
On 2016/06/06 23:51:43, dschuyler wrote: > It looks like the unit test here may superseed ...
4 years, 6 months ago (2016-06-06 23:52:14 UTC) #12
michaelpg
https://codereview.chromium.org/2039603002/diff/20001/chrome/browser/resources/settings/settings_page/main_page_behavior.js File chrome/browser/resources/settings/settings_page/main_page_behavior.js (right): https://codereview.chromium.org/2039603002/diff/20001/chrome/browser/resources/settings/settings_page/main_page_behavior.js#newcode383 chrome/browser/resources/settings/settings_page/main_page_behavior.js:383: } else if (newRoute && newRoute.section && !oldRouteIsSubpage) { ...
4 years, 6 months ago (2016-06-07 02:55:05 UTC) #13
michaelpg
On 2016/06/06 at 23:51:43, dschuyler wrote: > It looks like the unit test here may ...
4 years, 6 months ago (2016-06-07 02:55:56 UTC) #14
dschuyler
LGTM with a new bug entry and a comment (see comments). If ya decide to ...
4 years, 6 months ago (2016-06-08 00:35:06 UTC) #15
michaelpg
4 years, 6 months ago (2016-06-08 00:36:21 UTC) #16
On 2016/06/08 00:35:06, dschuyler wrote:
> LGTM with a new bug entry and a comment
> (see comments).
> 
> If ya decide to rework the logic in the
> current route handler, I'd like to re-review
> that.
> 
> (Either way is cool with me).
> 
>
https://codereview.chromium.org/2039603002/diff/20001/chrome/browser/resource...
> File chrome/browser/resources/settings/settings_page/main_page_behavior.js
> (right):
> 
>
https://codereview.chromium.org/2039603002/diff/20001/chrome/browser/resource...
> chrome/browser/resources/settings/settings_page/main_page_behavior.js:383: }
> else if (newRoute && newRoute.section && !oldRouteIsSubpage) {
> On 2016/06/07 02:55:05, michaelpg wrote:
> > On 2016/06/06 at 23:51:42, dschuyler wrote:
> > > What is this addition addressing?
> > 
> > Warning: wall of text that I'm publishing for my notes, probably not worth
> > reading because implementing the very last line may nullify everything else.
> > 
> > here, oldRouteIsSubpage implies newRouteIsSubpage which implies
> newRoute.section
> > == oldRoute.section
> > 
> > so: old route and new route are both subpages within the same section, so it
> > does NOT make sense to change the scroll position (ie, we shouldn't[1]
change
> > the scroll position of the page from whatever it was before entering the
first
> > subpage).
> > 
> > [1] it doesn't actually, because of implementation details elsewhere, so
this
> is
> > just preventative (and a very minor optimization) rather than a bug fix.
> > 
> > Equivalently, we shouldn't scroll to the section when showing a subpage
> > (!oldRouteIsSubpage also implies !newRouteIsSubpage due to 378-379). We may
> want
> > to add this behavior, but we should do it at line 380 where it belongs.
> > 
> > However, there's another fix we need: 377 should also scroll to the section
IF
> > we got here by clicking a menu entry, or a link to some other section, but
NOT
> > if we used the back button or just hit the back arrow in the subpage...
crap.
> 
> That's a lot of indirect logic for folks following along at home, please
> consider one of the following:
> - rework the logic flow here (lines 374 to 385) to make it easier to follow
> - or add a bug with your notes above and comment around line 374 that this
logic
> should be reworked, referencing the new bug.

I told you not to read it ;-)

We'll revisit this issue one way or another. I don't see a need to land this CL
as is because yours already went in.

Powered by Google App Engine
This is Rietveld 408576698