Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#44551 closed defect (bug) (fixed)

Inline scripts should be printed for sourceless scripts

Reported by: bpayton's profile bpayton Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.0 Priority: normal
Severity: normal Version: 4.9.7
Component: Script Loader Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Today, inline scripts aren't printed for sourceless scripts, but inline styles are printed for sourceless styles.

It would be helpful to fix this for inline scripts.

This issue came up while exploring an approach to loading polyfills (feature tests + implementations) for Gutenberg.

I have a patch with unit tests and will post momentarily.

Attachments (1)

44551.diff (4.4 KB) - added by bpayton 6 years ago.
fix and unit tests

Download all attachments as: .zip

Change History (9)

@bpayton
6 years ago

fix and unit tests

#1 @bpayton
6 years ago

  • Keywords has-patch has-unit-tests added

This ticket was mentioned in Slack in #core by bpayton. View the logs.


6 years ago

#3 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 4.9.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
6 years ago

In 43564:

Script/Style Dependencies: Simplify some logic in WP_Styles::do_item().

Combine repetitive assignments, make the code more consistent with WP_Scripts::do_item().

See #44551.

#5 @SergeyBiryukov
6 years ago

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

In 43565:

Script/Style Dependencies: Make sure that inline scripts for handles without a source are printed.

See [36550] for WP_Styles.

Props bpayton.
Fixes #44551.

#6 @SergeyBiryukov
6 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.9.9 consideration.

#7 @pento
6 years ago

  • Keywords fixed-major removed
  • Milestone changed from 4.9.9 to 5.0

#8 @pento
6 years ago

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

In 43788:

Script/Style Dependencies: Make sure that inline scripts for handles without a source are printed.

See [36550] for WP_Styles.

Merges [43565] to the 5.0 branch.

Props bpayton.
Fixes #44551.

Note: See TracTickets for help on using tickets.