[wp-trac] [WordPress Trac] #57301: Emoji feature detection is incorrect
WordPress Trac
noreply at wordpress.org
Fri Dec 9 11:39:51 UTC 2022
#57301: Emoji feature detection is incorrect
-------------------------------------+-----------------------------
Reporter: sergiomdgomes | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Emoji | Version: trunk
Severity: normal | Keywords:
Focuses: javascript, performance |
-------------------------------------+-----------------------------
WP adds an inline script that performs feature detection for emoji support
in the browser, the source for which is available at `wp-includes/js/wp-
emoji-loader.js` [https://github.com/WordPress/WordPress/blob/master/wp-
includes/js/wp-emoji-loader.js].
This feature-detection is performed using a canvas that renders two
different sequences and comparing them. The sequences are stored as arrays
of hexadecimal numbers.
Unfortunately, for a few revisions of this file now (more specifically
since #45769), there have been mismatches introduced between the encoded
format for the sequences and the way they're being decoded, in that the
new sequences added have all been sequences of **code points**, but the
decoding function (`emojiSetsRenderIdentically`) expects sequences of
**char codes**.
This causes every browser to fail the feature detection, even if it
correctly supports the emoji features, and for the support polyfill to
(unnecessarily) be loaded.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57301>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list