WordPress.org

Make WordPress Core

Changeset 40850


Ignore:
Timestamp:
05/29/17 03:20:11 (6 months ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/wp-emoji-loader.js

    r40837 r40850  
    5252 
    5353                // Add a zero width space between the characters, to force rendering as characters. 
    54                 context.fillText( stringFromCharCode( 55356, 57331, 8203, 55356, 57096 ), 0, 0 ); 
     54                context.fillText( stringFromCharCode( 55356, 56826, 8203, 55356, 56819 ), 0, 0 ); 
    5555                flag2 = canvas.toDataURL(); 
    5656 
     
    8080            case 'emoji4': 
    8181                /* 
    82                  * Emoji 5 has the bushiest beards. So does WordPress! 
     82                 * Emoji 5 has faries of all genders. 
    8383                 * 
    84                  * To test for support, try to render a new emoji (bearded person: light skin tone), 
    85                  * then compare it to how it would look if the browser doesn't render it correctly 
    86                  * (bearded person + Fitzpatrick modifier). 
     84                 * To test for support, try to render a new emoji (fairy, male), then compares 
     85                 * it to how it would look if the browser doesn't render it correctly 
     86                 * (fairy + male sign). 
    8787                 */ 
    88                 context.fillText( stringFromCharCode( 55358, 56788, 55356, 57339 ), 0, 0 ); 
     88                context.fillText( stringFromCharCode( 55358, 56794, 8205, 9794, 65039 ), 0, 0 ); 
    8989                emoji41 = canvas.toDataURL(); 
    9090 
    9191                context.clearRect( 0, 0, canvas.width, canvas.height ); 
    9292 
    93                 context.fillText( stringFromCharCode( 55358, 56788, 8203, 55356, 57339 ), 0, 0 ); 
     93                context.fillText( stringFromCharCode( 55358, 56794, 8203, 9794, 65039 ), 0, 0 ); 
    9494                emoji42 = canvas.toDataURL(); 
    9595 
Note: See TracChangeset for help on using the changeset viewer.