Changeset 38194 for trunk/src/wp-includes/js/wp-emoji-loader.js
- Timestamp:
- 08/04/2016 08:50:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/wp-emoji-loader.js
r38087 r38194 15 15 context = canvas.getContext && canvas.getContext( '2d' ), 16 16 stringFromCharCode = String.fromCharCode, 17 tonedata, tone, tone2;17 flag, flag2, tonedata, tone, tone2; 18 18 19 19 if ( ! context || ! context.fillText ) { … … 41 41 */ 42 42 context.fillText( stringFromCharCode( 55356, 56806, 55356, 56826 ), 0, 0 ); 43 return canvas.toDataURL().length > 3000; 43 if ( canvas.toDataURL().length < 3000 ) { 44 return false; 45 } 46 47 context.clearRect( 0, 0, canvas.width, canvas.height ); 48 49 /* 50 * Test for rainbow flag compatibility. As the rainbow flag was added out of sequence with 51 * the usual Unicode release cycle, some browsers support it, and some don't, even if their 52 * Unicode support is up to date. 53 * 54 * To test for support, we try to render it, and compare the rendering to how it would look if 55 * the browser doesn't render it correctly (white flag emoji + rainbow emoji). 56 */ 57 context.fillText( stringFromCharCode( 55356, 57331, 65039, 8205, 55356, 57096 ), 0, 0 ); 58 flag = canvas.toDataURL(); 59 60 context.clearRect( 0, 0, canvas.width, canvas.height ); 61 62 context.fillText( stringFromCharCode( 55356, 57331, 55356, 57096 ), 0, 0 ); 63 flag2 = canvas.toDataURL(); 64 65 return flag !== flag2; 44 66 case 'diversity': 45 67 /*
Note: See TracChangeset
for help on using the changeset viewer.