[wp-trac] [WordPress Trac] #61806: twemoji is always loaded on Windows devices

WordPress Trac noreply at wordpress.org
Mon Aug 5 21:22:48 UTC 2024


#61806: twemoji is always loaded on Windows devices
--------------------------+------------------------------
 Reporter:  Clorith       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Emoji         |     Version:
 Severity:  minor         |  Resolution:
 Keywords:                |     Focuses:  performance
--------------------------+------------------------------

Comment (by dmsnell):

 @Clorith just a note that the Twemoji script is there //only// for cases
 where it thinks that the combination of the browser and OS cannot properly
 display the Emoji that might appear on a page. In normative situations it
 shouldn't be //replacing// Emoji, but it will always^†^ run to determine
 if it should replace them.

 > I would expect the editor and front-end to behave and display the same
 emoji as a bare minimum

 this is one place where it's not possible, unfortunately, because the text
 rendering support on the computer doing the editing may not match the text
 rendering support of the computer doing the viewing of the page.

 > since the native vss twemoji versions are visually different to a degree

 this is another point to note, as Unicode does not standardize the
 appearance of the Emoji, but rather the semantics of their usage. notably,
 Android devices have long rendered Emoji differently, as does I think
 Facebook, who runs their own replacement code.

 ----

 I think there are perhaps multiple points of discussion muddled in here.
 The goal of the script is to ensure that people whose systems cannot
 display the Emoji see a valid representation of the Emoji rather than � or
 a combination of characters like `🏴󠀇󠀆󠀇󠀆` (the rest are invisible)
 instead of 🏴󠁧󠁢󠁥󠁮󠁧󠁿, which is what they //would// see if the rendering
 support is missing.

 It sounds like you are reporting that the script is erroneously detecting
 that it needs to replace the Emoji on the page when it doesn't need to. In
 that case, not only has the script run, but it has replaced the Emoji in
 the text nodes with an image tag `<img>` containing the Emoji-replacement
 glyph.

 There are definite ways to improve the script, but its purpose isn't
 particularly controversial. Its mode of operation is to render text with
 some test Emoji and then detect graphical properties about the rendered
 snippet. If indeed it's always replacing Emoji on Windows, there may be a
 glitch we need to examine.

 **Test**
 What does 🐦‍⬛ look like on your system in the browser you're reporting
 from? Does it look like a blackbird or does it look like 🐦​⬛ a bird and
 then a black square? Can you also verify that these are being rendered as
 text and not replaced by anything else?

 †: it tries to cache the computation so that it doesn't have to run the
 detection on every page load.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61806#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list