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

Side by Side Diff: ui/webui/resources/js/util.js

Issue 646853004: Enable a11y audit for chrome://settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Apply Feedback pt2 Created 6 years 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/chrome_tests.gypi ('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 * Alias for document.getElementById. 8 * Alias for document.getElementById.
9 * @param {string} id The ID of the element to find. 9 * @param {string} id The ID of the element to find.
10 * @return {HTMLElement} The found element or null if not found. 10 * @return {HTMLElement} The found element or null if not found.
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 * webkitTransitionEnd to happen. 376 * webkitTransitionEnd to happen.
377 */ 377 */
378 function ensureTransitionEndEvent(el, timeOut) { 378 function ensureTransitionEndEvent(el, timeOut) {
379 var fired = false; 379 var fired = false;
380 el.addEventListener('webkitTransitionEnd', function f(e) { 380 el.addEventListener('webkitTransitionEnd', function f(e) {
381 el.removeEventListener('webkitTransitionEnd', f); 381 el.removeEventListener('webkitTransitionEnd', f);
382 fired = true; 382 fired = true;
383 }); 383 });
384 window.setTimeout(function() { 384 window.setTimeout(function() {
385 if (!fired) 385 if (!fired)
386 cr.dispatchSimpleEvent(el, 'webkitTransitionEnd'); 386 cr.dispatchSimpleEvent(el, 'webkitTransitionEnd', true);
387 }, timeOut); 387 }, timeOut);
388 } 388 }
389 389
390 /** 390 /**
391 * Alias for document.scrollTop getter. 391 * Alias for document.scrollTop getter.
392 * @param {!HTMLDocument} doc The document node where information will be 392 * @param {!HTMLDocument} doc The document node where information will be
393 * queried from. 393 * queried from.
394 * @return {number} The Y document scroll offset. 394 * @return {number} The Y document scroll offset.
395 */ 395 */
396 function scrollTopForDocument(doc) { 396 function scrollTopForDocument(doc) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 * @param {number} maxLength The maximum length allowed for the string. 447 * @param {number} maxLength The maximum length allowed for the string.
448 * @return {string} The original string if its length does not exceed 448 * @return {string} The original string if its length does not exceed
449 * |maxLength|. Otherwise the first |maxLength| - 1 characters with '...' 449 * |maxLength|. Otherwise the first |maxLength| - 1 characters with '...'
450 * appended. 450 * appended.
451 */ 451 */
452 function elide(original, maxLength) { 452 function elide(original, maxLength) {
453 if (original.length <= maxLength) 453 if (original.length <= maxLength)
454 return original; 454 return original;
455 return original.substring(0, maxLength - 1) + '\u2026'; 455 return original.substring(0, maxLength - 1) + '\u2026';
456 } 456 }
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698