[wp-trac] [WordPress Trac] #57301: Emoji feature detection is incorrect

WordPress Trac noreply at wordpress.org
Mon Dec 12 11:11:29 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         |  Resolution:
 Keywords:                 |     Focuses:  javascript, performance
---------------------------+--------------------------------------

Comment (by sergiomdgomes):

 Replying to [comment:4 dmsnell]:
 > Strangely, it looks like the previous code in
 [https://core.trac.wordpress.org/attachment/ticket/47852/47852.diff
 47852.diff] also used this representation and also referenced characters
 above the "code char" range (those code points which can be represented in
 UTF-16 without surrogate pairs).
 >
 > And also if that's the case, then I'm confused on how `fromCharCode`
 worked at all, lol, so I know I'm misunderstanding something. Is there
 something big I'm missing in the what the problem was or how it appeared
 in the linked patch?

 As far as I can tell, before #47852 everything was indeed a char code and
 not a code point. Here's a link to the repo at that point in time:
 https://github.com/WordPress/WordPress/blob/a12598977269f1f78c524d112218196d723cb42e
 /wp-includes/js/wp-emoji-loader.js

 > Is the effect that we've been saying for years that a given browser
 //doesn't// support Emoji when in fact it does?

 Yup, that's exactly it! As far as I can tell, since #47852 every browser
 fails the test and loads the polyfill, because the test is flawed. #47852
 only introduced one incorrect test (the transgender flag test), but
 subsequent changes expanded this to other tests as well.

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


More information about the wp-trac mailing list