[soft navs] Replace the need to "reset" LCP just to measure soft-LCP [chromium/src : main]

0 views
Skip to first unread message

Michal Mocny (Gerrit)

unread,
Jun 11, 2025, 12:07:03 PM6/11/25
to Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Michal Mocny . unresolved

This is a bit of an early review request. The mostly just removes code and adds back the minimum needed to still measure soft-nav-entry, without issuing LCP entry.

There are two LCP WPT that (expectedly) fail, and one test for Image based "distant-leaf". I tested the distant-leaf use case locally and I do see a soft-nav entry emitted for it, but this CL changes the timing for soft-nav paint to come after Images are fully loaded, so maybe just needs more timeout? Or maybe its related to buffered:true not working?

Still digging.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 5
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Jun 2025 16:06:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 11, 2025, 12:55:33 PM6/11/25
to Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

Patchset-level comments
File-level comment, Patchset 10 (Latest):
Michal Mocny . resolved

This patch is currently crashing renderer due to text paint aggregation. Happens more often with devtools. Feels likely related to Context* leaks between windows, now that we are storing it on the Record.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 10
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Jun 2025 16:55:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Johannes Henkel (Gerrit)

unread,
Jun 11, 2025, 1:13:25 PM6/11/25
to Michal Mocny, Scott Haseley, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Michal Mocny and Scott Haseley

Johannes Henkel added 1 comment

Patchset-level comments
Michal Mocny . unresolved

This is a bit of an early review request. The mostly just removes code and adds back the minimum needed to still measure soft-nav-entry, without issuing LCP entry.

There are two LCP WPT that (expectedly) fail, and one test for Image based "distant-leaf". I tested the distant-leaf use case locally and I do see a soft-nav entry emitted for it, but this CL changes the timing for soft-nav paint to come after Images are fully loaded, so maybe just needs more timeout? Or maybe its related to buffered:true not working?

Still digging.

Johannes Henkel

Is the new test passing for you? It did for me yesterday, but may be worth confirming in your context.

lcp-unbuffered.html from https://chromium-review.googlesource.com/c/chromium/src/+/6634990

Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 10
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Jun 2025 17:13:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 11, 2025, 1:35:36 PM6/11/25
to Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

Patchset-level comments
Michal Mocny . unresolved

This is a bit of an early review request. The mostly just removes code and adds back the minimum needed to still measure soft-nav-entry, without issuing LCP entry.

There are two LCP WPT that (expectedly) fail, and one test for Image based "distant-leaf". I tested the distant-leaf use case locally and I do see a soft-nav entry emitted for it, but this CL changes the timing for soft-nav paint to come after Images are fully loaded, so maybe just needs more timeout? Or maybe its related to buffered:true not working?

Still digging.

Johannes Henkel

Is the new test passing for you? It did for me yesterday, but may be worth confirming in your context.

lcp-unbuffered.html from https://chromium-review.googlesource.com/c/chromium/src/+/6634990

Michal Mocny

That one also isnt-- but I am breaking LCP reporting with this patch. (I mean, I don't even try to emit any soft-LCP candidates now).

The next patch in this series will re-do the mechanism for reporting soft-LCP and that test should start to pass again.

We will have a temporary moment w/o soft-LCP. We might not want to have that state on ToT and so we might want to merge both patches, but at least for review and early testing, I think it makes sense to keep separate.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 10
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Jun 2025 17:35:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Johannes Henkel (Gerrit)

unread,
Jun 11, 2025, 3:18:27 PM6/11/25
to Michal Mocny, Scott Haseley, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Michal Mocny and Scott Haseley

Johannes Henkel added 8 comments

Patchset-level comments
File-level comment, Patchset 11:
Johannes Henkel . resolved

Read through this, mostly focusing on the first parts with the detectors and sprinkled some nitpicks consider or not as you see fit. Epic change! :-)

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
Line 349, Patchset 11: SoftNavigationContext* context = nullptr;
if (LocalDOMWindow* window = frame_view_->GetFrame().DomWindow()) {
if (SoftNavigationHeuristics* heuristics =
window->GetSoftNavigationHeuristics()) {
context = heuristics->IsNeededForTiming(node);
}
}
Johannes Henkel . unresolved

could / should this be in a helper method, and only get invoked once you have a recorded image?

e.g. down just before l. 365, maybe it could say something along the lines of

SoftNavigationContext* context = GetContextIfNeededForTiming(node);

(or could pass the local dom window into there as well if you want to make it a helper in an anonymous namespace)

Line 403, Patchset 11: // above, since they both check
Johannes Henkel . unresolved

it feels like you were about to say something more here, perhaps?

Line 413, Patchset 11: if (record->soft_navigation_context_) {
Johannes Henkel . unresolved

Could this one effectively be an older context, since the context only gets updated if records_manager_ found the image in l. 363? Is that OK? (I think maybe yes - just means that an earlier interaction causes this paint to continue to trickle?)

Line 598, Patchset 11: // If we are recording LCP, take the timing unless the currect LCP is already
Johannes Henkel . unresolved

Please fix this WARNING reported by Spellchecker: "currect" is a possible misspelling of "correct" or "current".

Analyzer Description: Checks for common typos.
Owner: chops-so...@google.com

"currect" is a possible misspelling of "correct" or "current".

To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

Line 614, Patchset 11: if (bpp < kMinimumEntropyForLCP) {
Johannes Henkel . unresolved

So this entropy thing will now apply to both cases above, is that right?

Perhaps could move it earlier in the method / somedhow merge it with the other early exit?

File third_party/blink/renderer/core/paint/timing/paint_timing_detector.cc
Line 422, Patchset 11: text_update_result.first, image_update_result.first, false);
Johannes Henkel . unresolved

nitpick: is it easy-ish to put a name for the bool here still? is the AI right? :-)

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 132, Patchset 11: // be way more overhead (untill paint scoping). Consider maybe just
Johannes Henkel . unresolved

Please fix this WARNING reported by Spellchecker: "untill" is a possible misspelling of "until".

Analyzer Description: Checks for common typos.
Owner: chops-so...@google.com

"untill" is a possible misspelling of "until".

To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 11
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Jun 2025 19:18:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Scott Haseley (Gerrit)

unread,
Jun 11, 2025, 4:50:52 PM6/11/25
to Michal Mocny, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Michal Mocny

