Changeset 36410
- Timestamp:
- 01/27/2016 10:10:58 AM (9 years ago)
- Location:
- branches/4.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
-
branches/4.4/src/wp-includes/js/wp-emoji-loader.js
r36161 r36410 14 14 var canvas = document.createElement( 'canvas' ), 15 15 context = canvas.getContext && canvas.getContext( '2d' ), 16 stringFromCharCode = String.fromCharCode, 16 17 tone; 17 18 … … 38 39 * to a larger image (4-5KB data URL). 39 40 */ 40 context.fillText( String.fromCharCode( 55356, 56806, 55356, 56826 ), 0, 0 );41 context.fillText( stringFromCharCode( 55356, 56806, 55356, 56826 ), 0, 0 ); 41 42 return canvas.toDataURL().length > 3000; 42 43 } else if ( 'diversity' === type ) { … … 46 47 * compares if the emoji rendering has changed. 47 48 */ 48 context.fillText( String.fromCharCode( 55356, 57221 ), 0, 0 );49 context.fillText( stringFromCharCode( 55356, 57221 ), 0, 0 ); 49 50 tone = context.getImageData( 16, 16, 1, 1 ).data.toString(); 50 context.fillText( String.fromCharCode( 55356, 57221, 55356, 57343 ), 0, 0 );51 context.fillText( stringFromCharCode( 55356, 57221, 55356, 57343 ), 0, 0 ); 51 52 // Chrome has issues comparing arrays, so we compare it as a string, instead. 52 53 return tone !== context.getImageData( 16, 16, 1, 1 ).data.toString(); … … 58 59 * as an empty square, so the center pixel will be blank. 59 60 */ 60 context.fillText( String.fromCharCode( 55357, 56835 ), 0, 0 );61 context.fillText( stringFromCharCode( 55357, 56835 ), 0, 0 ); 61 62 } else { 62 63 /* … … 64 65 * that the Unicode Consortium have made in years: the burrito. 65 66 */ 66 context.fillText( String.fromCharCode( 55356, 57135 ), 0, 0 );67 context.fillText( stringFromCharCode( 55356, 57135 ), 0, 0 ); 67 68 } 68 69 return context.getImageData( 16, 16, 1, 1 ).data[0] !== 0;
Note: See TracChangeset
for help on using the changeset viewer.