Skip to content

Commit

Permalink
Add Node#contains polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpayton authored Jun 1, 2018
1 parent a430f70 commit 0a6ea4c
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 @@ -150,6 +150,13 @@ function gutenberg_register_scripts_and_styles() {
filemtime( gutenberg_dir_path() . 'build/dom/index.js' ),
true
);
wp_add_inline_script(
'wp-dom',
gutenberg_get_script_polyfill( array(
'document.contains' => 'node-contains',
) ),
'before'
);
wp_register_script(
'wp-utils',
gutenberg_url( 'build/utils/index.js' ),
Expand Down Expand Up @@ -560,6 +567,10 @@ function gutenberg_register_vendor_scripts() {
'formdata',
'https://unpkg.com/formdata-polyfill@3.0.9/formdata.min.js'
);
gutenberg_register_vendor_script(
'node-contains',
'https://unpkg.com/polyfill-library@3.26.0-0/polyfills/Node/prototype/contains/polyfill.js'
);
}

/**
Expand Down

0 comments on commit 0a6ea4c

Please sign in to comment.