Skip to content

Commit 4c1b3a3

Browse files
committed
Use 500px as a better representation of an element that could be LCP
1 parent 5672b45 commit 4c1b3a3

9 files changed

+11
-11
lines changed

plugins/embed-optimizer/tests/test-cases/nested-figure-embed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ static function ( OD_Tag_Visitor_Context $context ) use ( $test_case ): bool {
101101
<link data-od-added-tag rel="preload" as="image" href="https://example.com/poster1.jpg">
102102
</head>
103103
<body>
104-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-video">
104+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-video">
105105
<div data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[1][self::FIGURE]/*[1][self::DIV]" class="wp-block-embed__wrapper">
106106
<video data-od-added-preload data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[1][self::FIGURE]/*[1][self::DIV]/*[1][self::VIDEO]" preload="auto" src="https://example.com/video1.mp4" poster="https://example.com/poster1.jpg" width="640" height="480"></video>
107107
</div>
108108
</figure>
109-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-rich is-provider-figurine wp-block-embed-figurine">
109+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-rich is-provider-figurine wp-block-embed-figurine">
110110
<div data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[2][self::FIGURE]/*[1][self::DIV]" class="wp-block-embed__wrapper">
111111
<figure>
112112
<p>So I heard you like <code>FIGURE</code>?</p>

plugins/embed-optimizer/tests/test-cases/single-spotify-embed-outside-viewport-with-subsequent-script.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<title>...</title>
3636
</head>
3737
<body>
38-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-rich is-provider-spotify wp-block-embed-spotify wp-embed-aspect-21-9 wp-has-aspect-ratio">
38+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-rich is-provider-spotify wp-block-embed-spotify wp-embed-aspect-21-9 wp-has-aspect-ratio">
3939
<div data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[1][self::FIGURE]/*[1][self::DIV]" class="wp-block-embed__wrapper">
4040
<iframe data-od-added-loading loading="lazy" title="Spotify Embed: Deep Focus" style="border-radius: 12px" width="100%" height="352" frameborder="0" allowfullscreen allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" src="https://open.spotify.com/embed/playlist/37i9dQZF1DWZeKCadgRdKQ?utm_source=oembed"></iframe>
4141
</div>

plugins/embed-optimizer/tests/test-cases/single-twitter-embed-inside-viewport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<link data-od-added-tag rel="preconnect" href="https://pbs.twimg.com">
3737
</head>
3838
<body>
39-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter">
39+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter">
4040
<div class="wp-block-embed__wrapper">
4141
<blockquote class="twitter-tweet" data-width="550" data-dnt="true"><p lang="en" dir="ltr">We want your feedback for the Privacy Sandbox 📨<br><br>Learn why your feedback is critical through real examples and learn how to provide it ↓ <a href="https://t.co/anGk6gWkbc">https://t.co/anGk6gWkbc</a></p>&mdash; Chrome for Developers (@ChromiumDev) <a href="https://twitter.com/ChromiumDev/status/1636796541368139777?ref_src=twsrc%5Etfw">March 17, 2023</a></blockquote>
4242
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

plugins/embed-optimizer/tests/test-cases/single-twitter-embed-outside-viewport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<title>...</title>
3535
</head>
3636
<body>
37-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter">
37+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter">
3838
<div class="wp-block-embed__wrapper">
3939
<blockquote class="twitter-tweet" data-width="550" data-dnt="true"><p lang="en" dir="ltr">We want your feedback for the Privacy Sandbox 📨<br><br>Learn why your feedback is critical through real examples and learn how to provide it ↓ <a href="https://t.co/anGk6gWkbc">https://t.co/anGk6gWkbc</a></p>&mdash; Chrome for Developers (@ChromiumDev) <a href="https://twitter.com/ChromiumDev/status/1636796541368139777?ref_src=twsrc%5Etfw">March 17, 2023</a></blockquote>
4040
<script data-od-added-type type="application/vnd.embed-optimizer.javascript" async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-inside-viewport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<link data-od-added-tag rel="preconnect" href="https://v0.wordpress.com">
4040
</head>
4141
<body>
42-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-video is-provider-wordpress-tv wp-block-embed-wordpress-tv wp-embed-aspect-16-9 wp-has-aspect-ratio">
42+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-video is-provider-wordpress-tv wp-block-embed-wordpress-tv wp-embed-aspect-16-9 wp-has-aspect-ratio">
4343
<div data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[1][self::FIGURE]/*[1][self::DIV]" class="wp-block-embed__wrapper">
4444
<iframe title="VideoPress Video Player" aria-label=\'VideoPress Video Player\' width=\'750\' height=\'422\' src=\'https://video.wordpress.com/embed/vaWm9zO6?hd=1&amp;cover=1\' frameborder=\'0\' allowfullscreen allow=\'clipboard-write\'></iframe>
4545
<script src=\'https://v0.wordpress.com/js/next/videopress-iframe.js?m=1674852142\'></script>

plugins/embed-optimizer/tests/test-cases/single-wordpress-tv-embed-outside-viewport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<title>...</title>
3636
</head>
3737
<body>
38-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-video is-provider-wordpress-tv wp-block-embed-wordpress-tv wp-embed-aspect-16-9 wp-has-aspect-ratio">
38+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-video is-provider-wordpress-tv wp-block-embed-wordpress-tv wp-embed-aspect-16-9 wp-has-aspect-ratio">
3939
<div data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[1][self::FIGURE]/*[1][self::DIV]" class="wp-block-embed__wrapper">
4040
<iframe data-od-added-loading loading="lazy" title="VideoPress Video Player" aria-label=\'VideoPress Video Player\' width=\'750\' height=\'422\' src=\'https://video.wordpress.com/embed/vaWm9zO6?hd=1&amp;cover=1\' frameborder=\'0\' allowfullscreen allow=\'clipboard-write\'></iframe>
4141
<script data-od-added-type type="application/vnd.embed-optimizer.javascript" src=\'https://v0.wordpress.com/js/next/videopress-iframe.js?m=1674852142\'></script>

plugins/embed-optimizer/tests/test-cases/single-youtube-embed-inside-viewport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<link data-od-added-tag rel="preconnect" href="https://i.ytimg.com">
3636
</head>
3737
<body>
38-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
38+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
3939
<div class="wp-block-embed__wrapper">
4040
<iframe title="Matt Mullenweg: State of the Word 2023" width="750" height="422" src="https://www.youtube.com/embed/c7M4mBVgP3Y?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
4141
</div>

plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<title>...</title>
3434
</head>
3535
<body>
36-
<figure data-od-added-style style="min-height: 100px;" class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
36+
<figure data-od-added-style style="min-height: 500px;" class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
3737
<div class="wp-block-embed__wrapper">
3838
<iframe data-od-added-loading loading="lazy" title="Matt Mullenweg: State of the Word 2023" width="750" height="422" src="https://www.youtube.com/embed/c7M4mBVgP3Y?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
3939
</div>

tests/class-optimization-detective-test-helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function populate_url_metrics( array $elements, bool $complete = true ):
5050
*/
5151
public function get_sample_dom_rect(): array {
5252
return array(
53-
'width' => 100.1,
54-
'height' => 100.2,
53+
'width' => 500.1,
54+
'height' => 500.2,
5555
'x' => 100.3,
5656
'y' => 100.4,
5757
'top' => 0.1,

0 commit comments

Comments
 (0)