Make WordPress Core

Changeset 55181


Ignore:
Timestamp:
02/01/2023 08:42:23 PM (16 months ago)
Author:
hellofromTonya
Message:

Editor: Add 'wp-polyfill' to _wp_get_iframed_editor_assets() for inert 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:

Follow-up to [53160].

Props wildworks, mamaduka, youknowriad.
Fixes #57552.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r55179 r55181  
    299299    global $pagenow;
    300300
    301     $script_handles = array();
     301    $script_handles = array(
     302        'wp-polyfill',
     303    );
    302304    $style_handles  = array(
    303305        'wp-edit-blocks',
Note: See TracChangeset for help on using the changeset viewer.