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

Unified Diff: chrome/browser/resources/options/options_page.js

Issue 68723003: Make chrome/ be documentElement/body agnostic with regards to scrollTop/Left (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_305800
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « chrome/browser/resources/ntp_android/ntp_android.js ('k') | chrome/browser/resources/uber/uber_utils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/options_page.js
diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js
index e837c2532440ad11e3a12e27257f9b3cc4c37b07..befb7c813981bc869dfda9aa7f179a426fd178f3 100644
--- a/chrome/browser/resources/options/options_page.js
+++ b/chrome/browser/resources/options/options_page.js
@@ -204,7 +204,7 @@ cr.define('options', function() {
var container = $('page-container');
var scrollTop = container.oldScrollTop || 0;
container.oldScrollTop = undefined;
- window.scroll(document.documentElement.scrollLeft, scrollTop);
+ window.scroll(scrollLeftForDocument(document), scrollTop);
};
/**
@@ -611,7 +611,7 @@ cr.define('options', function() {
if (freeze) {
// Lock the width, since auto width computation may change.
container.style.width = window.getComputedStyle(container).width;
- container.oldScrollTop = document.documentElement.scrollTop;
+ container.oldScrollTop = scrollTopForDocument(document);
container.classList.add('frozen');
var verticalPosition =
container.getBoundingClientRect().top - container.oldScrollTop;
@@ -703,8 +703,8 @@ cr.define('options', function() {
if (isRTL()) {
e.style.right = OptionsPage.horizontalOffset + 'px';
} else {
- e.style.left = OptionsPage.horizontalOffset -
- document.documentElement.scrollLeft + 'px';
+ var scrollLeft = scrollLeftForDocument(document);
+ e.style.left = OptionsPage.horizontalOffset - scrollLeft + 'px';
}
};
« no previous file with comments | « chrome/browser/resources/ntp_android/ntp_android.js ('k') | chrome/browser/resources/uber/uber_utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698