From 034b3f4c7710e969259570b4818fffffd7cad60b Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 29 May 2017 03:20:11 +0000 Subject: [PATCH] Emoji: Fix the flag and emoji5 tests not working correctly. Fixes the UN flag not being correctly compared to itself, introduced in [40837]. Replaces the bearded person check with a male fairy. Emoji 5 does not have gendered bearded people, so we needed to switch it out to use the ZWJ check for a broken render. Props peterwilsoncc for the code and commit message. Fixes #40858. git-svn-id: https://develop.svn.wordpress.org/trunk@40850 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/wp-emoji-loader.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/wp-includes/js/wp-emoji-loader.js b/src/wp-includes/js/wp-emoji-loader.js index b267e99dcf..169ee89af2 100644 --- a/src/wp-includes/js/wp-emoji-loader.js +++ b/src/wp-includes/js/wp-emoji-loader.js @@ -51,7 +51,7 @@ context.clearRect( 0, 0, canvas.width, canvas.height ); // Add a zero width space between the characters, to force rendering as characters. - context.fillText( stringFromCharCode( 55356, 57331, 8203, 55356, 57096 ), 0, 0 ); + context.fillText( stringFromCharCode( 55356, 56826, 8203, 55356, 56819 ), 0, 0 ); flag2 = canvas.toDataURL(); if ( flag !== flag2 ) { @@ -79,18 +79,18 @@ return flag !== flag2; case 'emoji4': /* - * Emoji 5 has the bushiest beards. So does WordPress! + * Emoji 5 has faries of all genders. * - * To test for support, try to render a new emoji (bearded person: light skin tone), - * then compare it to how it would look if the browser doesn't render it correctly - * (bearded person + Fitzpatrick modifier). + * To test for support, try to render a new emoji (fairy, male), then compares + * it to how it would look if the browser doesn't render it correctly + * (fairy + male sign). */ - context.fillText( stringFromCharCode( 55358, 56788, 55356, 57339 ), 0, 0 ); + context.fillText( stringFromCharCode( 55358, 56794, 8205, 9794, 65039 ), 0, 0 ); emoji41 = canvas.toDataURL(); context.clearRect( 0, 0, canvas.width, canvas.height ); - context.fillText( stringFromCharCode( 55358, 56788, 8203, 55356, 57339 ), 0, 0 ); + context.fillText( stringFromCharCode( 55358, 56794, 8203, 9794, 65039 ), 0, 0 ); emoji42 = canvas.toDataURL(); return emoji41 !== emoji42;