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 {!HTMLDocument} doc The document node where information will be |
| 328 * queried from. |
| 329 * @return {number} The Y document scroll offset. |
| 330 */ |
| 331 function scrollTopForDocument(doc) { |
| 332 return doc.documentElement.scrollTop || doc.body.scrollTop; |
| 333 } |
| 334 |
| 335 /** |
| 336 * Alias for document.scrollTop setter. |
| 337 * @param {!HTMLDocument} doc The document node where information will be |
| 338 * queried from. |
| 339 * @param {number} value The target Y scroll offset. |
| 340 */ |
| 341 function setScrollTopForDocument(doc, value) { |
| 342 doc.documentElement.scrollTop = doc.body.scrollTop = value; |
| 343 } |
| 344 |
| 345 /** |
| 346 * Alias for document.scrollLeft getter. |
| 347 * @param {!HTMLDocument} doc The document node where information will be |
| 348 * queried from. |
| 349 * @return {number} The X document scroll offset. |
| 350 */ |
| 351 function scrollLeftForDocument(doc) { |
| 352 return doc.documentElement.scrollLeft || doc.body.scrollLeft; |
| 353 } |
| 354 |
| 355 /** |
| 356 * Alias for document.scrollLeft setter. |
| 357 * @param {!HTMLDocument} doc The document node where information will be |
| 358 * queried from. |
| 359 * @param {number} value The target X scroll offset. |
| 360 */ |
| 361 function setScrollLeftForDocument(doc, value) { |
| 362 doc.documentElement.scrollLeft = doc.body.scrollLeft = value; |
| 363 } |
OLD | NEW |