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

Unified Diff: chrome/browser/resources/uber/uber_utils.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/options/options_page.js ('k') | ui/webui/resources/js/util.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/uber/uber_utils.js
diff --git a/chrome/browser/resources/uber/uber_utils.js b/chrome/browser/resources/uber/uber_utils.js
index 04f8ba1fe9391efab9a9cd882973ee51c93d491e..5f5c6d2a28af31465f8b9379ddb6dbe89a0a3806 100644
--- a/chrome/browser/resources/uber/uber_utils.js
+++ b/chrome/browser/resources/uber/uber_utils.js
@@ -39,7 +39,8 @@ cr.define('uber', function() {
* @private
*/
function handleScroll() {
- var offset = document.documentElement.scrollLeft * -1;
+ var scrollLeft = scrollLeftForDocument(document);
+ var offset = scrollLeft * -1;
for (var i = 0; i < headerElements.length; i++) {
// As a workaround for http://crbug.com/231830, set the transform to
// 'none' rather than 0px.
@@ -47,7 +48,7 @@ cr.define('uber', function() {
'translateX(' + offset + 'px)' : 'none';
}
- invokeMethodOnParent('adjustToScroll', document.documentElement.scrollLeft);
+ invokeMethodOnParent('adjustToScroll', scrollLeft);
};
/**
@@ -67,7 +68,7 @@ cr.define('uber', function() {
* @private
*/
function handleFrameSelected() {
- document.documentElement.scrollLeft = 0;
+ setScrollTopForDocument(document, 0);
}
/**
« no previous file with comments | « chrome/browser/resources/options/options_page.js ('k') | ui/webui/resources/js/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698