Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 } | |
| OLD | NEW |