Skip to content

Commit e2b40d5

Browse files
Merge branch 'trunk' into add/40477-unit-tests
2 parents 1526ad5 + 3f9317c commit e2b40d5

116 files changed

Lines changed: 958 additions & 523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ module.exports = function(grunt) {
11411141
}
11421142

11431143
// Fetch a list of the files that Twemoji supplies.
1144-
query = 'query={repository(owner: "jdecked", name: "twemoji") {object(expression: "v15.1.0:assets/svg") {... on Tree {entries {name}}}}}';
1144+
query = 'query={repository(owner: "jdecked", name: "twemoji") {object(expression: "v16.0.1:assets/svg") {... on Tree {entries {name}}}}}';
11451145
files = spawn( 'gh', [ 'api', 'graphql', '-f', query] );
11461146

11471147
if ( 0 !== files.status ) {

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "wordpress/wordpress",
3+
"version": "6.9.0",
34
"license": "GPL-2.0-or-later",
45
"description": "WordPress is open source software you can use to create a beautiful website, blog, or app.",
56
"homepage": "https://wordpress.org",

package-lock.json

Lines changed: 280 additions & 201 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,68 +81,68 @@
8181
"@wordpress/api-fetch": "7.19.1",
8282
"@wordpress/autop": "4.19.1",
8383
"@wordpress/blob": "4.19.1",
84-
"@wordpress/block-directory": "5.19.4",
85-
"@wordpress/block-editor": "14.14.3",
86-
"@wordpress/block-library": "9.19.3",
84+
"@wordpress/block-directory": "5.19.6",
85+
"@wordpress/block-editor": "14.14.5",
86+
"@wordpress/block-library": "9.19.5",
8787
"@wordpress/block-serialization-default-parser": "5.19.1",
8888
"@wordpress/blocks": "14.8.1",
89-
"@wordpress/commands": "1.19.2",
90-
"@wordpress/components": "29.5.2",
89+
"@wordpress/commands": "1.19.3",
90+
"@wordpress/components": "29.5.3",
9191
"@wordpress/compose": "7.19.1",
92-
"@wordpress/core-commands": "1.19.3",
93-
"@wordpress/core-data": "7.19.3",
94-
"@wordpress/customize-widgets": "5.19.3",
92+
"@wordpress/core-commands": "1.19.5",
93+
"@wordpress/core-data": "7.19.5",
94+
"@wordpress/customize-widgets": "5.19.5",
9595
"@wordpress/data": "10.19.1",
9696
"@wordpress/data-controls": "4.19.1",
97-
"@wordpress/dataviews": "4.15.2",
97+
"@wordpress/dataviews": "4.15.3",
9898
"@wordpress/date": "5.19.1",
9999
"@wordpress/deprecated": "4.19.1",
100100
"@wordpress/dom": "4.19.1",
101101
"@wordpress/dom-ready": "4.19.1",
102-
"@wordpress/edit-post": "8.19.4",
103-
"@wordpress/edit-site": "6.19.4",
104-
"@wordpress/edit-widgets": "6.19.3",
105-
"@wordpress/editor": "14.19.4",
102+
"@wordpress/edit-post": "8.19.6",
103+
"@wordpress/edit-site": "6.19.6",
104+
"@wordpress/edit-widgets": "6.19.5",
105+
"@wordpress/editor": "14.19.6",
106106
"@wordpress/element": "6.19.1",
107107
"@wordpress/escape-html": "3.19.1",
108-
"@wordpress/fields": "0.11.3",
109-
"@wordpress/format-library": "5.19.3",
108+
"@wordpress/fields": "0.11.5",
109+
"@wordpress/format-library": "5.19.5",
110110
"@wordpress/hooks": "4.19.1",
111111
"@wordpress/html-entities": "4.19.1",
112112
"@wordpress/i18n": "5.19.1",
113113
"@wordpress/icons": "10.19.1",
114114
"@wordpress/interactivity": "6.19.1",
115115
"@wordpress/interactivity-router": "2.19.1",
116-
"@wordpress/interface": "9.4.2",
116+
"@wordpress/interface": "9.4.3",
117117
"@wordpress/is-shallow-equal": "5.19.1",
118118
"@wordpress/keyboard-shortcuts": "5.19.1",
119119
"@wordpress/keycodes": "4.19.1",
120-
"@wordpress/list-reusable-blocks": "5.19.2",
120+
"@wordpress/list-reusable-blocks": "5.19.3",
121121
"@wordpress/media-utils": "5.19.1",
122122
"@wordpress/notices": "5.19.1",
123-
"@wordpress/nux": "9.19.2",
124-
"@wordpress/patterns": "2.19.3",
125-
"@wordpress/plugins": "7.19.2",
126-
"@wordpress/preferences": "4.19.2",
123+
"@wordpress/nux": "9.19.3",
124+
"@wordpress/patterns": "2.19.5",
125+
"@wordpress/plugins": "7.19.3",
126+
"@wordpress/preferences": "4.19.3",
127127
"@wordpress/preferences-persistence": "2.19.1",
128128
"@wordpress/primitives": "4.19.1",
129129
"@wordpress/priority-queue": "3.19.1",
130130
"@wordpress/private-apis": "1.19.1",
131131
"@wordpress/redux-routine": "5.19.1",
132-
"@wordpress/reusable-blocks": "5.19.3",
132+
"@wordpress/reusable-blocks": "5.19.5",
133133
"@wordpress/rich-text": "7.19.1",
134134
"@wordpress/router": "1.19.1",
135-
"@wordpress/server-side-render": "5.19.2",
135+
"@wordpress/server-side-render": "5.19.3",
136136
"@wordpress/shortcode": "4.19.1",
137137
"@wordpress/style-engine": "2.19.1",
138138
"@wordpress/sync": "1.19.1",
139139
"@wordpress/token-list": "3.19.1",
140140
"@wordpress/undo-manager": "1.19.1",
141-
"@wordpress/upload-media": "0.4.2",
141+
"@wordpress/upload-media": "0.4.3",
142142
"@wordpress/url": "4.19.1",
143143
"@wordpress/viewport": "6.19.1",
144144
"@wordpress/warning": "3.19.1",
145-
"@wordpress/widgets": "4.19.3",
145+
"@wordpress/widgets": "4.19.5",
146146
"@wordpress/wordcount": "4.19.1",
147147
"backbone": "1.6.0",
148148
"clipboard": "2.0.11",

src/js/_enqueues/admin/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,8 +1327,8 @@ $( function() {
13271327

13281328
// Observe submissions from posts lists for 'bulk_action' or users lists for 'new_role'.
13291329
var bulkFieldRelations = {
1330-
'bulk_action' : 'action',
1331-
'changeit' : 'new_role'
1330+
'bulk_action' : window.bulkActionObserverIds.bulk_action,
1331+
'changeit' : window.bulkActionObserverIds.changeit
13321332
};
13331333
if ( ! Object.keys( bulkFieldRelations ).includes( submitterName ) ) {
13341334
return;

src/js/_enqueues/lib/emoji-loader.js

Lines changed: 63 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@
117117
/**
118118
* Checks if two sets of Emoji characters render the same visually.
119119
*
120+
* This is used to determine if the browser is rendering an emoji with multiple data points
121+
* correctly. set1 is the emoji in the correct form, using a zero-width joiner. set2 is the emoji
122+
* in the incorrect form, using a zero-width space. If the two sets render the same, then the browser
123+
* does not support the emoji correctly.
124+
*
120125
* This function may be serialized to run in a Worker. Therefore, it cannot refer to variables from the containing
121126
* scope. Everything must be passed by parameters.
122127
*
@@ -160,6 +165,42 @@
160165
} );
161166
}
162167

168+
/**
169+
* Checks if the center point of a single emoji is empty.
170+
*
171+
* This is used to determine if the browser is rendering an emoji with a single data point
172+
* correctly. The center point of an incorrectly rendered emoji will be empty. A correctly
173+
* rendered emoji will have a non-zero value at the center point.
174+
*
175+
* This function may be serialized to run in a Worker. Therefore, it cannot refer to variables from the containing
176+
* scope. Everything must be passed by parameters.
177+
*
178+
* @since 6.8.2
179+
*
180+
* @private
181+
*
182+
* @param {CanvasRenderingContext2D} context 2D Context.
183+
* @param {string} emoji Emoji to test.
184+
*
185+
* @return {boolean} True if the center point is empty.
186+
*/
187+
function emojiRendersEmptyCenterPoint( context, emoji ) {
188+
// Cleanup from previous test.
189+
context.clearRect( 0, 0, context.canvas.width, context.canvas.height );
190+
context.fillText( emoji, 0, 0 );
191+
192+
// Test if the center point (16, 16) is empty (0,0,0,0).
193+
var centerPoint = context.getImageData(16, 16, 1, 1);
194+
for ( var i = 0; i < centerPoint.data.length; i++ ) {
195+
if ( centerPoint.data[ i ] !== 0 ) {
196+
// Stop checking the moment it's known not to be empty.
197+
return false;
198+
}
199+
}
200+
201+
return true;
202+
}
203+
163204
/**
164205
* Determines if the browser properly renders Emoji that Twemoji can supplement.
165206
*
@@ -173,10 +214,11 @@
173214
* @param {CanvasRenderingContext2D} context 2D Context.
174215
* @param {string} type Whether to test for support of "flag" or "emoji".
175216
* @param {Function} emojiSetsRenderIdentically Reference to emojiSetsRenderIdentically function, needed due to minification.
217+
* @param {Function} emojiRendersEmptyCenterPoint Reference to emojiRendersEmptyCenterPoint function, needed due to minification.
176218
*
177219
* @return {boolean} True if the browser can render emoji, false if it cannot.
178220
*/
179-
function browserSupportsEmoji( context, type, emojiSetsRenderIdentically ) {
221+
function browserSupportsEmoji( context, type, emojiSetsRenderIdentically, emojiRendersEmptyCenterPoint ) {
180222
var isIdentical;
181223

182224
switch ( type ) {
@@ -198,16 +240,16 @@
198240
}
199241

200242
/*
201-
* Test for UN flag compatibility. This is the least supported of the letter locale flags,
243+
* Test for Sark flag compatibility. This is the least supported of the letter locale flags,
202244
* so gives us an easy test for full support.
203245
*
204246
* To test for support, we try to render it, and compare the rendering to how it would look if
205-
* the browser doesn't render it correctly ([U] + [N]).
247+
* the browser doesn't render it correctly ([C] + [Q]).
206248
*/
207249
isIdentical = emojiSetsRenderIdentically(
208250
context,
209-
'\uD83C\uDDFA\uD83C\uDDF3', // as the sequence of two code points
210-
'\uD83C\uDDFA\u200B\uD83C\uDDF3' // as the two code points separated by a zero-width space
251+
'\uD83C\uDDE8\uD83C\uDDF6', // as the sequence of two code points
252+
'\uD83C\uDDE8\u200B\uD83C\uDDF6' // as the two code points separated by a zero-width space
211253
);
212254

213255
if ( isIdentical ) {
@@ -232,31 +274,21 @@
232274
return ! isIdentical;
233275
case 'emoji':
234276
/*
235-
* Rise Like a Phoenix.
277+
* Does Emoji 16.0 cause the browser to go splat?
236278
*
237-
* To test for Emoji 15.1 support, try to render a new emoji: Phoenix.
279+
* To test for Emoji 16.0 support, try to render a new emoji: Splatter.
238280
*
239-
* A phoenix, a mythical immortal bird with flame-like feathers found in the folklore of many global
240-
* cultures. Often used to symbolize renewal or rebirth.
281+
* The splatter emoji is a single code point emoji. Testing for browser support
282+
* required testing the center point of the emoji to see if it is empty.
241283
*
242-
* The Phoenix emoji is a ZWJ sequence combining 🐦 Bird, Zero Width Joiner and 🔥 Fire.
243-
* These display as a single emoji on supported platforms.
284+
* 0xD83E 0xDEDF (\uD83E\uDEDF) == 🫟 Splatter.
244285
*
245-
* 0xD83D 0xDC26 (\uD83D\uDC26) == 🐦 Bird
246-
* 0x200D == Zero-Width Joiner (ZWJ) that links the code points for the new emoji or
247-
* 0x200B == Zero-Width Space (ZWS) that is rendered for clients not supporting the new emoji.
248-
* 0xD83D 0xDD25 (\uD83D\uDD25) == 🔥 Fire
249-
*
250-
* When updating this test for future Emoji releases, ensure that individual emoji that make up the
251-
* sequence come from older emoji standards.
286+
* When updating this test, please ensure that the emoji is either a single code point
287+
* or switch to using the emojiSetsRenderIdentically function and testing with a zero-width
288+
* joiner vs a zero-width space.
252289
*/
253-
isIdentical = emojiSetsRenderIdentically(
254-
context,
255-
'\uD83D\uDC26\u200D\uD83D\uDD25', // as the zero-width joiner sequence
256-
'\uD83D\uDC26\u200B\uD83D\uDD25' // separated by a zero-width space
257-
);
258-
259-
return ! isIdentical;
290+
var notSupported = emojiRendersEmptyCenterPoint( context, '\uD83E\uDEDF' );
291+
return ! notSupported;
260292
}
261293

262294
return false;
@@ -275,10 +307,11 @@
275307
* @param {string[]} tests Tests.
276308
* @param {Function} browserSupportsEmoji Reference to browserSupportsEmoji function, needed due to minification.
277309
* @param {Function} emojiSetsRenderIdentically Reference to emojiSetsRenderIdentically function, needed due to minification.
310+
* @param {Function} emojiRendersEmptyCenterPoint Reference to emojiRendersEmptyCenterPoint function, needed due to minification.
278311
*
279312
* @return {SupportTests} Support tests.
280313
*/
281-
function testEmojiSupports( tests, browserSupportsEmoji, emojiSetsRenderIdentically ) {
314+
function testEmojiSupports( tests, browserSupportsEmoji, emojiSetsRenderIdentically, emojiRendersEmptyCenterPoint ) {
282315
var canvas;
283316
if (
284317
typeof WorkerGlobalScope !== 'undefined' &&
@@ -301,7 +334,7 @@
301334

302335
var supports = {};
303336
tests.forEach( function ( test ) {
304-
supports[ test ] = browserSupportsEmoji( context, test, emojiSetsRenderIdentically );
337+
supports[ test ] = browserSupportsEmoji( context, test, emojiSetsRenderIdentically, emojiRendersEmptyCenterPoint );
305338
} );
306339
return supports;
307340
}
@@ -354,7 +387,8 @@
354387
[
355388
JSON.stringify( tests ),
356389
browserSupportsEmoji.toString(),
357-
emojiSetsRenderIdentically.toString()
390+
emojiSetsRenderIdentically.toString(),
391+
emojiRendersEmptyCenterPoint.toString()
358392
].join( ',' ) +
359393
'));';
360394
var blob = new Blob( [ workerScript ], {
@@ -371,7 +405,7 @@
371405
} catch ( e ) {}
372406
}
373407

374-
supportTests = testEmojiSupports( tests, browserSupportsEmoji, emojiSetsRenderIdentically );
408+
supportTests = testEmojiSupports( tests, browserSupportsEmoji, emojiSetsRenderIdentically, emojiRendersEmptyCenterPoint );
375409
setSessionSupportTests( supportTests );
376410
resolve( supportTests );
377411
} )

0 commit comments

Comments
 (0)