Skip to content

Commit 66e9404

Browse files
committed
Simplify conditional check for viewport
1 parent ce351c2 commit 66e9404

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

plugins/image-prioritizer/class-image-prioritizer-background-image-styled-tag-visitor.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,8 @@ private function lazy_load_bg_images( OD_Tag_Visitor_Context $context ): void {
121121

122122
$xpath = $processor->get_xpath();
123123

124-
$in_any_initial_viewport = $context->url_metric_group_collection->is_element_positioned_in_any_initial_viewport( $xpath );
125-
126124
// If the element is in the initial viewport, do not lazy load its background image.
127-
if ( true === $in_any_initial_viewport || null === $in_any_initial_viewport ) {
125+
if ( false !== $context->url_metric_group_collection->is_element_positioned_in_any_initial_viewport( $xpath ) ) {
128126
return;
129127
}
130128

0 commit comments

Comments
 (0)