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

Side by Side Diff: ui/webui/resources/js/util.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: Make chrome/ be documentElement/body agnostic with regards to scrollTop/Left 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/uber/uber_utils.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 <include src="assert.js"> 5 <include src="assert.js">
6 6
7 /** 7 /**
8 * The global object. 8 * The global object.
9 * @type {!Object} 9 * @type {!Object}
10 * @const 10 * @const
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 var fired = false; 314 var fired = false;
315 el.addEventListener('webkitTransitionEnd', function f(e) { 315 el.addEventListener('webkitTransitionEnd', function f(e) {
316 el.removeEventListener('webkitTransitionEnd', f); 316 el.removeEventListener('webkitTransitionEnd', f);
317 fired = true; 317 fired = true;
318 }); 318 });
319 window.setTimeout(function() { 319 window.setTimeout(function() {
320 if (!fired) 320 if (!fired)
321 cr.dispatchSimpleEvent(el, 'webkitTransitionEnd'); 321 cr.dispatchSimpleEvent(el, 'webkitTransitionEnd');
322 }, timeOut); 322 }, timeOut);
323 } 323 }
324
325 /**
326 * Alias for document.scrollTop getter.
327 * @param {Node} doc The document node where information will be queried from.
Dan Beam 2013/11/11 19:44:04 all of these should be @param {!HTMLDocument}
328 * @return {value} The Y document scroll offset.
Dan Beam 2013/11/11 19:44:04 and all of these, @return {number}
329 */
330 function scrollTopForDocument(doc)
331 {
332 return doc.documentElement.scrollTop || doc.body.scrollTop;
333 }
Dan Beam 2013/11/11 19:44:04 please match chrome-style not blink (2\s indent, b
334
335 /**
336 * Alias for document.scrollTop setter.
337 * @param {Node} doc The document node where information will be queried from.
338 * @param {value} value The Y target scroll offset.
339 */
340 function setScrollTopForDocument(doc, value)
341 {
342 doc.documentElement.scrollTop = doc.body.scrollTop = value;
343 }
344
345 /**
346 * Alias for document.scrollLeft getter.
347 * @param {Node} doc The document node where information will be queried from.
348 * @return {value} The X document scroll offset.
349 */
350 function scrollLeftForDocument(doc)
351 {
352 return doc.documentElement.scrollLeft || doc.body.scrollLeft;
353 }
354
355 /**
356 * Alias for document.scrollLeft setter.
357 * @param {Node} doc The document node where information will be queried from.
358 * @param {value} value The target X scroll offset.
359 */
360 function setScrollLeftForDocument(doc, value)
361 {
Dan Beam 2013/11/11 19:44:04 is there any reason why we shouldn't simply be che
362 doc.documentElement.scrollLeft = doc.body.scrollLeft = value;
363 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/uber/uber_utils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698