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

Unified Diff: chrome/browser/resources/settings/settings_page/main_page_behavior.js

Issue 2041083002: MD Settings: Workaround for section expand/collapse animation jank. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix scroll position Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/settings_page/main_page_behavior.js
diff --git a/chrome/browser/resources/settings/settings_page/main_page_behavior.js b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
index 40ae26314a4eaff26c424edffea3472ced143d19..f1760c340f48d263b99b3c668c49c5165b03eab8 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -360,7 +360,10 @@ var RoutableBehaviorImpl = {
return;
}
- element.scrollIntoView();
+ // TODO(michaelpg): due to the workaround for crbug.com/617827 in
+ // settings_page_css.html, we have to use element.offsetTop instead of
+ // relying on element.scrollIntoView() so the margin is included.
+ host.scroller.scrollTop = element.offsetTop;
}.bind(this));
},

Powered by Google App Engine
This is Rietveld 408576698