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

Side by Side Diff: res/js/common.js

Issue 1662373002: Add UI to filter fuzzes based on tags. (Closed) Base URL: https://skia.googlesource.com/buildbot@add-asan
Patch Set: remove conflicting status-sk elements Created 4 years, 10 months 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 | « res/imp/9/url-params-sk-demo.html ('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 /** 1 /**
2 * common.js is a set of common functions used across all of skiaperf. 2 * common.js is a set of common functions used across all of skiaperf.
3 * 3 *
4 * Everything is scoped to 'sk' except $$ and $$$ which are global since they 4 * Everything is scoped to 'sk' except $$ and $$$ which are global since they
5 * are used so often. 5 * are used so often.
6 * 6 *
7 */ 7 */
8 8
9 /** 9 /**
10 * $$ returns a real JS array of DOM elements that match the CSS query selector. 10 * $$ returns a real JS array of DOM elements that match the CSS query selector.
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 sk.escapeHTML = function(s) { 666 sk.escapeHTML = function(s) {
667 return s.replace(/&/g, '&') 667 return s.replace(/&/g, '&')
668 .replace(/</g, '&lt;') 668 .replace(/</g, '&lt;')
669 .replace(/>/g, '&gt;') 669 .replace(/>/g, '&gt;')
670 .replace(/"/g, '&quot;') 670 .replace(/"/g, '&quot;')
671 .replace(/'/g, '&#x27;') 671 .replace(/'/g, '&#x27;')
672 .replace(/\//g, '&#x2F;'); 672 .replace(/\//g, '&#x2F;');
673 673
674 } 674 }
675 675
676 // Returns true if the sorted arrays a and b
677 // contain at least one element in common
678 sk.sharesElement = function(a, b) {
679 var i = 0;
680 var j = 0;
681 while (i < a.length && j < b.length) {
682 if (a[i] < b[j]) {
683 i++;
684 } else if (b[j] < a[i]) {
685 j++;
686 } else {
687 return true;
688 }
689 }
690 return false;
691 }
692
676 // Polyfill for String.startsWith from 693 // Polyfill for String.startsWith from
677 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Ob jects/String/startsWith#Polyfill 694 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Ob jects/String/startsWith#Polyfill
678 // returns true iff the string starts with the given prefix 695 // returns true iff the string starts with the given prefix
679 if (!String.prototype.startsWith) { 696 if (!String.prototype.startsWith) {
680 String.prototype.startsWith = function(searchString, position) { 697 String.prototype.startsWith = function(searchString, position) {
681 position = position || 0; 698 position = position || 0;
682 return this.indexOf(searchString, position) === position; 699 return this.indexOf(searchString, position) === position;
683 }; 700 };
684 } 701 }
685 702
686 return sk; 703 return sk;
687 }(); 704 }();
OLDNEW
« no previous file with comments | « res/imp/9/url-params-sk-demo.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698