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

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

Issue 1962943002: MD Settings: Fix minor vertical jumps in animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@AnimationFixes
Patch Set: Created 4 years, 7 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 1f8b2a87a9b6fd50fed541bd6d92b97cd4968f56..f0081d9ab69f1a478dff3be8632f11d0b9c586de 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -264,7 +264,6 @@ var MainPageBehaviorImpl = {
*/
playCollapseSection_: function(section) {
var card = section.$.card;
- var cardStyle = getComputedStyle(card);
this.style.margin = '';
section.$.header.hidden = false;
@@ -293,6 +292,11 @@ var MainPageBehaviorImpl = {
// but account for scroll.
var targetTop = card.getBoundingClientRect().top - this.scroller.scrollTop;
+ // Account for the section header.
+ targetTop += section.$.header.offsetHeight +
+ parseInt(getComputedStyle(section.$.header).marginBottom) +
dpapad 2016/05/09 23:35:53 Let's pass 10 as the 2nd parameter of parseInt(),
michaelpg 2016/05/10 00:36:18 Done.
+ parseInt(getComputedStyle(section.$.header).marginTop);
dpapad 2016/05/09 23:35:53 Guessing that getComputedStyles() calls are simply
michaelpg 2016/05/10 00:36:18 Done (i thought so but i can't verify it)
+
var keyframes = [{
top: startingTop + 'px',
minHeight: cardHeightStart + 'px',

Powered by Google App Engine
This is Rietveld 408576698