Skip to content

Emoji: Test Emoji 17 support with the correct UTF-16 pair for Hairy Creature - #13515

Open
Jiwoon-Kim wants to merge 1 commit into
WordPress:trunkfrom
Jiwoon-Kim:fix/66104-emoji-17-support-test
Open

Jiwoon-Kim wants to merge 1 commit into
WordPress:trunkfrom
Jiwoon-Kim:fix/66104-emoji-17-support-test

Conversation

@Jiwoon-Kim

Copy link
Copy Markdown

The Emoji 17 support test in emoji-loader.js draws '\uD83E\u1FAC8'. Because \u takes exactly four hex digits, that string is a lone high surrogate, U+1FAC and the digit 8, not U+1FAC8 HAIRY CREATURE. It renders with an empty center point, so the test reports Emoji 17 as unsupported even in browsers that support it; emoji is then false, everythingExceptFlag is false as well, and wp-emoji.js replaces every emoji with images instead of only flags.

This uses the correct UTF-16 pair, '\uD83E\uDEC8', and corrects the comment. The malformed string was introduced with the Twemoji 17.0.1 update in [61134] (#64184) and is present in 6.9, 7.0, 7.1 and trunk; 6.8 tested '\uD83E\uDEDF'.

Testing: there is no JS unit test for the loader, so Core's own support-test functions (testEmojiSupports() and the helpers it calls) were extracted from trunk and from this branch and run in the same browser (Windows 11, Chromium 152). Trunk returns { flag: false, emoji: false }, so every emoji is replaced; this branch returns { flag: false, emoji: true }, so only flags are replaced, which is what everythingExceptFlag is for. Both runs used the same OffscreenCanvas path. wp-scripts lint-js and jshint pass on the changed file.

Trac ticket: https://core.trac.wordpress.org/ticket/66104

Use of AI Tools

This pull request was prepared with Claude Code (Anthropic). It located the defect, wrote the fix, and ran the browser comparison and lint checks locally.

…reature.

The Emoji 17 support test drew a string written with a five-digit Unicode escape, which JavaScript reads as a lone high surrogate, U+1FAC and the digit 8 rather than U+1FAC8. It renders with an empty center point, so browsers that support Emoji 17 were reported as not supporting it, and every emoji was replaced with images instead of only flags.

Follow-up to [61134].

See #66104.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props kimjiwoon.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@peterwilsoncc peterwilsoncc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me and is testing well. As noted on the ticket I have confirmed the updated codepoint is correct.

Testing notes:

  1. Visit playground.wordpress.net (ie, running WP production release)
  2. Create a new post
  3. Copy in emoji pile below
  4. Publish post
  5. View post on front end
  6. Observe the emoji are replaced with the fallbacks
  7. Visit playground link on this PR
  8. Create emoji pile post, publish and view on front end
  9. Observe the emoji are not replaced with the fallbacks.

Testing device

  • Browser: Firefox 155.0
  • OS: macOS 26.6.2

Emoji pile

🫪 🫯 🫈 🫍 🛘 🪊 🪎 🧑‍🩰 🧑🏻‍🩰 🧑🏼‍🩰 🧑🏽‍🩰 🧑🏾‍🩰 🧑🏿‍🩰 👯🏻 🧑🏻‍🐰‍🧑🏼 🧑🏻‍🐰‍🧑🏽 🧑🏻‍🐰‍🧑🏾 🧑🏻‍🐰‍🧑🏿 👯🏼 🧑🏼‍🐰‍🧑🏻 🧑🏼‍🐰‍🧑🏽 🧑🏼‍🐰‍🧑🏾 🧑🏼‍🐰‍🧑🏿 👯🏽 🧑🏽‍🐰‍🧑🏻 🧑🏽‍🐰‍🧑🏼 🧑🏽‍🐰‍🧑🏾 🧑🏽‍🐰‍🧑🏿 👯🏾 🧑🏾‍🐰‍🧑🏻 🧑🏾‍🐰‍🧑🏼 🧑🏾‍🐰‍🧑🏽 🧑🏾‍🐰‍🧑🏿 👯🏿 🧑🏿‍🐰‍🧑🏼 🧑🏿‍🐰‍🧑🏻 🧑🏿‍🐰‍🧑🏽 🧑🏿‍🐰‍🧑🏾 👯🏻‍♂️ 👨🏻‍🐰‍👨🏼 👨🏻‍🐰‍👨🏽 👨🏻‍🐰‍👨🏾 👨🏻‍🐰‍👨🏿 👯🏼‍♂️ 👨🏼‍🐰‍👨🏻 👨🏼‍🐰‍👨🏽 👨🏼‍🐰‍👨🏾 👨🏼‍🐰‍👨🏿 👯🏽‍♂️ 👨🏽‍🐰‍👨🏻 👨🏽‍🐰‍👨🏼 👨🏽‍🐰‍👨🏾 👨🏽‍🐰‍👨🏿 👯🏾‍♂️ 👨🏾‍🐰‍👨🏻 👨🏾‍🐰‍👨🏼 👨🏾‍🐰‍👨🏽 👨🏾‍🐰‍👨🏿 👯🏿‍♂️ 👨🏿‍🐰‍👨🏻 👨🏿‍🐰‍👨🏼 👨🏿‍🐰‍👨🏽 👨🏿‍🐰‍👨🏾 👯🏻‍♀️ 👩🏻‍🐰‍👩🏼 👩🏻‍🐰‍👩🏽 👩🏻‍🐰‍👩🏾 👩🏻‍🐰‍👩🏿 👯🏼‍♀️ 👩🏼‍🐰‍👩🏻 👩🏼‍🐰‍👩🏽 👩🏼‍🐰‍👩🏾 👩🏼‍🐰‍👩🏿 👯🏽‍♀️ 👩🏽‍🐰‍👩🏻 👩🏽‍🐰‍👩🏼 👩🏽‍🐰‍👩🏾 👩🏽‍🐰‍👩🏿 👯🏾‍♀️ 👩🏾‍🐰‍👩🏻 👩🏾‍🐰‍👩🏼 👩🏾‍🐰‍👩🏽 👩🏾‍🐰‍👩🏿 👯🏿‍♀️ 👩🏿‍🐰‍👩🏻 👩🏿‍🐰‍👩🏼 👩🏿‍🐰‍👩🏽 👩🏿‍🐰‍👩🏾 🤼🏻 🧑🏻‍🫯‍🧑🏼 🧑🏻‍🫯‍🧑🏽 🧑🏻‍🫯‍🧑🏾 🧑🏻‍🫯‍🧑🏿 🤼🏼 🧑🏼‍🫯‍🧑🏻 🧑🏼‍🫯‍🧑🏽 🧑🏼‍🫯‍🧑🏾 🧑🏼‍🫯‍🧑🏿 🤼🏽 🧑🏽‍🫯‍🧑🏻 🧑🏽‍🫯‍🧑🏼 🧑🏽‍🫯‍🧑🏾 🧑🏽‍🫯‍🧑🏿 🤼🏾 🧑🏾‍🫯‍🧑🏻 🧑🏾‍🫯‍🧑🏼 🧑🏾‍🫯‍🧑🏽 🧑🏾‍🫯‍🧑🏿 🤼🏿 🧑🏿‍🫯‍🧑🏻 🧑🏿‍🫯‍🧑🏼 🧑🏿‍🫯‍🧑🏽 🧑🏿‍🫯‍🧑🏾 🤼🏻‍♂️ 👨🏻‍🫯‍👨🏼 👨🏻‍🫯‍👨🏽 👨🏻‍🫯‍👨🏾 👨🏻‍🫯‍👨🏿 🤼🏼‍♂️ 👨🏼‍🫯‍👨🏻 👨🏼‍🫯‍👨🏽 👨🏼‍🫯‍👨🏾 👨🏼‍🫯‍👨🏿 🤼🏽‍♂️ 👨🏽‍🫯‍👨🏻 👨🏽‍🫯‍👨🏼 👨🏽‍🫯‍👨🏾 👨🏽‍🫯‍👨🏿 🤼🏾‍♂️ 👨🏾‍🫯‍👨🏻 👨🏾‍🫯‍👨🏼 👨🏾‍🫯‍👨🏽 👨🏾‍🫯‍👨🏿 🤼🏿‍♂️ 👨🏿‍🫯‍👨🏻 👨🏿‍🫯‍👨🏼 👨🏿‍🫯‍👨🏽 👨🏿‍🫯‍👨🏾 🤼🏻‍♀️ 👩🏻‍🫯‍👩🏼 👩🏻‍🫯‍👩🏽 👩🏻‍🫯‍👩🏾 👩🏻‍🫯‍👩🏿 🤼🏼‍♀️ 👩🏼‍🫯‍👩🏻 👩🏼‍🫯‍👩🏽 👩🏼‍🫯‍👩🏾 👩🏼‍🫯‍👩🏿 🤼🏽‍♀️ 👩🏽‍🫯‍👩🏻 👩🏽‍🫯‍👩🏼 👩🏽‍🫯‍👩🏾 👩🏽‍🫯‍👩🏿 🤼🏾‍♀️ 👩🏾‍🫯‍👩🏻 👩🏾‍🫯‍👩🏼 👩🏾‍🫯‍👩🏽 👩🏾‍🫯‍👩🏿 🤼🏿‍♀️ 👩🏿‍🫯‍👩🏻 👩🏿‍🫯‍👩🏼 👩🏿‍🫯‍👩🏽 👩🏿‍🫯‍👩🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants