Make WordPress Core


Ignore:
Timestamp:
02/10/2020 03:15:07 PM (5 years ago)
Author:
aduth
Message:

Script Loader: Add polyfill for window.URL, window.DOMRect.

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r47233 r47238  
    8787        'wp-polyfill-formdata',
    8888        'wp-polyfill-node-contains',
     89        'wp-polyfill-url',
     90        'wp-polyfill-dom-rect',
    8991        'wp-polyfill-element-closest',
    9092        'wp-polyfill',
     
    98100        'wp-polyfill-fetch'           => '3.0.0',
    99101        'wp-polyfill-formdata'        => '3.0.12',
    100         'wp-polyfill-node-contains'   => '3.26.0-0',
     102        'wp-polyfill-node-contains'   => '3.42.0',
     103        'wp-polyfill-url'             => '3.42.0',
     104        'wp-polyfill-dom-rect'        => '3.42.0',
    101105        'wp-polyfill-element-closest' => '2.0.2',
    102106        'wp-polyfill'                 => '7.4.4',
     
    123127                '\'fetch\' in window' => 'wp-polyfill-fetch',
    124128                'document.contains'   => 'wp-polyfill-node-contains',
     129                'window.URL'          => 'wp-polyfill-url',
     130                'window.DOMRect'      => 'wp-polyfill-dom-rect',
    125131                'window.FormData && window.FormData.prototype.keys' => 'wp-polyfill-formdata',
    126132                'Element.prototype.matches && Element.prototype.closest' => 'wp-polyfill-element-closest',
Note: See TracChangeset for help on using the changeset viewer.