WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

#38830 closed defect (bug) (fixed)

Customize: Prevent adding edit shortcuts to partial placement containers that cannot contain interactive element children

Reported by: westonruter Owned by: westonruter
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Customize Keywords: has-patch
Focuses: Cc:

Description

In working on #38672 to allow Jetpack to extend Custom CSS to use a pre-processor, the style element in the head is turned into a selective refresh partial placement. Now with #27403 there are edit shortcut buttons that get injected into the container elements for such partial placements. In the case of a style element, however, it is illegal for it to take child elements. Not only can it cause the CSS to no longer render but also the style element is in the head and cannot be displayed anyway, so it makes no sense to inject an edit shortcut.

For more (including a workaround), see https://wordpress.slack.com/archives/core-customize/p1479239811000710

Attachments (1)

38830.0.diff (1.3 KB) - added by westonruter 6 months ago.

Download all attachments as: .zip

Change History (5)

#1 @westonruter
6 months ago

  • Owner set to westonruter
  • Status changed from new to accepted

#2 @westonruter
6 months ago

List of elements I'm going to explicitly skip adding edit shortcuts into: 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

@westonruter
6 months ago

#3 @westonruter
6 months ago

  • Keywords has-patch added

#4 @westonruter
6 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 39270:

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.

Note: See TracTickets for help on using tickets.