tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 8706711f8e3fdeaa30173f655dda716ca7a5f590
parent e92a50083177d5a9b693d9ede69da0ab7e9e9ab3
Author: Scott Haseley <shaseley@chromium.org>
Date:   Wed,  7 Jan 2026 09:19:33 +0000

Bug 2008629 [wpt PR 56996] - Reland "[soft navs] Refactor pending ICP entry buffering", a=testonly

Automatic update from web-platform-tests
Reland "[soft navs] Refactor pending ICP entry buffering"

This is a reland of commit abe0507666c40f9ebd93498eaf2a76f4ddabadf5,
which was reverted because its prerequisite CL was reverted. There are
no changes in the reland.

Original change's description:
> [soft navs] Refactor pending ICP entry buffering
>
> Currently, SoftNavigationContext tracks the current largest text and
> image records, and uses those to emit the ICP performance entry and
> update metrics if and when the soft navigation entry is emitted. This CL
> changes this flow so that now we track the latest un-emitted
> InteractionContentfulPaint object and emit that directly. To do this,
> the LCP calculator continuously updates its state and calls the Delegate
> EmitPerformanceEntry method, but actual ICP emission is guarded there,
> where we either create and emit it synchronously or buffer it for later.
>
> This is being done because:
>  1. To unify ICP and LCP and to better control lifetime of
>     PaintTimingRecords (in advance of strongifying some of its fields),
>     we want to move the largest text and image tracking into the LCP
>     calculator. We don't plan to expose these values, as the records
>     themselves shouldn't be persisted beyond getting presentation
>     feedback, but SNC needs to buffer the latest candidate indefinitely.
>
>  2. We plan to guarantee the Node and MediaObject are alive through this
>     callback, which might not be the case now if the node is removed,
>     and capturing the state here ensures we have what we need for
>     emission.
>
> Bug: 454082771, 454082773
> Change-Id: I093d37960f774e5ca8946d8a0aa27cd9d592125f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7120640
> Reviewed-by: Michal Mocny <mmocny@chromium.org>
> Commit-Queue: Scott Haseley <shaseley@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1559386}

Bug: 454082771, 454082773
Change-Id: Id0b6545fa42c92dcb4fd99ffd79e4a2443660c58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7397615
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Michal Mocny <mmocny@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1564631}

--

wpt-commits: bff636b3365ad6927a2d3701cc38290cd019fd71
wpt-pr: 56996

Diffstat:
Mtesting/web-platform/tests/soft-navigation-heuristics/smoke/tentative/late-url-change.html | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/testing/web-platform/tests/soft-navigation-heuristics/smoke/tentative/late-url-change.html b/testing/web-platform/tests/soft-navigation-heuristics/smoke/tentative/late-url-change.html @@ -14,7 +14,7 @@ const URL = '/late-url-change'; navigateButton.addEventListener("click", async () => { - content.innerHTML = '<img src="/images/lcp-256x256.png" elementtiming="test-image"></img>'; + content.innerHTML = '<img id="target" src="/images/lcp-256x256.png" elementtiming="test-image"></img>'; const entries = await new Promise(resolve => { new PerformanceObserver((list, observer) => { @@ -31,6 +31,8 @@ const softNavPromise = SoftNavigationTestHelper.getPerformanceEntries("soft-navigation"); + const icpPromise = + SoftNavigationTestHelper.getPerformanceEntries("interaction-contentful-paint"); if (test_driver) { test_driver.click(navigateButton); @@ -43,5 +45,10 @@ assert_true( entries[0].name.endsWith(URL), 'Unexpected Soft Navigation URL.'); + + const icps = await helper.withTimeoutMessage( + icpPromise, 'ICP not detected.', /*timeout=*/ 3000); + assert_equals(icps.length, 1, 'Expected exactly one ICP entry.'); + assert_equals(icps[0].id, 'target', 'Expected ICP candidate to be "target"'); }, 'Soft Navigation Detection supports setting URL after paint'); </script>