Skip to content

Commit b41e32e

Browse files
committed
Script Loader: Remove "inline:" prefix from sourceURL.
The prefix may negatively impact some APIs such as the Long Animation Frames API. Developed in #9655. Follow-up to [60685]. Props jonsurrell, swissspidy. Fixes #63887. git-svn-id: https://develop.svn.wordpress.org/trunk@60686 602fd350-edb4-49c9-b593-d223f7449a82
1 parent bc10e6b commit b41e32e

File tree

6 files changed

+110
-110
lines changed

6 files changed

+110
-110
lines changed

src/wp-includes/class-wp-scripts.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function print_extra_script( $handle, $display = true ) {
223223
}
224224

225225
$output .= sprintf(
226-
"\n//# sourceURL=inline:%s",
226+
"\n//# sourceURL=%s",
227227
rawurlencode( "{$handle}-js-extra" )
228228
);
229229

@@ -527,7 +527,7 @@ public function get_inline_script_data( $handle, $position = 'after' ) {
527527
}
528528

529529
$data[] = sprintf(
530-
'//# sourceURL=inline:%s',
530+
'//# sourceURL=%s',
531531
rawurlencode( "{$handle}-js-{$position}" )
532532
);
533533

src/wp-includes/class-wp-styles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public function print_inline_style( $handle, $display = true ) {
338338
}
339339

340340
$output[] = sprintf(
341-
'/*# sourceURL=inline:%s */',
341+
'/*# sourceURL=%s */',
342342
rawurlencode( "{$handle}-inline-css" )
343343
);
344344

tests/phpunit/tests/blocks/editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ public function test_ensure_preload_data_script_tag_closes() {
762762
<script src="{$baseurl}/wp-includes/js/dist/api-fetch.min.js?ver=test" id="wp-api-fetch-js"></script>
763763
<script id="wp-api-fetch-js-after">
764764
wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( {"/test/v0/test-62797":{"body":["Unclosed comment and a script open tag \\u003C!--\\u003Cscript\\u003E"],"headers":{"Allow":"GET"}}} ) );
765-
//# sourceURL=inline:wp-api-fetch-js-after
765+
//# sourceURL=wp-api-fetch-js-after
766766
</script>
767767
768768
HTML;

0 commit comments

Comments
 (0)