Skip to content

Commit

Permalink
Bug 1915437 [wpt PR 47843] - Remove feature LCPMultipleUpdatesPerElem…
Browse files Browse the repository at this point in the history
…ent, a=testonly

Automatic update from web-platform-tests
Remove feature LCPMultipleUpdatesPerElement

This feature is to make the same element an LCP candidate again if it's
updated. It is added by this CL https://crrev.com/c/3924764. The
feature is never launched. We decided to remove it.

The CL that added this features seems only makes text layout objects
eligible for LCP by short-circuiting the already-seen check. Images
are not touched, although the commit msg seems to hint otherwise.

This CL removes the short-circuiting and modified the wpt.

Bug: 350536101
Change-Id: If0cb6ab99b488c1cc6ec7aff5ec3545ada49d39f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5781764
Commit-Queue: Hao Liu <haoliukchromium.org>
Reviewed-by: Ian Clelland <iclellandchromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhuchromium.org>
Cr-Commit-Position: refs/heads/main{#1348133}

--

wpt-commits: f128526ccd8caf549c98f609ad9d198e01e21a02
wpt-pr: 47843

UltraBlame original commit: 490886f6f8a20f51f1546db9219c22e09bb449bb
  • Loading branch information
marco-c committed Sep 6, 2024
1 parent 95a174d commit faed9f1
Showing 1 changed file with 79 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
LargestContentfulPaint
entries
should
generate
NOT
be
emitted
for
updates
to
previous
LargestContentfulPaint
nodes
elements
.
<
/
Expand Down Expand Up @@ -73,7 +75,9 @@
>
promise_test
(
async
(
t
)
=
>
Expand All @@ -92,155 +96,123 @@
)
;
let
countLcp
lcpEntries
=
0
;
let
firstLcp
=
null
[
]
;
const
timeoutPromise
=
await
new
Promise
(
resolve
=
>
t
.
step_timeout
(
(
)
=
>
{
resolve
(
new
Error
(
'
Did
not
observe
two
LCP
entries
'
)
)
}
3
*
1000
)
)
;
const
testPromise
=
new
Promise
(
resolve
=
>
{
new
PerformanceObserver
(
list
=
>
{
const
entries
lcpEntries
=
lcpEntries
.
concat
(
list
.
getEntries
(
)
;
for
(
const
entry
of
entries
)
{
+
+
countLcp
;
assert_equals
if
(
entry
lcpEntries
.
entryType
'
largest
-
contentful
-
paint
'
length
>
1
)
;
assert_equals
{
assert_unreached
(
entry
.
id
'
text
"
There
shouldn
'
)
;
if
(
countLcp
=
=
t
be
more
than
1
)
{
firstLcp
=
LCP
entry
for
an
element
.
"
)
;
}
else
if
(
countLcp
=
=
2
lcpEntries
)
{
assert_more_than
assert_equals
(
entry
lcpEntries
.
startTime
firstLcp
length
1
"
There
should
be
only
1
LCP
entry
for
one
element
.
startTime
"
)
;
assert_more_than
assert_equals
(
entry
.
size
firstLcp
lcpEntries
[
0
]
.
size
id
"
text
"
"
The
LCP
should
have
id
'
text
'
"
)
;
resolve
Expand All @@ -249,38 +221,29 @@
;
}
}
}
)
.
observe
(
{
entryTypes
type
:
[
'
largest
-
contentful
-
paint
'
]
buffered
:
true
}
)
;
}
200
)
;
return
Promise
.
race
(
[
timeoutPromise
testPromise
]
)
;
}
Expand Down

0 comments on commit faed9f1

Please sign in to comment.