WordPress.org

Make WordPress Core

Changeset 39270


Ignore:
Timestamp:
11/16/2016 08:36:40 PM (19 months ago)
Author:
westonruter
Message:

Customize: Prevent edit shortcut buttons from being inserted into container elements in the head or into elements which should not get interactive children.

See #27403, #38672.
Fixes #38830.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/customize-selective-refresh.js

    r39202 r39270  
    110110         */
    111111        createEditShortcutForPlacement: function( placement ) {
    112             var partial = this, $shortcut, $placementContainer;
     112            var partial = this, $shortcut, $placementContainer, illegalAncestorSelector, illegalContainerSelector;
    113113            if ( ! placement.container ) {
    114114                return;
    115115            }
    116116            $placementContainer = $( placement.container );
    117             if ( ! $placementContainer.length ) {
     117            illegalAncestorSelector = 'head';
     118            illegalContainerSelector = 'area, audio, base, bdi, bdo, br, button, canvas, col, colgroup, command, datalist, embed, head, hr, html, iframe, img, input, keygen, label, link, map, math, menu, meta, noscript, object, optgroup, option, param, progress, rp, rt, ruby, script, select, source, style, svg, table, tbody, textarea, tfoot, thead, title, tr, track, video, wbr';
     119            if ( ! $placementContainer.length || $placementContainer.is( illegalContainerSelector ) || $placementContainer.closest( illegalAncestorSelector ).length ) {
    118120                return;
    119121            }
Note: See TracChangeset for help on using the changeset viewer.