tor-browser

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

commit 8fc7ca465b0ebc5f76afdd423335a4d018841d98
parent 0f9659ef8d5a8e06aff7903b76dda424100831a6
Author: Scott Haseley <shaseley@chromium.org>
Date:   Fri, 19 Dec 2025 09:15:56 +0000

Bug 2006130 [wpt PR 56743] - [soft navs] Refactor pending ICP entry buffering, a=testonly

Automatic update from web-platform-tests
[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}

--

wpt-commits: 955f8c2cb8569af524291e529a82294e66051c95
wpt-pr: 56743

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>