Skip to content

Commit

Permalink
Editor: Add 'wp-polyfill' to _wp_get_iframed_editor_assets() for iner…
Browse files Browse the repository at this point in the history
…t attribute in Firefox.

Adds the polyfill script to the iframe to make the `inert` attribute work correctly in Firefox. This solves the problem that the site editor can operate on the block editor in Firefox even in browse mode.

Why?

The inert attribute is intended to render the element and its sub-tree elements `inert`, but Firefox doesn't support this attribute. For the `inert` attribute to work as intended in Firefox, even within an iframe, the script needs to be injected into the iframe as well as the global document.

References:
* [WordPress/gutenberg#47398 Gutenberg PR 47398].

Follow-up to [53160].

Props wildworks, mamaduka, youknowriad.
Fixes #57552.

git-svn-id: https://develop.svn.wordpress.org/trunk@55181 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
hellofromtonya committed Feb 1, 2023
1 parent 4c81af4 commit 8edf0e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wp-includes/block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ function get_legacy_widget_block_editor_settings() {
function _wp_get_iframed_editor_assets() {
global $pagenow;

$script_handles = array();
$script_handles = array(
'wp-polyfill',
);
$style_handles = array(
'wp-edit-blocks',
);
Expand Down

0 comments on commit 8edf0e8

Please sign in to comment.