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
Pending block editor revisions for WordPress 5.4 will make use of `window.URL` and `window.DOMRect`. These are not available in Internet Explorer (or pre-Chromium Edge for `DOMRect`) and must be polyfilled to avoid script errors.
The changes make use of the existing polyfill pattern, and existing `polyfill-library` dependency. The dependency is bumped to the latest version, since the previous version did not include the `DOMRect` polyfill.
Props jorgefilipecosta.
Fixes#49360.
Built from https://develop.svn.wordpress.org/trunk@47238
git-svn-id: http://core.svn.wordpress.org/trunk@47038 1a063a9b-81f0-0310-95a4-ce76da25c4cd