Skip to content

Commit

Permalink
Add data prefix to preload attribute -- fixes #6672
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Jun 10, 2024
1 parent 342de5f commit d6b1fae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inc/Engine/Media/AboveTheFold/Frontend/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ private function generate_lcp_link_tag_with_sources( $lcp ): array {
}

$tag = '';
$start_tag = '<link rel="preload" rocket-preload as="image" ';
$start_tag = '<link rel="preload" data-rocket-preload as="image" ';
$end_tag = ' fetchpriority="high">';

$sources = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected function get_font_display_value(): string {
*/
protected function get_optimized_markup( string $url ): string {
return sprintf(
'<link rel="preload" rocket-preload as="style" href="%1$s" /><link rel="stylesheet" href="%1$s" media="print" onload="this.media=\'all\'" /><noscript><link rel="stylesheet" href="%1$s" /></noscript>', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
'<link rel="preload" data-rocket-preload as="style" href="%1$s" /><link rel="stylesheet" href="%1$s" media="print" onload="this.media=\'all\'" /><noscript><link rel="stylesheet" href="%1$s" /></noscript>', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
$url
);
}
Expand Down
2 changes: 1 addition & 1 deletion inc/Engine/Optimization/RUCSS/Controller/UsedCSS.php
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ private function preload_links( array $urls ): string {
$links = '';

foreach ( $urls as $url ) {
$links .= '<link rel="preload" rocket-preload as="font" href="' . esc_url( $url ) . '" crossorigin>';
$links .= '<link rel="preload" data-rocket-preload as="font" href="' . esc_url( $url ) . '" crossorigin>';
}

return $links;
Expand Down

0 comments on commit d6b1fae

Please sign in to comment.