Scripts: Use core-js url as polyfill for window.URL.

URL polyfill from the polyfill-library library is not spec-conformant, in a way which negatively impacts its usability for pending revisions to the block editor. Specifically, there were revisions to the implementation of the wp-url script to detect URL validity by relying on thrown errors from the URL constructor, but this specific behavior is not implemented in this version of the polyfill.
There was another issue in r47238, which is that the test used to check whether the polyfill should be included is not accurate. This commit uses a different check and fixes the issue.

Props aduth.
Fixes: #49360.
Built from https://develop.svn.wordpress.org/trunk@47416


git-svn-id: http://core.svn.wordpress.org/trunk@47203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
jorgefilipecosta 2020-03-03 16:55:07 +00:00
parent 62ef2d6719
commit cf40905ada
4 changed files with 2981 additions and 487 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -100,7 +100,7 @@ function wp_default_packages_vendor( $scripts ) {
'wp-polyfill-fetch' => '3.0.0',
'wp-polyfill-formdata' => '3.0.12',
'wp-polyfill-node-contains' => '3.42.0',
'wp-polyfill-url' => '3.42.0',
'wp-polyfill-url' => '3.6.4',
'wp-polyfill-dom-rect' => '3.42.0',
'wp-polyfill-element-closest' => '2.0.2',
'wp-polyfill' => '7.4.4',
@ -126,8 +126,8 @@ function wp_default_packages_vendor( $scripts ) {
array(
'\'fetch\' in window' => 'wp-polyfill-fetch',
'document.contains' => 'wp-polyfill-node-contains',
'window.URL' => 'wp-polyfill-url',
'window.DOMRect' => 'wp-polyfill-dom-rect',
'window.URL && window.URL.prototype && window.URLSearchParams' => 'wp-polyfill-url',
'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',
'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',
)

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.4-beta3-47415';
$wp_version = '5.4-beta3-47416';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.