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.


git-svn-id: https://develop.svn.wordpress.org/trunk@39270 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2016-11-16 20:36:40 +00:00
parent a9a8a9b121
commit 0dbb9c4248
1 changed files with 4 additions and 2 deletions

View File

@ -109,12 +109,14 @@ wp.customize.selectiveRefresh = ( function( $, api ) {
* @returns {void}
*/
createEditShortcutForPlacement: function( placement ) {
var partial = this, $shortcut, $placementContainer;
var partial = this, $shortcut, $placementContainer, illegalAncestorSelector, illegalContainerSelector;
if ( ! placement.container ) {
return;
}
$placementContainer = $( placement.container );
if ( ! $placementContainer.length ) {
illegalAncestorSelector = 'head';
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';
if ( ! $placementContainer.length || $placementContainer.is( illegalContainerSelector ) || $placementContainer.closest( illegalAncestorSelector ).length ) {
return;
}
$shortcut = partial.createEditShortcut();