Skip to content

Commit

Permalink
Use local DOMRect polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpayton committed Jul 13, 2018
1 parent 5a5c057 commit c70646e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ function gutenberg_register_scripts_and_styles() {
filemtime( gutenberg_dir_path() . 'build/core-data/index.js' ),
true
);
wp_register_script(
'wp-polyfill-domrect',
gutenberg_url( 'build/polyfills/DOMRect.js' ),
array(),
filemtime( gutenberg_dir_path() . 'build/polyfills/DOMRect.js' ),
true
);
wp_register_script(
'wp-dom',
gutenberg_url( 'build/dom/index.js' ),
Expand All @@ -186,6 +193,10 @@ function gutenberg_register_scripts_and_styles() {
'wp-dom',
gutenberg_get_script_polyfill( array(
'document.contains' => 'wp-polyfill-node-contains',
'"DOMRect" in this && ( function( DOMRect ) {' .
'try { return new DOMRect(); }' .
'catch (e) { return false; }' .
'}(this.DOMRect))' => 'wp-polyfill-domrect',
) ),
'before'
);
Expand Down

0 comments on commit c70646e

Please sign in to comment.