1
1
<?php
2
2
return array (
3
3
'set_up ' => static function ( Test_Image_Prioritizer_Helper $ test_case ): void {
4
- $ breakpoint_max_widths = array ( 480 , 600 , 782 );
4
+ $ breakpoint_max_widths = array ( 480 , 600 , 782 , 1000 );
5
5
6
6
add_filter (
7
7
'od_breakpoint_max_widths ' ,
@@ -28,6 +28,10 @@ static function () use ( $breakpoint_max_widths ) {
28
28
'isLCP ' => false ,
29
29
'xpath ' => '/*[1][self::HTML]/*[2][self::BODY]/*[4][self::IMG] ' ,
30
30
),
31
+ array (
32
+ 'isLCP ' => false ,
33
+ 'xpath ' => '/*[1][self::HTML]/*[2][self::BODY]/*[5][self::IMG] ' ,
34
+ ),
31
35
);
32
36
$ elements [ $ i ]['isLCP ' ] = true ;
33
37
OD_URL_Metrics_Post_Type::store_url_metric (
@@ -52,6 +56,7 @@ static function () use ( $breakpoint_max_widths ) {
52
56
<img src="https://example.com/phablet-logo.png" alt="Phablet Logo" width="600" height="600" crossorigin="" referrerpolicy="no-referrer">
53
57
<img src="https://example.com/tablet-logo.png" alt="Tablet Logo" width="600" height="600" crossorigin="anonymous" referrerpolicy="no-referrer-when-downgrade">
54
58
<img src="https://example.net/desktop-logo.png" alt="Desktop Logo" width="600" height="600" crossorigin="use-credentials" referrerpolicy="origin-when-cross-origin">
59
+ <img src="https://example.net/ultra-desktop-logo.png" alt="Desktop Logo" width="600" height="600" crossorigin=" something-custom " referrerpolicy="same-origin">
55
60
</body>
56
61
</html>
57
62
' ,
@@ -63,13 +68,15 @@ static function () use ( $breakpoint_max_widths ) {
63
68
<link data-od-added-tag rel="preload" fetchpriority="high" as="image" href="https://example.com/mobile-logo.png" crossorigin="anonymous" media="screen and (max-width: 480px)">
64
69
<link data-od-added-tag rel="preload" fetchpriority="high" as="image" href="https://example.com/phablet-logo.png" crossorigin="anonymous" referrerpolicy="no-referrer" media="screen and (min-width: 481px) and (max-width: 600px)">
65
70
<link data-od-added-tag rel="preload" fetchpriority="high" as="image" href="https://example.com/tablet-logo.png" crossorigin="anonymous" referrerpolicy="no-referrer-when-downgrade" media="screen and (min-width: 601px) and (max-width: 782px)">
66
- <link data-od-added-tag rel="preload" fetchpriority="high" as="image" href="https://example.net/desktop-logo.png" crossorigin="use-credentials" referrerpolicy="origin-when-cross-origin" media="screen and (min-width: 783px)">
71
+ <link data-od-added-tag rel="preload" fetchpriority="high" as="image" href="https://example.net/desktop-logo.png" crossorigin="use-credentials" referrerpolicy="origin-when-cross-origin" media="screen and (min-width: 783px) and (max-width: 1000px)">
72
+ <link data-od-added-tag rel="preload" fetchpriority="high" as="image" href="https://example.net/ultra-desktop-logo.png" crossorigin="anonymous" referrerpolicy="same-origin" media="screen and (min-width: 1001px)">
67
73
</head>
68
74
<body>
69
75
<img data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[1][self::IMG]" src="https://example.com/mobile-logo.png" alt="Mobile Logo" width="600" height="600" crossorigin>
70
76
<img data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[2][self::IMG]" src="https://example.com/phablet-logo.png" alt="Phablet Logo" width="600" height="600" crossorigin="" referrerpolicy="no-referrer">
71
77
<img data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[3][self::IMG]" src="https://example.com/tablet-logo.png" alt="Tablet Logo" width="600" height="600" crossorigin="anonymous" referrerpolicy="no-referrer-when-downgrade">
72
78
<img data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[4][self::IMG]" src="https://example.net/desktop-logo.png" alt="Desktop Logo" width="600" height="600" crossorigin="use-credentials" referrerpolicy="origin-when-cross-origin">
79
+ <img data-od-xpath="/*[1][self::HTML]/*[2][self::BODY]/*[5][self::IMG]" src="https://example.net/ultra-desktop-logo.png" alt="Desktop Logo" width="600" height="600" crossorigin=" something-custom " referrerpolicy="same-origin">
73
80
<script type="module">/* import detect ... */</script>
74
81
</body>
75
82
</html>
0 commit comments