Changeset 37090
- Timestamp:
- 03/29/2016 02:18:51 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4/src/wp-includes/js/wp-emoji-loader.js
r36410 r37090 15 15 context = canvas.getContext && canvas.getContext( '2d' ), 16 16 stringFromCharCode = String.fromCharCode, 17 tone ;17 tonedata, tone, tone2; 18 18 19 19 if ( ! context || ! context.fillText ) { … … 48 48 */ 49 49 context.fillText( stringFromCharCode( 55356, 57221 ), 0, 0 ); 50 tone = context.getImageData( 16, 16, 1, 1 ).data.toString(); 50 tonedata = context.getImageData( 16, 16, 1, 1 ).data; 51 51 52 context.fillText( stringFromCharCode( 55356, 57221, 55356, 57343 ), 0, 0 ); 52 // Chrome has issues comparing arrays, so we compare it as a string, instead. 53 return tone !== context.getImageData( 16, 16, 1, 1 ).data.toString(); 53 // Chrome has issues comparing arrays, and Safari has issues converting arrays to strings. 54 // So, we create our own string and compare that, instead. 55 tonedata = context.getImageData( 16, 16, 1, 1 ).data; 56 tone2 = tonedata[0] + ',' + tonedata[1] + ',' + tonedata[2] + ',' + tonedata[3]; 57 58 return tone !== tone2; 54 59 } else { 55 60 if ( 'simple' === type ) {
Note: See TracChangeset
for help on using the changeset viewer.