| OLD | NEW |
| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 }); | 576 }); |
| 577 } | 577 } |
| 578 | 578 |
| 579 // Capitalize each word in the string. | 579 // Capitalize each word in the string. |
| 580 sk.toCapWords = function(s) { | 580 sk.toCapWords = function(s) { |
| 581 return s.replace(/\b\w/g, function(firstLetter) { | 581 return s.replace(/\b\w/g, function(firstLetter) { |
| 582 return firstLetter.toUpperCase(); | 582 return firstLetter.toUpperCase(); |
| 583 }); | 583 }); |
| 584 } | 584 } |
| 585 | 585 |
| 586 // Polyfill for String.startsWith from |
| 587 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Ob
jects/String/startsWith#Polyfill |
| 588 // returns true iff the string starts with the given prefix |
| 589 if (!String.prototype.startsWith) { |
| 590 String.prototype.startsWith = function(searchString, position) { |
| 591 position = position || 0; |
| 592 return this.indexOf(searchString, position) === position; |
| 593 }; |
| 594 } |
| 586 return sk; | 595 return sk; |
| 587 }(); | 596 }(); |
| OLD | NEW |