-
Notifications
You must be signed in to change notification settings - Fork 143
Compute responsive sizes attribute based on the width from the boundingClientRect in captured URL Metrics
#1840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4d39880
7b620c2
f964684
f606dac
a9fba2c
74c2ce6
df0c9e2
cdda7c3
6045b18
93961fa
eca53e6
d2b9a5c
4d0251a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,7 @@ | ||
| <?php | ||
| return static function ( Test_Image_Prioritizer_Helper $test_case ): void { | ||
| $slug = od_get_url_metrics_slug( od_get_normalized_query_vars() ); | ||
| $sample_size = od_get_url_metrics_breakpoint_sample_size(); | ||
| $outside_viewport_rect = array_merge( | ||
| $test_case->get_sample_dom_rect(), | ||
| array( | ||
| 'top' => 100000, | ||
| ) | ||
| ); | ||
| $slug = od_get_url_metrics_slug( od_get_normalized_query_vars() ); | ||
| $sample_size = od_get_url_metrics_breakpoint_sample_size(); | ||
| foreach ( array_merge( od_get_breakpoint_max_widths(), array( 1000 ) ) as $viewport_width ) { | ||
| for ( $i = 0; $i < $sample_size; $i++ ) { | ||
| OD_URL_Metrics_Post_Type::store_url_metric( | ||
|
|
@@ -31,31 +25,31 @@ | |
| 'intersectionRatio' => 0.0, // Subsequent carousel slide. | ||
| ), | ||
| array( | ||
| 'xpath' => '/HTML/BODY/DIV[@id=\'page\']/*[3][self::IMG]', | ||
| 'isLCP' => false, | ||
| 'intersectionRatio' => 0 === $i ? 0.5 : 0.0, // Make sure that the _max_ intersection ratio is considered. | ||
| 'xpath' => '/HTML/BODY/DIV[@id=\'page\']/*[3][self::IMG]', | ||
| 'isLCP' => false, | ||
| 'intersectionRatio' => 0 === $i ? 0.5 : 0.0, // Make sure that the _max_ intersection ratio is considered. | ||
| 'boundingClientRect' => array( | ||
| 'width' => $viewport_width - 10, | ||
| ), | ||
| ), | ||
| // All are outside all initial viewports. | ||
| array( | ||
| 'xpath' => '/HTML/BODY/DIV[@id=\'page\']/*[5][self::IMG]', | ||
| 'isLCP' => false, | ||
| 'intersectionRatio' => 0.0, | ||
| 'intersectionRect' => $outside_viewport_rect, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that the |
||
| 'boundingClientRect' => $outside_viewport_rect, | ||
| 'boundingClientRect' => array( 'top' => 100000 ), | ||
| ), | ||
| array( | ||
| 'xpath' => '/HTML/BODY/DIV[@id=\'page\']/*[6][self::IMG]', | ||
| 'isLCP' => false, | ||
| 'intersectionRatio' => 0.0, | ||
| 'intersectionRect' => $outside_viewport_rect, | ||
| 'boundingClientRect' => $outside_viewport_rect, | ||
| 'boundingClientRect' => array( 'top' => 100000 ), | ||
| ), | ||
| array( | ||
| 'xpath' => '/HTML/BODY/DIV[@id=\'page\']/*[7][self::IMG]', | ||
| 'isLCP' => false, | ||
| 'intersectionRatio' => 0.0, | ||
| 'intersectionRect' => $outside_viewport_rect, | ||
| 'boundingClientRect' => $outside_viewport_rect, | ||
| 'boundingClientRect' => array( 'top' => 100000 ), | ||
| ), | ||
| ), | ||
| ) | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.