Closed Bug 2071523 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 62637 - ContainerTiming: report the largest element as lastPaintedElement

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox158 fixed)

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 62637 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/62637
Details from upstream follow.

Jose Dapena Paz <jdapena@igalia.com> wrote:

ContainerTiming: report the largest element as lastPaintedElement

lastPaintedElement named whichever element happened to be the last one
whose paint grew the container's painted area. That is an artifact of the
order paints are processed in, not a useful answer to what is driving
updates on a large container root.

Report the largest element painted since the previous entry instead,
selected by its own clipped area, the way largest contentful paint selects
its candidates. Ties keep the earlier element, and the running maximum
resets on emission, so every entry reports the largest element painted
since the previous one.

Selecting instead by the area each element newly contributed to the
container was the other option, and is deliberately not used: the overlap
between two elements would go to whichever happened to paint first, which
varies both within a frame and across loads of the same page. An element's
own area does not.

Nomination happens before the region-containment check, so content painting
entirely inside the region painted so far can still be reported: it is a
contentful paint, it just grows nothing, so on its own it emits no entry.
Nothing re-nominates on a repaint, which is what makes that safe: each
element reaches container timing only once per content it paints, images
being deduplicated per (layout object, image resource) and text per
aggregating layout object.

Discussed in https://github.com/WICG/container-timing/issues/53, which asks
for exactly this and additionally suggests restricting candidates to the
elements that do grow the painted region. That restriction is deliberately
not applied, so that a single rule - largest by its own area - covers both
this per-entry maximum and the container's lifetime maximum added in a
later commit. The lifetime largest is then the maximum of the per-entry
ones, which it would not be if the two used different candidate sets.

Bug: 489959278
Change-Id: I4d0e707670b6cbdb56599b51ccee2bbf0412ce34

Reviewed-on: https://chromium-review.googlesource.com/8274795
WPT-Export-Revision: dcf8fd43202a6f18535b3f9a507bf32ecce82c5c

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 40 tests and 1 subtests

Status Summary

Firefox

OK : 3[GitHub] 40[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 42
FAIL: 1[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 3[GitHub]

Chrome

OK : 3
PASS: 1
FAIL: 2

Safari

OK : 3
FAIL: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.