[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/js/ -> wp-emoji-loader.js (summary)

(no description)

File Size: 459 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions

  supportsWorkerOffloading()
  getSessionSupportTests()
  setSessionSupportTests()
  emojiSetsRenderIdentically()
  emojiRendersEmptyCenterPoint()
  browserSupportsEmoji()
  testEmojiSupports()
  addScript()

Functions
Functions that are not part of a class:

supportsWorkerOffloading()   X-Ref
Checks whether the browser supports offloading to a Worker.

returns: {boolean}

getSessionSupportTests()   X-Ref
Get support tests from session.

returns: {?SupportTests} Support tests, or null if not set or older than 1 week.

setSessionSupportTests( supportTests )   X-Ref
Persist the supports in session storage.

param: {SupportTests} supportTests Support tests.

emojiSetsRenderIdentically( context, set1, set2 )   X-Ref
Checks if two sets of Emoji characters render the same visually.

This is used to determine if the browser is rendering an emoji with multiple data points
correctly. set1 is the emoji in the correct form, using a zero-width joiner. set2 is the emoji
in the incorrect form, using a zero-width space. If the two sets render the same, then the browser
does not support the emoji correctly.

This function may be serialized to run in a Worker. Therefore, it cannot refer to variables from the containing
scope. Everything must be passed by parameters.

param: {CanvasRenderingContext2D} context 2D Context.
param: {string} set1 Set of Emoji to test.
param: {string} set2 Set of Emoji to test.
return: {boolean} True if the two sets render the same.

emojiRendersEmptyCenterPoint( context, emoji )   X-Ref
Checks if the center point of a single emoji is empty.

This is used to determine if the browser is rendering an emoji with a single data point
correctly. The center point of an incorrectly rendered emoji will be empty. A correctly
rendered emoji will have a non-zero value at the center point.

This function may be serialized to run in a Worker. Therefore, it cannot refer to variables from the containing
scope. Everything must be passed by parameters.

param: {CanvasRenderingContext2D} context 2D Context.
param: {string} emoji Emoji to test.
return: {boolean} True if the center point is empty.

browserSupportsEmoji( context, type, emojiSetsRenderIdentically, emojiRendersEmptyCenterPoint )   X-Ref
Determines if the browser properly renders Emoji that Twemoji can supplement.

This function may be serialized to run in a Worker. Therefore, it cannot refer to variables from the containing
scope. Everything must be passed by parameters.

param: {CanvasRenderingContext2D} context 2D Context.
param: {string} type Whether to test for support of "flag" or "emoji".
param: {Function} emojiSetsRenderIdentically Reference to emojiSetsRenderIdentically function, needed due to minification.
param: {Function} emojiRendersEmptyCenterPoint Reference to emojiRendersEmptyCenterPoint function, needed due to minification.
return: {boolean} True if the browser can render emoji, false if it cannot.

testEmojiSupports( tests, browserSupportsEmoji, emojiSetsRenderIdentically, emojiRendersEmptyCenterPoint )   X-Ref
Checks emoji support tests.

This function may be serialized to run in a Worker. Therefore, it cannot refer to variables from the containing
scope. Everything must be passed by parameters.

param: {string[]} tests Tests.
param: {Function} browserSupportsEmoji Reference to browserSupportsEmoji function, needed due to minification.
param: {Function} emojiSetsRenderIdentically Reference to emojiSetsRenderIdentically function, needed due to minification.
param: {Function} emojiRendersEmptyCenterPoint Reference to emojiRendersEmptyCenterPoint function, needed due to minification.
return: {SupportTests} Support tests.

addScript( src )   X-Ref
Adds a script to the head of the document.

param: {string} src The url where the script is located.
return: {void}



Generated : Wed May 14 08:20:01 2025 Cross-referenced by PHPXref