Scott Haseley added 14 comments

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
Line 413, Patchset 11: if (record->soft_navigation_context_) {
Johannes Henkel . unresolved

Could this one effectively be an older context, since the context only gets updated if records_manager_ found the image in l. 363? Is that OK? (I think maybe yes - just means that an earlier interaction causes this paint to continue to trickle?)

Scott Haseley

Also, what happens if the image record's element's context changes? (I think that's a different question).

Line 578, Patchset 11: frame_visual_rect, root_visual_rect, record_id.GetHash(), nullptr);
Scott Haseley . unresolved

maybe `/*soft_navigation_context=/*nullptr` for readability?

Line 599, Patchset 11: // larger
Scott Haseley . unresolved
```suggestion
// larger.
```
Line 600, Patchset 11: bool timing_needed_for_lcp =
Scott Haseley . unresolved

Any problems not returning if `timing_needed_for_lcp` is false? Wondering since you convinced yourself in the last patch to add this here, so wondering if we need a further check somewhere else after calling this.

Line 610, Patchset 11: if (!timing_needed_for_lcp && !timing_needed_for_soft_nav) {
Scott Haseley . unresolved

nit: consider just checking `soft_navigation_context` here and avoid the temporary. It's probably clear enough from the variable name and comment.

Line 614, Patchset 11: if (bpp < kMinimumEntropyForLCP) {
Johannes Henkel . unresolved

So this entropy thing will now apply to both cases above, is that right?

Perhaps could move it earlier in the method / somedhow merge it with the other early exit?

Scott Haseley

FWIW I think having a separate check is nice here, to differentiate the reasons we early-out and keep the conditions fairly simple.

File third_party/blink/renderer/core/paint/timing/paint_timing.cc
Line 493, Patchset 11: frame->View()->OnFirstContentfulPaint();
Scott Haseley . unresolved

The indent is off here - might need `git cl format`?

Line 614, Patchset 11: first_contentful_paint_presentation_ignoring_soft_navigations_.is_null());
Scott Haseley . unresolved

Can this be renamed?

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 127, Patchset 12: return !recorded_set_.Contains(&object);
Scott Haseley . unresolved

FYI: This was the line that was causing innerText to fail. Note that the TextRecord is associated with the aggregating node.

Line 179, Patchset 12: if (record->soft_navigation_context_) {
Scott Haseley . unresolved

I think this needs a null guard (MaybeRecordTextRecord can return nullptr)

Line 242, Patchset 12: root_visual_rect, 0u, false /* is_needed_for_timing */, nullptr);
Scott Haseley . unresolved

style nit: perhaps `/*soft_navigation_context=*/nullptr` (I think the one for false before it is on the wrong side, so maybe fix that too).

Line 296, Patchset 12: if (LocalDOMWindow* window = frame_view_->GetFrame().DomWindow()) {
Scott Haseley . unresolved

Same as image -- can this be null?

File third_party/blink/renderer/core/timing/performance_paint_timing.h
Line 22, Patchset 12: DOMWindow* sourcen);
Scott Haseley . unresolved
```suggestion
DOMWindow* source);
```
File third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
Line 103, Patchset 12: SoftNavigationContext* IsNeededForTiming(Node* node);
Scott Haseley . unresolved

Maybe`GetSoftNavigationContextForTiming()`? I've added a few (to be reviewed) `GetSoftNavigationContextFor_X()` in the new class for pre-paint attribution.

Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 12
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Wed, 11 Jun 2025 20:50:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 11, 2025, 11:11:26 PM6/11/25
to Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 19 comments

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
Line 349, Patchset 11: SoftNavigationContext* context = nullptr;

if (LocalDOMWindow* window = frame_view_->GetFrame().DomWindow()) {
if (SoftNavigationHeuristics* heuristics =
window->GetSoftNavigationHeuristics()) {
context = heuristics->IsNeededForTiming(node);
}
}
Johannes Henkel . resolved

could / should this be in a helper method, and only get invoked once you have a recorded image?

e.g. down just before l. 365, maybe it could say something along the lines of

SoftNavigationContext* context = GetContextIfNeededForTiming(node);

(or could pass the local dom window into there as well if you want to make it a helper in an anonymous namespace)

Michal Mocny

In all paths we need to check for context, so I thought doing it here was best.

If its an old record, we need to see if context changed.
If its a new record, we need to save the first value.

If anything needs a helper, its just making it easier to the the SNH instance. But I think we should discuss how we could re-organize the class relationships in a future patch.

Line 403, Patchset 11: // above, since they both check
Johannes Henkel . resolved

it feels like you were about to say something more here, perhaps?

Michal Mocny

I no longe recall :P I think something along the lines of "check if first video frame was shown" but I think its a redundant comment. I'll remove this.

Line 413, Patchset 11: if (record->soft_navigation_context_) {
Johannes Henkel . resolved

Could this one effectively be an older context, since the context only gets updated if records_manager_ found the image in l. 363? Is that OK? (I think maybe yes - just means that an earlier interaction causes this paint to continue to trickle?)

Scott Haseley

Also, what happens if the image record's element's context changes? (I think that's a different question).

Michal Mocny

Nit: Both branches assign context (Line 375 makes a new record with initial context)

Whenever we paint, we check if we need to "update" to a newer context, and attribute that paint to this latest context. We will always do a lookup (currently via tree walk) for every paint of every node.

(Matter of fact, I could add a CHECK here that this `== context` from above.)

This is also why the Pre-Paint walk will be quite useful... we will "just know" the context automatically.

---

However, there are some risks in other places which might need careful audit:

  • After paint we still have to measure presentation time, and we'll update the record timestamps, and then call update LCP candidate... We won't re-check context if dom changed in the mean time... (small risk)
  • After a Context "finds" a largest image/text candidate it caches a reference to it. If the context "for that record" changes, we won't "remove" that record from any existing Contexts. In theory, that means that Context A could paint media and then Context B could paint over that same media, and we risk Context A "seeing it". (More serious risk, but perhaps we are fine in current patch given other constraints).
  • Others?
Line 578, Patchset 11: frame_visual_rect, root_visual_rect, record_id.GetHash(), nullptr);
Scott Haseley . resolved

maybe `/*soft_navigation_context=/*nullptr` for readability?

Michal Mocny

Done (I have a vscode plugin that does this automatically and the extra comments actually make this less readable-- but I agree for code search etc it is useful)

Line 598, Patchset 11: // If we are recording LCP, take the timing unless the currect LCP is already
Johannes Henkel . resolved

Please fix this WARNING reported by Spellchecker: "currect" is a possible misspelling of "correct" or "current".

Analyzer Description: Checks for common typos.
Owner: chops-so...@google.com

"currect" is a possible misspelling of "correct" or "current".

To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

Michal Mocny

Done

Scott Haseley . resolved
```suggestion
// larger.
```
Michal Mocny

Done

Line 600, Patchset 11: bool timing_needed_for_lcp =
Scott Haseley . unresolved

Any problems not returning if `timing_needed_for_lcp` is false? Wondering since you convinced yourself in the last patch to add this here, so wondering if we need a further check somewhere else after calling this.

Michal Mocny

soft-LCP is a type of LCP.

Although there shouldn't be any far downstream side effects since LCP calculator checks if LCP is stopped-- I do think we could move this check down just a but further to limit how much needless bookkeeping we do for hard-LCP after its been stopped.

I'll work on that next.

Line 610, Patchset 11: if (!timing_needed_for_lcp && !timing_needed_for_soft_nav) {
Scott Haseley . resolved

nit: consider just checking `soft_navigation_context` here and avoid the temporary. It's probably clear enough from the variable name and comment.

Michal Mocny

I... disagree. But only because I've been trying to reverse engineer all the places where we have various checks which seems obvious but are subtle. I'm trying to unify to similar names and conditions as needed.

(I agree this one is pretty simple)

Line 614, Patchset 11: if (bpp < kMinimumEntropyForLCP) {
Johannes Henkel . resolved

So this entropy thing will now apply to both cases above, is that right?

Perhaps could move it earlier in the method / somedhow merge it with the other early exit?

Scott Haseley

FWIW I think having a separate check is nice here, to differentiate the reasons we early-out and keep the conditions fairly simple.

Michal Mocny

This early exit always applied to soft-LCP, but, it now also applies to soft-nav-entry paint area requirement since now we only record if we create a record (and after its loaded).

I will leave it as-is.

File third_party/blink/renderer/core/paint/timing/paint_timing.cc
Line 493, Patchset 11: frame->View()->OnFirstContentfulPaint();
Scott Haseley . resolved

The indent is off here - might need `git cl format`?

Michal Mocny

Git cl format actually isn't fixing this! (I get warnings when I upload otherwise).

I actually manually fixed it once... and I think cl format actually broke it back ><. I'll try again.

Line 614, Patchset 11: first_contentful_paint_presentation_ignoring_soft_navigations_.is_null());
Scott Haseley . resolved

Can this be renamed?

Michal Mocny

Done

File third_party/blink/renderer/core/paint/timing/paint_timing_detector.cc
Line 422, Patchset 11: text_update_result.first, image_update_result.first, false);
Johannes Henkel . resolved

nitpick: is it easy-ish to put a name for the bool here still? is the AI right? :-)

Michal Mocny

Done

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 127, Patchset 12: return !recorded_set_.Contains(&object);
Scott Haseley . resolved

FYI: This was the line that was causing innerText to fail. Note that the TextRecord is associated with the aggregating node.

Michal Mocny

Agreed. I will try to do something similar as I did for Images, where I can check if the Node's Context was "changed" since last paint, and re-record paint if so.

However:
(a) But this requires keeping TextRecords around (I wrote this up in a comment or crbug, somewhere...)
(b) it requires a context dom tree walk here... and we would do that for a lot of nodes. Pre-Paint would fix that

(I might even remove the Image re-recording part from this patch, since its fairly new and unneeded.)

Line 132, Patchset 11: // be way more overhead (untill paint scoping). Consider maybe just
Johannes Henkel . resolved

Please fix this WARNING reported by Spellchecker: "untill" is a possible misspelling of "until".

Analyzer Description: Checks for common typos.
Owner: chops-so...@google.com

"untill" is a possible misspelling of "until".

To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

Michal Mocny

Acknowledged

Line 179, Patchset 12: if (record->soft_navigation_context_) {
Scott Haseley . resolved

I think this needs a null guard (MaybeRecordTextRecord can return nullptr)

Michal Mocny

Ah-- I think you found my bug!

I switched to using `context` directly since it should always be the same, but, we really do only want to do this when record is actually created.

Line 242, Patchset 12: root_visual_rect, 0u, false /* is_needed_for_timing */, nullptr);
Scott Haseley . resolved

style nit: perhaps `/*soft_navigation_context=*/nullptr` (I think the one for false before it is on the wrong side, so maybe fix that too).

Michal Mocny

Done

Line 296, Patchset 12: if (LocalDOMWindow* window = frame_view_->GetFrame().DomWindow()) {
Scott Haseley . unresolved

Same as image -- can this be null?

Michal Mocny

Do you mean to suggest that we don't need to check if its null?

File third_party/blink/renderer/core/timing/performance_paint_timing.h
Line 22, Patchset 12: DOMWindow* sourcen);
Scott Haseley . resolved
```suggestion
DOMWindow* source);
```
Michal Mocny

Done

File third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
Line 103, Patchset 12: SoftNavigationContext* IsNeededForTiming(Node* node);
Scott Haseley . resolved

Maybe`GetSoftNavigationContextForTiming()`? I've added a few (to be reviewed) `GetSoftNavigationContextFor_X()` in the new class for pre-paint attribution.

Michal Mocny

No joke, I had this same thought but didn't have time to come up with a new name..

This was my CL review bait :P Keen eyes!

I was thinking something like "TryGetParentContext", but I think the input Node* output SNC* makes this fairly self documenting.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 14
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Jun 2025 03:11:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 11, 2025, 11:23:17 PM6/11/25
to Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 116, Patchset 14:bool TextPaintTimingDetector::ShouldWalkObject(
Michal Mocny . unresolved

Note to reviewers:

Until we have "pre-paint" Context* caching, trying to ask the question "ShouldWalkObject" requires a dom walk. This might happen for a lot of nodes.

This feels like it could be more expensive than just saying "yes", and allowing the .Contains check below, which will usually still return false, but I'm not sure.

It does currently mean that some text nodes which were never previously recorded, might start to become recorded.

--

Some ideas to make this better:

  • Until we have Pre-Paint walk to simplify getting context, maybe I could at least just ask SNH if there is any context/soft-nav at all going on.
  • Maybe we should still be adding nodes which are skipped to recorded_set. Then, we could check recorded_set first, and only then check if is_needed_for_soft_nav... If not, still add to recorded_set (after all, Image paint timing does this-- it adds to recorded set even if decides not to measure paint or create a Record)
Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 15
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Jun 2025 03:23:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 12, 2025, 9:03:23 AM6/12/25
to Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 2 comments

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
Line 375, Patchset 16 (Latest): records_manager_.RecordFirstPaintAndMaybeCreateImageRecord(
Michal Mocny . unresolved

Woops-- there was a bug here I forgot to assign `record =` so we wouldnt "see" images the first time they are painted.

This was a bug and likely cause of some WPT fails.

Line 600, Patchset 11: bool timing_needed_for_lcp =
Scott Haseley . unresolved

Any problems not returning if `timing_needed_for_lcp` is false? Wondering since you convinced yourself in the last patch to add this here, so wondering if we need a further check somewhere else after calling this.

Michal Mocny

soft-LCP is a type of LCP.

Although there shouldn't be any far downstream side effects since LCP calculator checks if LCP is stopped-- I do think we could move this check down just a but further to limit how much needless bookkeeping we do for hard-LCP after its been stopped.

I'll work on that next.

Michal Mocny

Alright, there are three special `ImageRecords` that are kept around outside of just the record-keeping set:

`largest_painted_image_`, `largest_pending_image_`, both used to implement `ImageRecordsManager::LargestImage()` , and that is only accessed via `ImagePaintTimingDetector::UpdateMetricsCandidate()`.

However:

Still-- I changed to guard updating these values for all pathways when LCP is no longer recording. Just in case any accessors do other things (even in the future).

---

The other value is: `largest_ignored_image_`.

Ultimately, this is used to track "ignored LCP canddiate" when opacity is 0, but only for a very special case of content directly on `documentElement`? and toggled when opacity goes from 0 to non-0 here: (https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_object.cc;l=3141;drc=997022c9de8c1e4ed9081b8789c1057d0fce0e28;bpv=1;bpt=1)

When toggled, this pathway just reports/updates through the normal path (the one above), so any restrictions we put there should be enough... Still, I also guarded this one.

---

There might be other implications I'm not finding, but I think this is fine: we are updating the background bookkeeping but none of the "LCP-effects now" and we always guarded the "Emit" side from doing anything.

Perf timeline seems okay, I might do some double checking on Tracing/metrics in case we over-report while bookkeeping (but I dont see anything atm)

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 16
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Jun 2025 13:03:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 12, 2025, 11:53:37 AM6/12/25
to Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 3 comments

Patchset-level comments
Michal Mocny . unresolved

This is a bit of an early review request. The mostly just removes code and adds back the minimum needed to still measure soft-nav-entry, without issuing LCP entry.

There are two LCP WPT that (expectedly) fail, and one test for Image based "distant-leaf". I tested the distant-leaf use case locally and I do see a soft-nav entry emitted for it, but this CL changes the timing for soft-nav paint to come after Images are fully loaded, so maybe just needs more timeout? Or maybe its related to buffered:true not working?

Still digging.

Johannes Henkel

Is the new test passing for you? It did for me yesterday, but may be worth confirming in your context.

lcp-unbuffered.html from https://chromium-review.googlesource.com/c/chromium/src/+/6634990

Michal Mocny

That one also isnt-- but I am breaking LCP reporting with this patch. (I mean, I don't even try to emit any soft-LCP candidates now).

The next patch in this series will re-do the mechanism for reporting soft-LCP and that test should start to pass again.

We will have a temporary moment w/o soft-LCP. We might not want to have that state on ToT and so we might want to merge both patches, but at least for review and early testing, I think it makes sense to keep separate.

Michal Mocny

It now works! So do lots of other tests now, except one known expected failure.

I will run a dry-run to see what else still breaks.

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
Line 375, Patchset 16: records_manager_.RecordFirstPaintAndMaybeCreateImageRecord(
Michal Mocny . resolved

Woops-- there was a bug here I forgot to assign `record =` so we wouldnt "see" images the first time they are painted.

This was a bug and likely cause of some WPT fails.

Michal Mocny

Done

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 116, Patchset 14:bool TextPaintTimingDetector::ShouldWalkObject(
Michal Mocny . unresolved

Note to reviewers:

Until we have "pre-paint" Context* caching, trying to ask the question "ShouldWalkObject" requires a dom walk. This might happen for a lot of nodes.

This feels like it could be more expensive than just saying "yes", and allowing the .Contains check below, which will usually still return false, but I'm not sure.

It does currently mean that some text nodes which were never previously recorded, might start to become recorded.

--

Some ideas to make this better:

  • Until we have Pre-Paint walk to simplify getting context, maybe I could at least just ask SNH if there is any context/soft-nav at all going on.
  • Maybe we should still be adding nodes which are skipped to recorded_set. Then, we could check recorded_set first, and only then check if is_needed_for_soft_nav... If not, still add to recorded_set (after all, Image paint timing does this-- it adds to recorded set even if decides not to measure paint or create a Record)
Michal Mocny

I changed this as discussed above.

Leaving comment open so you see it during next review.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 22
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Jun 2025 15:53:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 12, 2025, 2:57:55 PM6/12/25
to Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

Patchset-level comments
File-level comment, Patchset 23 (Latest):
Michal Mocny . resolved

Excellent, CQ found only 2 tests fail, one which is expected and I'll update test expectations now.

The other is the new devtools protocol test-- I don't know if I changed the Tracing data or if the test itself is needing an update.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 23
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Thu, 12 Jun 2025 18:57:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Scott Haseley (Gerrit)

unread,
Jun 12, 2025, 8:31:20 PM6/12/25
to Michal Mocny, Chromium LUCI CQ, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Michal Mocny

Scott Haseley added 6 comments

Patchset-level comments
Scott Haseley . resolved

Didn't get through it all, but spent some time poking at the `ShouldWalkObject()` difference (see comment). I'll review the rest tomorrow.

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
Line 578, Patchset 11: frame_visual_rect, root_visual_rect, record_id.GetHash(), nullptr);
Scott Haseley . resolved

maybe `/*soft_navigation_context=/*nullptr` for readability?

Michal Mocny

Done (I have a vscode plugin that does this automatically and the extra comments actually make this less readable-- but I agree for code search etc it is useful)

Scott Haseley

FYI there is a style guide rule for this, which is why I mentioned it. https://google.github.io/styleguide/cppguide.html#Function_Argument_Comments. And yeah, it's helpful for us curmudgeons using a vim + codesearch workflow :)

File third_party/blink/renderer/core/paint/timing/largest_contentful_paint_calculator.cc
Line 125, Patchset 23 (Latest): // TODO(mmocny): Create a new entry type, specific to soft-navs
Scott Haseley . unresolved

Do we want/have a bug for this?

File third_party/blink/renderer/core/paint/timing/paint_timing_detector.h
Line 140, Patchset 23 (Latest): // TODO(mmocny):
Scott Haseley . unresolved

Is there more to this, or is the TODO the comment below? (here and below). I can't tell if these are placeholders/things that need to happen this CL or not.

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 143, Patchset 23 (Latest): recorded_set_.insert(&aggregator);
Scott Haseley . unresolved

I think change this is observable through elementtiming. There's an assumption that this cannot go from false to true for the same node, but I think it's actually possible.

This is probably silly, but I constructed an example where I think the behavior is different (confirmed on ToT with just adding this line, so I think it's valid).

Example: https://paste.googleplex.com/6045216999735296.

The textarea should autofocus. If you type abc (or any three separate keystrokes) in the text area (it should autofocus), you'll get a PerformanceElementTiming entry without the change, but not with it. This happens because:
1. Keystroke 1 stops lcp
2. Keystroke 2 adds a div w/ background color, which gets painted. There's no elementtiming on the div, LCP has stopped bc of keystroke 1, and the keystroke was not targeted at <body> (so no SNC), so we mark it recorded. Without this line, we might possibly revisit the node
3. Keystroke 3 adds elementtiming to the div and appends a text node, which causes us to hit this again. We get different results because of the recorded set logic because there was no text the first time it painted (so RecordAggregatedText didn't get called).
Line 296, Patchset 12: if (LocalDOMWindow* window = frame_view_->GetFrame().DomWindow()) {
Scott Haseley . resolved

Same as image -- can this be null?

Michal Mocny

Do you mean to suggest that we don't need to check if its null?

Scott Haseley

Yeah wondering if we need the check, since I wouldn't think we could paint with a null window. Fine to keep it though. I'll resolve.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Michal Mocny
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 23
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 00:31:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 13, 2025, 8:58:37 AM6/13/25
to Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 5 comments

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
Line 578, Patchset 11: frame_visual_rect, root_visual_rect, record_id.GetHash(), nullptr);
Scott Haseley . resolved

maybe `/*soft_navigation_context=/*nullptr` for readability?

Michal Mocny

Done (I have a vscode plugin that does this automatically and the extra comments actually make this less readable-- but I agree for code search etc it is useful)

Scott Haseley

FYI there is a style guide rule for this, which is why I mentioned it. https://google.github.io/styleguide/cppguide.html#Function_Argument_Comments. And yeah, it's helpful for us curmudgeons using a vim + codesearch workflow :)

Michal Mocny

I'm also a vim + codesearch curmudgeon... I just switched to vscode + neovim because...chromium. Its a bit buggy and slow sometimes which is annoying but some of the features are worth it to me.

File third_party/blink/renderer/core/paint/timing/largest_contentful_paint_calculator.cc
Line 125, Patchset 23 (Latest): // TODO(mmocny): Create a new entry type, specific to soft-navs
Scott Haseley . resolved

Do we want/have a bug for this?

Michal Mocny

We do, Issue 424433918, I will update comment, thanks.

File third_party/blink/renderer/core/paint/timing/paint_timing_detector.h
Scott Haseley . resolved

Is there more to this, or is the TODO the comment below? (here and below). I can't tell if these are placeholders/things that need to happen this CL or not.

Michal Mocny

This was a note to self and should have been removed.
(Some of these members could be removed, but not this one, but the comment made me unsure)

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 143, Patchset 23 (Latest): recorded_set_.insert(&aggregator);
Scott Haseley . unresolved

I think change this is observable through elementtiming. There's an assumption that this cannot go from false to true for the same node, but I think it's actually possible.

This is probably silly, but I constructed an example where I think the behavior is different (confirmed on ToT with just adding this line, so I think it's valid).

Example: https://paste.googleplex.com/6045216999735296.

The textarea should autofocus. If you type abc (or any three separate keystrokes) in the text area (it should autofocus), you'll get a PerformanceElementTiming entry without the change, but not with it. This happens because:
1. Keystroke 1 stops lcp
2. Keystroke 2 adds a div w/ background color, which gets painted. There's no elementtiming on the div, LCP has stopped bc of keystroke 1, and the keystroke was not targeted at <body> (so no SNC), so we mark it recorded. Without this line, we might possibly revisit the node
3. Keystroke 3 adds elementtiming to the div and appends a text node, which causes us to hit this again. We get different results because of the recorded set logic because there was no text the first time it painted (so RecordAggregatedText didn't get called).
Michal Mocny

Good catch.

However, I think this is acceptable.

Late application of `elementtiming` after first paint of the element is already very random and unpredictable. In the test above, you are making it work by:

If any of those criteria you mention above changed, elementtiming wouldn't work (and folks already know to work around this but ensuring attribute set before content added to dom).

---

Additionally, I think we can "fix it even better", soon:

  • We already plan to recognize updates to text nodes and "reset" the recorded bit (or some other mechanism) esp if we have a Context change
  • We could just extend this to do it regardless of context change if we want (this would support text "growing" for LCP candidate-- risky), or
  • Just specifically look for first application of elementtiming attribute and re-record the paint timing if so.

---

Alternatively, once we make Node->Context cheaper via PrePaint walk, then we don't need this cache, because we won't mind checking this "every single paint" quite as much.

I still think its more consistent to do it.

File third_party/blink/renderer/core/timing/soft_navigation_context.cc
Line 184, Patchset 23 (Latest):void SoftNavigationContext::UpdateSoftLcpCandidate() {
Michal Mocny . resolved

Right now this only gets called after we measure paint timing for an animation frame.

But what happens if:

  • URL updates
  • We start measuring paints, and tracking largest content
  • We emit soft-nav entry
  • No more paints

I wonder if soft-nav entry emitting should also "flush" existing paint timings. We only Emit after OnPaintFinished so it should be safe to do so, but, the issue with Paint->Presentation time starts to become relevant...

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 23
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 12:58:27 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 13, 2025, 9:07:43 AM6/13/25
to Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 143, Patchset 23: recorded_set_.insert(&aggregator);
Scott Haseley . unresolved

I think change this is observable through elementtiming. There's an assumption that this cannot go from false to true for the same node, but I think it's actually possible.

This is probably silly, but I constructed an example where I think the behavior is different (confirmed on ToT with just adding this line, so I think it's valid).

Example: https://paste.googleplex.com/6045216999735296.

The textarea should autofocus. If you type abc (or any three separate keystrokes) in the text area (it should autofocus), you'll get a PerformanceElementTiming entry without the change, but not with it. This happens because:
1. Keystroke 1 stops lcp
2. Keystroke 2 adds a div w/ background color, which gets painted. There's no elementtiming on the div, LCP has stopped bc of keystroke 1, and the keystroke was not targeted at <body> (so no SNC), so we mark it recorded. Without this line, we might possibly revisit the node
3. Keystroke 3 adds elementtiming to the div and appends a text node, which causes us to hit this again. We get different results because of the recorded set logic because there was no text the first time it painted (so RecordAggregatedText didn't get called).
Michal Mocny

Good catch.

However, I think this is acceptable.

Late application of `elementtiming` after first paint of the element is already very random and unpredictable. In the test above, you are making it work by:

If any of those criteria you mention above changed, elementtiming wouldn't work (and folks already know to work around this but ensuring attribute set before content added to dom).

---

Additionally, I think we can "fix it even better", soon:

  • We already plan to recognize updates to text nodes and "reset" the recorded bit (or some other mechanism) esp if we have a Context change
  • We could just extend this to do it regardless of context change if we want (this would support text "growing" for LCP candidate-- risky), or
  • Just specifically look for first application of elementtiming attribute and re-record the paint timing if so.

---

Alternatively, once we make Node->Context cheaper via PrePaint walk, then we don't need this cache, because we won't mind checking this "every single paint" quite as much.

I still think its more consistent to do it.

Michal Mocny

And to add-- on current Chrome release we will clear this recorded set of nodes as soon as user Interacts (for soft-nav measurement v1).

I think that probably also broke `elementtiming` in even worse ways?

If thats right, then this new regression is to a new behaviour that hasn't branched yet :P

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 24
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 13:07:34 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 13, 2025, 12:07:40 PM6/13/25
to AyeAye, Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 3 comments

Patchset-level comments
File-level comment, Patchset 5:
Michal Mocny . resolved

This is a bit of an early review request. The mostly just removes code and adds back the minimum needed to still measure soft-nav-entry, without issuing LCP entry.

There are two LCP WPT that (expectedly) fail, and one test for Image based "distant-leaf". I tested the distant-leaf use case locally and I do see a soft-nav entry emitted for it, but this CL changes the timing for soft-nav paint to come after Images are fully loaded, so maybe just needs more timeout? Or maybe its related to buffered:true not working?

Still digging.

Johannes Henkel

Is the new test passing for you? It did for me yesterday, but may be worth confirming in your context.

lcp-unbuffered.html from https://chromium-review.googlesource.com/c/chromium/src/+/6634990

Michal Mocny

That one also isnt-- but I am breaking LCP reporting with this patch. (I mean, I don't even try to emit any soft-LCP candidates now).

The next patch in this series will re-do the mechanism for reporting soft-LCP and that test should start to pass again.

We will have a temporary moment w/o soft-LCP. We might not want to have that state on ToT and so we might want to merge both patches, but at least for review and early testing, I think it makes sense to keep separate.

Michal Mocny

It now works! So do lots of other tests now, except one known expected failure.

I will run a dry-run to see what else still breaks.

Michal Mocny

Done

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
Line 600, Patchset 11: bool timing_needed_for_lcp =
Scott Haseley . resolved

Any problems not returning if `timing_needed_for_lcp` is false? Wondering since you convinced yourself in the last patch to add this here, so wondering if we need a further check somewhere else after calling this.

Michal Mocny

soft-LCP is a type of LCP.

Although there shouldn't be any far downstream side effects since LCP calculator checks if LCP is stopped-- I do think we could move this check down just a but further to limit how much needless bookkeeping we do for hard-LCP after its been stopped.

I'll work on that next.

Michal Mocny

Alright, there are three special `ImageRecords` that are kept around outside of just the record-keeping set:

`largest_painted_image_`, `largest_pending_image_`, both used to implement `ImageRecordsManager::LargestImage()` , and that is only accessed via `ImagePaintTimingDetector::UpdateMetricsCandidate()`.

However:

Still-- I changed to guard updating these values for all pathways when LCP is no longer recording. Just in case any accessors do other things (even in the future).

---

The other value is: `largest_ignored_image_`.

Ultimately, this is used to track "ignored LCP canddiate" when opacity is 0, but only for a very special case of content directly on `documentElement`? and toggled when opacity goes from 0 to non-0 here: (https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/layout_object.cc;l=3141;drc=997022c9de8c1e4ed9081b8789c1057d0fce0e28;bpv=1;bpt=1)

When toggled, this pathway just reports/updates through the normal path (the one above), so any restrictions we put there should be enough... Still, I also guarded this one.

---

There might be other implications I'm not finding, but I think this is fine: we are updating the background bookkeeping but none of the "LCP-effects now" and we always guarded the "Emit" side from doing anything.

Perf timeline seems okay, I might do some double checking on Tracing/metrics in case we over-report while bookkeeping (but I dont see anything atm)

Michal Mocny

Done

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 116, Patchset 14:bool TextPaintTimingDetector::ShouldWalkObject(
Michal Mocny . resolved

Note to reviewers:

Until we have "pre-paint" Context* caching, trying to ask the question "ShouldWalkObject" requires a dom walk. This might happen for a lot of nodes.

This feels like it could be more expensive than just saying "yes", and allowing the .Contains check below, which will usually still return false, but I'm not sure.

It does currently mean that some text nodes which were never previously recorded, might start to become recorded.

--

Some ideas to make this better:

  • Until we have Pre-Paint walk to simplify getting context, maybe I could at least just ask SNH if there is any context/soft-nav at all going on.
  • Maybe we should still be adding nodes which are skipped to recorded_set. Then, we could check recorded_set first, and only then check if is_needed_for_soft_nav... If not, still add to recorded_set (after all, Image paint timing does this-- it adds to recorded set even if decides not to measure paint or create a Record)
Michal Mocny

I changed this as discussed above.

Leaving comment open so you see it during next review.

Michal Mocny

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 27
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 16:07:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Johannes Henkel (Gerrit)

unread,
Jun 13, 2025, 2:09:23 PM6/13/25
to Michal Mocny, AyeAye, Chromium LUCI CQ, Scott Haseley, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Michal Mocny and Scott Haseley

Johannes Henkel added 1 comment

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 136, Patchset 28: if (!IsRecordingLargestTextPaint() &&
!TextElementTiming::NeededForTiming(*node)) {
Johannes Henkel . unresolved

nitpick: maybe this could say

if (IsRecordingLargestTextPaint() || TextElementTiming::NeededForTiming(*node))
return true;

and perhaps similar to some more of the stuff below, to reduce nesting (and double negatives) a bit?
Open in Gerrit

Related details

Attention is currently required from:
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 28
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 18:09:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 13, 2025, 2:14:53 PM6/13/25
to AyeAye, Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 136, Patchset 28: if (!IsRecordingLargestTextPaint() &&
!TextElementTiming::NeededForTiming(*node)) {
Johannes Henkel . unresolved

nitpick: maybe this could say

if (IsRecordingLargestTextPaint() || TextElementTiming::NeededForTiming(*node))
return true;

and perhaps similar to some more of the stuff below, to reduce nesting (and double negatives) a bit?
Michal Mocny

Oh yeah, now that this has swapped order, we can do this.

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 29
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 18:14:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 13, 2025, 2:30:44 PM6/13/25
to AyeAye, Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 136, Patchset 28: if (!IsRecordingLargestTextPaint() &&
!TextElementTiming::NeededForTiming(*node)) {
Johannes Henkel . resolved

nitpick: maybe this could say

if (IsRecordingLargestTextPaint() || TextElementTiming::NeededForTiming(*node))
return true;

and perhaps similar to some more of the stuff below, to reduce nesting (and double negatives) a bit?
Michal Mocny

Oh yeah, now that this has swapped order, we can do this.

Michal Mocny

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 30
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 18:30:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 13, 2025, 3:42:35 PM6/13/25
to AyeAye, Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny voted and added 1 comment

Votes added by Michal Mocny

Auto-Submit+1
Commit-Queue+1

1 comment

File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
Line 143, Patchset 23: recorded_set_.insert(&aggregator);
Scott Haseley . resolved

I think change this is observable through elementtiming. There's an assumption that this cannot go from false to true for the same node, but I think it's actually possible.

This is probably silly, but I constructed an example where I think the behavior is different (confirmed on ToT with just adding this line, so I think it's valid).

Example: https://paste.googleplex.com/6045216999735296.

The textarea should autofocus. If you type abc (or any three separate keystrokes) in the text area (it should autofocus), you'll get a PerformanceElementTiming entry without the change, but not with it. This happens because:
1. Keystroke 1 stops lcp
2. Keystroke 2 adds a div w/ background color, which gets painted. There's no elementtiming on the div, LCP has stopped bc of keystroke 1, and the keystroke was not targeted at <body> (so no SNC), so we mark it recorded. Without this line, we might possibly revisit the node
3. Keystroke 3 adds elementtiming to the div and appends a text node, which causes us to hit this again. We get different results because of the recorded set logic because there was no text the first time it painted (so RecordAggregatedText didn't get called).
Michal Mocny

Good catch.

However, I think this is acceptable.

Late application of `elementtiming` after first paint of the element is already very random and unpredictable. In the test above, you are making it work by:

If any of those criteria you mention above changed, elementtiming wouldn't work (and folks already know to work around this but ensuring attribute set before content added to dom).

---

Additionally, I think we can "fix it even better", soon:

  • We already plan to recognize updates to text nodes and "reset" the recorded bit (or some other mechanism) esp if we have a Context change
  • We could just extend this to do it regardless of context change if we want (this would support text "growing" for LCP candidate-- risky), or
  • Just specifically look for first application of elementtiming attribute and re-record the paint timing if so.

---

Alternatively, once we make Node->Context cheaper via PrePaint walk, then we don't need this cache, because we won't mind checking this "every single paint" quite as much.

I still think its more consistent to do it.

Michal Mocny

And to add-- on current Chrome release we will clear this recorded set of nodes as soon as user Interacts (for soft-nav measurement v1).

I think that probably also broke `elementtiming` in even worse ways?

If thats right, then this new regression is to a new behaviour that hasn't branched yet :P

Michal Mocny

Resolving this, after conversation with Scott.

(I somewhat think this should likely have always worked this way)

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 31
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 19:42:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Annie Sullivan (Gerrit)

unread,
Jun 13, 2025, 3:47:36 PM6/13/25
to Michal Mocny, AyeAye, Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel, Michal Mocny and Scott Haseley

Annie Sullivan voted

Code-Review+1
Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Michal Mocny
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 31
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 19:47:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Jun 13, 2025, 3:48:26 PM6/13/25
to Annie Sullivan, AyeAye, Chromium LUCI CQ, Scott Haseley, Johannes Henkel, chromium...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny voted Auto-Submit+0

Auto-Submit+0
Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
Gerrit-Change-Number: 6638389
Gerrit-PatchSet: 31
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
Gerrit-Comment-Date: Fri, 13 Jun 2025 19:48:17 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Scott Haseley (Gerrit)

unread,
Jun 13, 2025, 4:16:37 PM6/13/25
to Michal Mocny, Annie Sullivan, AyeAye, Chromium LUCI CQ, Johannes Henkel, chromium...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
Attention needed from Johannes Henkel and Michal Mocny

Scott Haseley voted and added 8 comments

Votes added by Scott Haseley

Code-Review+1

8 comments

Patchset-level comments
File-level comment, Patchset 31 (Latest):
Scott Haseley . resolved

LGTM w/ nits

File chrome/browser/page_load_metrics/integration_tests/soft_navigation_metrics_browsertest.cc
Line 534, Patchset 31 (Latest):IN_PROC_BROWSER_TEST_P(SoftNavigationTest, NoSoftNavigation) {
Scott Haseley . unresolved

If this is being re-enabled intentionally, can you remove the lines above?

File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.h
Line 110, Patchset 29: WeakMember<SoftNavigationContext> soft_navigation_context_;
Scott Haseley . resolved
As a follow-up, we should fix the style in this franken-class-struct:
- `lcp_rect_info_` and this variable are named with class style
- everything else is named like it's a struct
- All members are public

Given it's kind of a mess, no this name seems fine for now
Line 47, Patchset 29:class SoftNavigationContext;
Scott Haseley . unresolved

nit: Remove? Alternatively remove the include and don't inline the c'tor.

File third_party/blink/renderer/core/timing/soft_navigation_context.cc
Line 182, Patchset 31 (Latest):// calculator), or, just skip this next step if the candidates arent done.
Scott Haseley . unresolved

Please fix this WARNING reported by Spellchecker: "arent" is a possible misspelling of "aren't".

Analyzer Description: Checks for common typos.
Owner: chops-so...@google.com

"arent" is a possible misspelling of "aren't".

To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

Line 196, Patchset 31 (Latest): if (!WasEmitted() || !lcp_calculator_) {
Scott Haseley . unresolved

nit: Can we remove this check? This can never be null since it's created in the constructor and never cleared.

I was wondering, however, if there's any advantage to waiting until something paints to create it? I guess only if we end up getting a lot of SNCs without paint, so probably not worth it.

File third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
Line 103, Patchset 31 (Latest): // Rename this
Scott Haseley . unresolved

Remove?

File third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
Line 212, Patchset 31 (Latest): // TODO:
// if (RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_)) {
Scott Haseley . unresolved

Remove? Or is something needed here?

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Michal Mocny
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 31
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 20:16:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    Jun 13, 2025, 4:32:06 PM6/13/25
    to Michal Mocny, Scott Haseley, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan and Michal Mocny

    Johannes Henkel added 9 comments

    Patchset-level comments
    Johannes Henkel . resolved

    Epic cL! I read to soft_navigation_context.cc, will continue but figure I should send my scribbles.

    File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.h
    Line 70, Patchset 31 (Latest): frame_visual_rect, gfx::ToRoundedRect(root_visual_rect));
    Johannes Henkel . unresolved

    So there's now potentially lcp_rect_info_ with a rounded root_visual_rect and also root_visual_rect saved without rounding into a field.

    Line 70, Patchset 31 (Latest): frame_visual_rect, gfx::ToRoundedRect(root_visual_rect));
    Johannes Henkel . unresolved

    now stored both as a rounded thingy when tracing is enabled, and in the field above, root_visual_rect

    Line 53, Patchset 31 (Latest):class CORE_EXPORT ImageRecord : public GarbageCollected<ImageRecord> {
    Johannes Henkel . unresolved

    curiosity: why is it needed, this cl only touches stuff in blink/renderer/core, is that right? do we need it between the two subdirectories as well?

    File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
    Line 374, Patchset 31 (Latest): IsRecordingLargestImagePaint(), record_id, rect_size, image_border,
    Johannes Henkel . unresolved

    this went from !IsRecording to IsRecording - intentionally?

    Line 626, Patchset 31 (Latest): if (bpp < kMinimumEntropyForLCP) {
    Johannes Henkel . unresolved

    i may have asked this before (it's blurry) -

    this line means we're also imposing the minimum lcp entropy for soft navs, is that right? since even if l. 620 makes timing_needed_for_soft_nav true, we'll actually return nullptr in l. 627?

    File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.h
    Line 59, Patchset 31 (Latest): gfx::RectF root_visual_rect_;
    std::unique_ptr<LCPRectInfo> lcp_rect_info_;
    Johannes Henkel . unresolved

    also potentially redundant storage of the root_visual_rect

    here, it's actually slightly easier to see since you put the two fields next to each other? might do that as well in the other header file (image_paint_timing_detector.h)?

    File third_party/blink/renderer/core/timing/soft_navigation_context.cc
    Line 182, Patchset 31 (Latest):// calculator), or, just skip this next step if the candidates arent done.
    Johannes Henkel . unresolved

    Please fix this WARNING reported by Spellchecker: "arent" is a possible misspelling of "aren't".

    Analyzer Description: Checks for common typos.
    Owner: chops-so...@google.com

    "arent" is a possible misspelling of "aren't".

    To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    • Michal Mocny
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 31
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 20:31:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    Jun 13, 2025, 4:45:09 PM6/13/25
    to Michal Mocny, Scott Haseley, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan and Michal Mocny

    Johannes Henkel voted Code-Review+1

    Code-Review+1
    Gerrit-Comment-Date: Fri, 13 Jun 2025 20:44:58 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Jun 13, 2025, 5:01:40 PM6/13/25
    to Johannes Henkel, Scott Haseley, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan and Johannes Henkel

    Michal Mocny added 16 comments

    Patchset-level comments
    Johannes Henkel . resolved

    Epic cL! I read to soft_navigation_context.cc, will continue but figure I should send my scribbles.

    Michal Mocny

    Ty!

    File chrome/browser/page_load_metrics/integration_tests/soft_navigation_metrics_browsertest.cc
    Line 534, Patchset 31 (Latest):IN_PROC_BROWSER_TEST_P(SoftNavigationTest, NoSoftNavigation) {
    Scott Haseley . resolved

    If this is being re-enabled intentionally, can you remove the lines above?

    Michal Mocny

    It wasn't, It should remain MAYBE_.

    I had DISABLED_ it then realize we pass this one because.... still no soft nav :P

    File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.h
    Line 70, Patchset 31 (Latest): frame_visual_rect, gfx::ToRoundedRect(root_visual_rect));
    Johannes Henkel . resolved

    now stored both as a rounded thingy when tracing is enabled, and in the field above, root_visual_rect

    Michal Mocny

    Good observation. I'll punt because the tracking enabled track doesn't matter and I dont understand this use case-- but the whole shape of Image/Text Records could do with a nice audit!

    Line 70, Patchset 31 (Latest): frame_visual_rect, gfx::ToRoundedRect(root_visual_rect));
    Johannes Henkel . resolved

    So there's now potentially lcp_rect_info_ with a rounded root_visual_rect and also root_visual_rect saved without rounding into a field.

    Michal Mocny

    Acknowledged

    Line 53, Patchset 31 (Latest):class CORE_EXPORT ImageRecord : public GarbageCollected<ImageRecord> {
    Johannes Henkel . resolved

    curiosity: why is it needed, this cl only touches stuff in blink/renderer/core, is that right? do we need it between the two subdirectories as well?

    Michal Mocny

    I needed it or else linking w/ component build would fail.

    I assume because ImageRecord is in paint/timing and SNH/SNC are in core/timing, but I didn't dig deeper than that.

    (Maybe CORE_EXPORT is a bit of a misnomer?)

    Line 110, Patchset 29: WeakMember<SoftNavigationContext> soft_navigation_context_;
    Scott Haseley . resolved
    As a follow-up, we should fix the style in this franken-class-struct:
    - `lcp_rect_info_` and this variable are named with class style
    - everything else is named like it's a struct
    - All members are public

    Given it's kind of a mess, no this name seems fine for now
    Michal Mocny

    Agree! I think I added `_` by accident because the TextRecords use that style and I pasted to make consistent between them... so that needs fixing too.

    Line 47, Patchset 29:class SoftNavigationContext;
    Scott Haseley . resolved

    nit: Remove? Alternatively remove the include and don't inline the c'tor.

    Michal Mocny

    Done

    File third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
    Line 374, Patchset 31 (Latest): IsRecordingLargestImagePaint(), record_id, rect_size, image_border,
    Johannes Henkel . resolved

    this went from !IsRecording to IsRecording - intentionally?

    Michal Mocny

    Correct! It used to be used in a different way so instead of "ignore unless.." it now just passes "is_recording_lcp"

    Line 626, Patchset 31 (Latest): if (bpp < kMinimumEntropyForLCP) {
    Johannes Henkel . resolved

    i may have asked this before (it's blurry) -

    this line means we're also imposing the minimum lcp entropy for soft navs, is that right? since even if l. 620 makes timing_needed_for_soft_nav true, we'll actually return nullptr in l. 627?

    Michal Mocny

    Correct.

    We now enforce ALL "contentful" criteria before "observing" the paint.

    There is a distinction in semantics for FCP and LCP, and I may want to poke SNH:: to inform of FCP in a future patch-- but in terms of Area tracking and LCP candidates, we want to unify the conditions here.

    File third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.h
    Line 59, Patchset 31 (Latest): gfx::RectF root_visual_rect_;
    std::unique_ptr<LCPRectInfo> lcp_rect_info_;
    Johannes Henkel . resolved

    also potentially redundant storage of the root_visual_rect

    here, it's actually slightly easier to see since you put the two fields next to each other? might do that as well in the other header file (image_paint_timing_detector.h)?

    Michal Mocny

    Totally agree, but punting since I dont want to audit the tracing use cases right now.

    File third_party/blink/renderer/core/timing/soft_navigation_context.cc
    Line 156, Patchset 31 (Parent): dict.Add("unattributedPaintedArea", unattributed_area_);
    Johannes Henkel . resolved
    Michal Mocny

    TY!

    Line 182, Patchset 31 (Latest):// calculator), or, just skip this next step if the candidates arent done.
    Johannes Henkel . resolved

    Please fix this WARNING reported by Spellchecker: "arent" is a possible misspelling of "aren't".

    Analyzer Description: Checks for common typos.
    Owner: chops-so...@google.com

    "arent" is a possible misspelling of "aren't".

    To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

    Michal Mocny

    Done

    Line 182, Patchset 31 (Latest):// calculator), or, just skip this next step if the candidates arent done.
    Scott Haseley . resolved

    Please fix this WARNING reported by Spellchecker: "arent" is a possible misspelling of "aren't".

    Analyzer Description: Checks for common typos.
    Owner: chops-so...@google.com

    "arent" is a possible misspelling of "aren't".

    To bypass Spellchecker, add a footer with DISABLE_SPELLCHECKER

    Michal Mocny

    Done

    Line 196, Patchset 31 (Latest): if (!WasEmitted() || !lcp_calculator_) {
    Scott Haseley . resolved

    nit: Can we remove this check? This can never be null since it's created in the constructor and never cleared.

    I was wondering, however, if there's any advantage to waiting until something paints to create it? I guess only if we end up getting a lot of SNCs without paint, so probably not worth it.

    Michal Mocny

    Done

    File third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
    Scott Haseley . resolved

    Remove?

    Michal Mocny

    Done

    File third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
    Line 212, Patchset 31 (Latest): // TODO:
    // if (RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_)) {
    Scott Haseley . resolved

    Remove? Or is something needed here?

    Michal Mocny

    Good eye. I think we might still want this, and I left the comment to not forget (then forgot).

    We need this to ensure we don't Emit LCP when the feature flag is off. However, the risk is mostly quite limited in that the entries are guarded by the PerformanceObserver flag, and the PerforamnceObserver won't expose the entry type to JS.

    But emitting entries for no reason risks issuing traces or something, so I wrapped that with a guard. This might change as we add-back UKM.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    • Johannes Henkel
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 31
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 21:01:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Jun 13, 2025, 5:05:21 PM6/13/25
    to Johannes Henkel, Scott Haseley, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan and Johannes Henkel

    Michal Mocny voted Commit-Queue+2

    Commit-Queue+2
    Gerrit-Comment-Date: Fri, 13 Jun 2025 21:05:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Jun 13, 2025, 5:07:07 PM6/13/25
    to Johannes Henkel, Scott Haseley, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan and Johannes Henkel

    Michal Mocny voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    • Johannes Henkel
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 32
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 21:06:57 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Johannes Henkel (Gerrit)

    unread,
    Jun 13, 2025, 6:53:25 PM6/13/25
    to Michal Mocny, Scott Haseley, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan, Michal Mocny and Scott Haseley

    Johannes Henkel voted and added 1 comment

    Votes added by Johannes Henkel

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 33 (Latest):
    Johannes Henkel . resolved

    amazing cl!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    • Michal Mocny
    • Scott Haseley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 33
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 22:53:15 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Jun 13, 2025, 6:55:31 PM6/13/25
    to Michal Mocny, Johannes Henkel, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan and Michal Mocny

    Scott Haseley voted and added 1 comment

    Votes added by Scott Haseley

    Code-Review+1

    1 comment

    Patchset-level comments
    Scott Haseley . resolved

    Still LGTM

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    • Michal Mocny
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 33
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 22:55:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Jun 13, 2025, 7:15:51 PM6/13/25
    to Scott Haseley, Johannes Henkel, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, devtools-re...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan

    Michal Mocny voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 35
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 23:15:41 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Jun 13, 2025, 7:17:19 PM6/13/25
    to Scott Haseley, Johannes Henkel, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, devtools-re...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan

    Michal Mocny voted Commit-Queue+0

    Commit-Queue+0
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 35
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 23:17:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Jun 13, 2025, 7:53:00 PM6/13/25
    to Scott Haseley, Johannes Henkel, Annie Sullivan, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, devtools-re...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org
    Attention needed from Annie Sullivan

    Michal Mocny voted Commit-Queue+2

    Commit-Queue+2
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Annie Sullivan
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Review
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 36
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
    Gerrit-Comment-Date: Fri, 13 Jun 2025 23:52:50 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Jun 13, 2025, 9:01:02 PM6/13/25
    to Michal Mocny, Scott Haseley, Johannes Henkel, Annie Sullivan, AyeAye, chromium...@chromium.org, devtools-re...@chromium.org, csharris...@chromium.org, loading-rev...@chromium.org, speed-metr...@chromium.org, bmcquad...@chromium.org, blink-revie...@chromium.org, lighthouse-eng-extern...@google.com, blink-rev...@chromium.org, blink-...@chromium.org, core-timi...@chromium.org, speed-metrics...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    33 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: third_party/blink/renderer/core/timing/window_performance.cc
    Insertions: 5, Deletions: 0.

    @@ -1485,6 +1485,11 @@
    const String& url,
    Element* element,
    bool is_triggered_by_soft_navigation) {
    + if (is_triggered_by_soft_navigation &&
    + !RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(
    + GetExecutionContext())) {
    + return;
    + }
    DOMHighResTimeStamp load_timestamp =
    MonotonicTimeToDOMHighResTimeStamp(load_time);

    ```
    ```
    The name of the file: third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
    Insertions: 2, Deletions: 1.

    @@ -399,7 +399,6 @@
    auto* performance = DOMWindowPerformance::performance(*window_.Get());
    performance->AddSoftNavigationEntry(AtomicString(context->InitialUrl()),
    context->UserInteractionTimestamp());
    -
    ReportSoftNavigationToMetrics(frame, context);

    TRACE_EVENT_INSTANT("scheduler,devtools.timeline,loading",
    @@ -431,6 +430,8 @@
    if (!context_for_current_url_) {
    return;
    }
    + // Performance timeline won't allow emitting LCP entries without this flag,
    + // but we can save a lot of needless work by also just not even trying.
    if (RuntimeEnabledFeatures::SoftNavigationHeuristicsEnabled(window_)) {
    context_for_current_url_->UpdateSoftLcpCandidate();
    }
    ```
    ```
    The name of the file: third_party/blink/web_tests/http/tests/inspector-protocol/tracing/soft-navigations-expected.txt
    Insertions: 1, Deletions: 0.

    @@ -73,3 +73,4 @@
    tid: number
    ts: number
    }
    +
    ```
    ```
    The name of the file: third_party/blink/renderer/core/paint/timing/paint_timing_detector.cc
    Insertions: 4, Deletions: 6.

    @@ -245,7 +245,7 @@
    void PaintTimingDetector::OnInputOrScroll() {
    // If we have already stopped and we're no longer recording the largest image
    // paint, then abort.
    - if (!image_paint_timing_detector_->IsRecordingLargestImagePaint()) {
    + if (!record_lcp_to_metrics_) {
    return;
    }

    @@ -319,11 +319,9 @@
    return;
    }

    - if (record_lcp_to_metrics_) {
    - auto latest_lcp_details =
    - GetLargestContentfulPaintCalculator()->LatestLcpDetails();
    - lcp_details_for_metrics_ = latest_lcp_details;
    - }
    + auto latest_lcp_details =
    + GetLargestContentfulPaintCalculator()->LatestLcpDetails();
    + lcp_details_for_metrics_ = latest_lcp_details;

    DidChangePerformanceTiming();
    }
    ```
    ```
    The name of the file: third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
    Insertions: 2, Deletions: 1.

    @@ -306,6 +306,7 @@
    }
    }

    + bool is_needed_for_lcp = IsRecordingLargestTextPaint();
    bool can_report_timing =
    text_element_timing_ ? text_element_timing_->CanReportElements() : false;
    HeapVector<Member<const LayoutObject>> keys_to_be_removed;
    @@ -319,7 +320,7 @@
    text_element_timing_->OnTextObjectPainted(*record, paint_timing_info);
    }

    - if (ltp_manager_ && (record->recorded_size > 0u)) {
    + if (is_needed_for_lcp && ltp_manager_ && (record->recorded_size > 0u)) {
    ltp_manager_->MaybeUpdateLargestText(record);
    }
    keys_to_be_removed.push_back(key);
    ```

    Change information

    Commit message:
    [soft navs] Replace the need to "reset" LCP just to measure soft-LCP

    Previously, we required clearing text and image paint records, as well
    as managing a "restarted" state for image LCP, just to record paint
    timings for soft navigation detection.

    Now, we change the paint timing detectors to continue to record even
    after hard-LCP stops, because there are more clients for this
    information (hard LCP and Interactions-->Paints, which power soft LCP).
    We may also want to unify image element timing after this, similar to
    text element timing.

    With this change, we remove all the old mechanics for "LCP resetting"
    used for soft-navs measurement since we can now just keep observing the
    stream of new paints.

    However, as a side effect of this, we also add a new implementation for
    soft-LCP, powered by the Interaction Context and emitted directly from
    PaintRecords that it observers, rather than the global LCP algorithm.

    ---

    Some other changes/improvements:
    - Change to only record loaded Images for soft-navs, rather than first paint of images.
    - Change to only record Images which are "contentful", rather than all image paints even if it may be invisible content.
    - Subtle changes to element-timing for text which has been previously painted and which has a late addition of elementtiming attribute.
    Bug: 422754019, 335199284, 419822831, 419386429, 406258702, 379844650
    Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Commit-Queue: Michal Mocny <mmo...@chromium.org>
    Reviewed-by: Scott Haseley <shas...@chromium.org>
    Reviewed-by: Johannes Henkel <joha...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1473852}
    Files:
    • M chrome/browser/page_load_metrics/integration_tests/soft_navigation_metrics_browsertest.cc
    • M third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.cc
    • M third_party/blink/renderer/core/paint/timing/image_paint_timing_detector.h
    • M third_party/blink/renderer/core/paint/timing/largest_contentful_paint_calculator.cc
    • M third_party/blink/renderer/core/paint/timing/largest_contentful_paint_calculator.h
    • M third_party/blink/renderer/core/paint/timing/paint_timing.cc
    • M third_party/blink/renderer/core/paint/timing/paint_timing.h
    • M third_party/blink/renderer/core/paint/timing/paint_timing_detector.cc
    • M third_party/blink/renderer/core/paint/timing/paint_timing_detector.h
    • M third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.cc
    • M third_party/blink/renderer/core/paint/timing/text_paint_timing_detector.h
    • M third_party/blink/renderer/core/timing/performance.cc
    • M third_party/blink/renderer/core/timing/performance.h
    • M third_party/blink/renderer/core/timing/performance_paint_timing.cc
    • M third_party/blink/renderer/core/timing/performance_paint_timing.h
    • M third_party/blink/renderer/core/timing/soft_navigation_context.cc
    • M third_party/blink/renderer/core/timing/soft_navigation_context.h
    • M third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc
    • M third_party/blink/renderer/core/timing/soft_navigation_heuristics.h
    • M third_party/blink/renderer/core/timing/soft_navigation_heuristics_test.cc
    • M third_party/blink/renderer/core/timing/window_performance.cc
    • M third_party/blink/renderer/core/timing/window_performance.h
    • A third_party/blink/web_tests/external/wpt/soft-navigation-heuristics/softnav-before-lcp-paint.tentative-expected.txt
    • M third_party/blink/web_tests/http/tests/inspector-protocol/tracing/soft-navigations-expected.txt
    Change size: L
    Delta: 24 files changed, 422 insertions(+), 475 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Johannes Henkel, +1 by Scott Haseley
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia4a6505540ea642b23c8e5ea3ddff6116ab0ab42
    Gerrit-Change-Number: 6638389
    Gerrit-PatchSet: 37
    Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Johannes Henkel <joha...@chromium.org>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Reviewer: Scott Haseley <shas...@chromium.org>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages