@@ -45,6 +45,7 @@ final class Image_Prioritizer_Background_Image_Styled_Tag_Visitor extends Image_
45
45
/**
46
46
* Tuples of URL Metric group and the common LCP element external background image.
47
47
*
48
+ * @since n.e.x.t
48
49
* @var array<array{OD_URL_Metric_Group, LcpElementExternalBackgroundImage}>
49
50
*/
50
51
private $ group_common_lcp_element_external_background_images ;
@@ -87,7 +88,7 @@ public function __invoke( OD_Tag_Visitor_Context $context ): bool {
87
88
88
89
// If this element is the LCP (for a breakpoint group), add a preload link for it.
89
90
foreach ( $ context ->url_metric_group_collection ->get_groups_by_lcp_element ( $ xpath ) as $ group ) {
90
- $ this ->add_preload_link ( $ context ->link_collection , $ group , $ background_image_url );
91
+ $ this ->add_image_preload_link ( $ context ->link_collection , $ group , $ background_image_url );
91
92
}
92
93
93
94
$ this ->lazy_load_bg_images ( $ context );
@@ -169,7 +170,7 @@ private function maybe_preload_external_lcp_background_image( OD_Tag_Visitor_Con
169
170
&&
170
171
$ processor ->get_attribute ( 'class ' ) === $ common ['class ' ] // May be checking equality with null.
171
172
) {
172
- $ this ->add_preload_link ( $ context ->link_collection , $ group , $ common ['url ' ] );
173
+ $ this ->add_image_preload_link ( $ context ->link_collection , $ group , $ common ['url ' ] );
173
174
174
175
// Now that the preload link has been added, eliminate the entry to stop looking for it while iterating over the rest of the document.
175
176
unset( $ this ->group_common_lcp_element_external_background_images [ $ i ] );
@@ -186,7 +187,7 @@ private function maybe_preload_external_lcp_background_image( OD_Tag_Visitor_Con
186
187
* @param OD_URL_Metric_Group $group URL Metric group.
187
188
* @param non-empty-string $url Image URL.
188
189
*/
189
- private function add_preload_link ( OD_Link_Collection $ link_collection , OD_URL_Metric_Group $ group , string $ url ): void {
190
+ private function add_image_preload_link ( OD_Link_Collection $ link_collection , OD_URL_Metric_Group $ group , string $ url ): void {
190
191
$ link_collection ->add_link (
191
192
array (
192
193
'rel ' => 'preload ' ,
0 commit comments