[event-timing] Assign fallback for events affected by context menu. [chromium/src : main]

0 views
Skip to first unread message

Michal Mocny (Gerrit)

unread,
Feb 18, 2026, 5:16:48 PM (3 days ago) Feb 18
to AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org

Message from Michal Mocny

Set Ready For Review

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
Gerrit-Change-Number: 7588183
Gerrit-PatchSet: 3
Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
Gerrit-Comment-Date: Wed, 18 Feb 2026 22:16:44 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Feb 18, 2026, 5:25:23 PM (3 days ago) Feb 18
to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 1 comment

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

Next in line. This ended up being a useful fix, which I didn't expect when I started. This is one part of the series of patches to reduce complexity and timers in the responsiveness metrics, which unblocks improving the interaction id machinery.

One small part at a time!

(I will fix the whitespace cl formatting warnings-- some sort of git cl format issues that are getting through the presubmit checks)

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
Gerrit-Change-Number: 7588183
Gerrit-PatchSet: 3
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: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Scott Haseley <shas...@chromium.org>
Gerrit-Comment-Date: Wed, 18 Feb 2026 22:25:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Michal Mocny (Gerrit)

unread,
Feb 18, 2026, 5:34:21 PM (3 days ago) Feb 18
to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
Attention needed from Johannes Henkel and Scott Haseley

Michal Mocny added 3 comments

File third_party/blink/renderer/core/timing/window_performance_test.cc
Line 1729, Patchset 3 (Latest): EXPECT_FALSE(pointerdown_entry->HasKnownEndTime());
Michal Mocny . unresolved

I could add also expectation on interactionID

Line 1735, Patchset 3 (Latest): RegisterPointerEvent(event_type_names::kContextmenu, contextmenu_timestamp,
Michal Mocny . unresolved

...and here we can add expectations for the contextmenu event

Line 1744, Patchset 3 (Latest): processing_end_pointerdown);
Michal Mocny . unresolved

Could extend the test to also add pointerup after contextmenu and ensure it gets the same interactionid..

Might want to move from WindowPerformanceTest to InteractionIdTest...

Open in Gerrit

Related details

Attention is currently required from:
  • Johannes Henkel
  • Scott Haseley
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
    Gerrit-Change-Number: 7588183
    Gerrit-PatchSet: 3
    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: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Comment-Date: Wed, 18 Feb 2026 22:34:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Scott Haseley (Gerrit)

    unread,
    Feb 18, 2026, 8:14:56 PM (3 days ago) Feb 18
    to Michal Mocny, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
    Attention needed from Johannes Henkel and Michal Mocny

    Scott Haseley added 9 comments

    Patchset-level comments
    Scott Haseley . resolved

    I think this looks good. Mostly just questions and minor stuff. I'll try this locally tomorrow too.

    Commit Message
    Line 33, Patchset 3 (Latest):This CL introduces an explicit fallback mechanism right at the event
    dispatch to resolve the performance end time for preceding events when a
    'contextmenu' event is dispatched.
    Scott Haseley . unresolved

    What's the interop story here?

    File third_party/blink/renderer/core/timing/responsiveness_metrics.h
    Line 190, Patchset 3 (Latest): void NotifyPointerdown(PointerEntryAndInfo* pointer_info) const;
    Scott Haseley . unresolved

    If you're making other changes, along the lines of the previous comment, this really could use some comments (or be renamed). I'd assume this gets called as soon as a PointerDown is detected (probably to start book-keeping), but that's not what it does.

    Line 108, Patchset 3 (Latest): bool was_notified_ = false;
    Scott Haseley . unresolved
    I know this is tied to the "NotifyPointerDown" method, but it's not clear from context in this class what this means. 2 suggestions:
    1. Consider renaming to something like `was_entry_emitted_` or `was_flushed_to_peformance_timeline_` or something
    2. Add some comments to what this means (maybe to the public methods), especially if not renaming?
    File third_party/blink/renderer/core/timing/responsiveness_metrics.cc
    Line 222, Patchset 3 (Latest): if (pending_pointer_down) {
    CHECK(pending_pointer_down->GetEntry()->name() ==
    event_type_names::kPointerdown);
    }
    Scott Haseley . unresolved

    Not related to this change, but if you're making any other changes, I think this would be more readable and idiomatic as:

    ```suggestion
    CHECK(!pending_pointer_down || pending_pointer_down->GetEntry()->name() ==
    event_type_names::kPointerdown);
    ```
    Line 240, Patchset 3 (Latest): // A pointerdown followed by contextmenu is assigned an interactionId right
    // away. We leave the pointerdown in the map of pointer interactions so
    Scott Haseley . unresolved

    This is probably because I don't know this code, but why? Is this so it can count as an interaction right away, and that we set the contextmenu entry's value to 0 so don't record metrics for it? Just want to confirm my understanding, but it could be worth explaining why in the comment too.

    (Aside/Q: do we end up emitting the contextmenu `entry` to the performance timeline with the 0 id?)

    Line 312, Patchset 3 (Latest): // Try handle keyboard event simulated click.
    Scott Haseley . unresolved

    This whole block (down to l. 347) is just formatting fixes, right? I didn't spot any functional changes, but want to check.

    File third_party/blink/renderer/core/timing/window_performance.cc
    Line 1288, Patchset 3 (Latest): if (event.type() != event_type_names::kContextmenu) {
    Scott Haseley . unresolved

    optional/suggestion: it might be clearer at the call site if this was a CHECK here and the event type check happened at the call site.

    Alternatively, it would be neat if this and `ReportEventTimingsWithoutNextPaint()` could share code, taking the FallbackReason as a parameter, since they're doing something similar. But the bodies are probably too different?

    Line 1297, Patchset 3 (Latest): !processing_end.is_null() ? processing_end : base::TimeTicks::Now();
    Scott Haseley . unresolved

    Should this use a consistent end time here instead of recomputing Now() in each iteration?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Johannes Henkel
    • Michal Mocny
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
    Gerrit-Change-Number: 7588183
    Gerrit-PatchSet: 3
    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: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Comment-Date: Thu, 19 Feb 2026 01:14:47 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Feb 18, 2026, 9:20:11 PM (3 days ago) Feb 18
    to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
    Attention needed from Johannes Henkel and Scott Haseley

    Michal Mocny added 7 comments

    Patchset-level comments
    Michal Mocny . resolved

    Will update patch-- thanks for feedback-- wanted to send some of the more interesting answers first.

    Commit Message
    Line 33, Patchset 3 (Latest):This CL introduces an explicit fallback mechanism right at the event
    dispatch to resolve the performance end time for preceding events when a
    'contextmenu' event is dispatched.
    Scott Haseley . resolved

    What's the interop story here?

    Michal Mocny

    WIP: https://github.com/w3c/event-timing/issues/154

    I think we have appetite to spec this, but I would like to start with speccing the interaction at "processingStart" and the PaintTimingMixin integration first.

    Then fallbacks become a bit easier to reason about.

    File third_party/blink/renderer/core/timing/responsiveness_metrics.h
    Line 190, Patchset 3 (Latest): void NotifyPointerdown(PointerEntryAndInfo* pointer_info) const;
    Scott Haseley . unresolved

    If you're making other changes, along the lines of the previous comment, this really could use some comments (or be renamed). I'd assume this gets called as soon as a PointerDown is detected (probably to start book-keeping), but that's not what it does.

    Michal Mocny

    Will do, even just to help reason about in the next patches.

    Line 108, Patchset 3 (Latest): bool was_notified_ = false;
    Scott Haseley . unresolved
    I know this is tied to the "NotifyPointerDown" method, but it's not clear from context in this class what this means. 2 suggestions:
    1. Consider renaming to something like `was_entry_emitted_` or `was_flushed_to_peformance_timeline_` or something
    2. Add some comments to what this means (maybe to the public methods), especially if not renaming?
    Michal Mocny

    Good suggestions-- but also FYI this whole class goes away in 2-3 patches.

    That said, pointerdown buffering is the one thing that persists and I may want a similar solution. (My original patch didn't need it, but, it also didn't solve this specific CL as thoroughly as I did now)

    File third_party/blink/renderer/core/timing/responsiveness_metrics.cc
    Line 240, Patchset 3 (Latest): // A pointerdown followed by contextmenu is assigned an interactionId right
    // away. We leave the pointerdown in the map of pointer interactions so
    Scott Haseley . unresolved

    This is probably because I don't know this code, but why? Is this so it can count as an interaction right away, and that we set the contextmenu entry's value to 0 so don't record metrics for it? Just want to confirm my understanding, but it could be worth explaining why in the comment too.

    (Aside/Q: do we end up emitting the contextmenu `entry` to the performance timeline with the 0 id?)

    Michal Mocny

    pointerdown are only meant to be "pending" until we know if they scroll, because this is a type of "next paint" that we cannot measure in the typical main thread scheduling way. (even then, I argue we could still measure the latency that pointerdown introduces to scroll start, or something-- but this is a big breaking change).

    A contextmenu is basically equivalent to pointerup, and comes before pointerup (or instead of on some platforms or conditions-- I guess it depends how fast the mouse moves over the contextmenu before lifting up).

    The contextmenu event itself *is* reported to perf timeline, but is specced NOT to get an interactionid, for 2 reasons:

    1. It already overlaps in duration with the pointer events (pointerdown) since this event is part of the same sync event dispatch. So adding this interactionId to it is not helping find new long INP durations.

    2. For attribution it would be maximally useful to expose *all* related events rather than just a few-- but this is difficult to do just from the "stream of event types". We've discussed basically doing something like "if the events are part of the same dispatch scope" or something. The Pointer Events spec authors are working on a generalized "gesture" concept that might help.

    Basically: contextmenu is the same as beforeinput, input, change, keypress, and a plethora of other useful syncthetic events, some of which are more commonly handled than their lower-level raw pointer/key events-- but they all overlap in time anyway. Getting interactionId attribution just helps with targetSelector (maybe?) and correct processingTime attribution. But this hasn't been a huge source of feedback surprisingly.

    For now-- I don't want to change existing behaviour here.

    Will expand comments.

    Line 312, Patchset 3 (Latest): // Try handle keyboard event simulated click.
    Scott Haseley . unresolved

    This whole block (down to l. 347) is just formatting fixes, right? I didn't spot any functional changes, but want to check.

    Michal Mocny

    Yeah I fixed a bunch of it, but it keeps sneaking back, theres something weird with `git cl format` going on.

    File third_party/blink/renderer/core/timing/window_performance.cc
    Line 1288, Patchset 3 (Latest): if (event.type() != event_type_names::kContextmenu) {
    Scott Haseley . unresolved

    optional/suggestion: it might be clearer at the call site if this was a CHECK here and the event type check happened at the call site.

    Alternatively, it would be neat if this and `ReportEventTimingsWithoutNextPaint()` could share code, taking the FallbackReason as a parameter, since they're doing something similar. But the bodies are probably too different?

    Michal Mocny

    The *next* patch tries to consolodate a bunch of the fallback reasons, but I hadn't considered the ReportEventTimingsWithoutNextPaint() be considered part of that. Will consider it.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Johannes Henkel
    • Scott Haseley
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
    Gerrit-Change-Number: 7588183
    Gerrit-PatchSet: 3
    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: Johannes Henkel <joha...@chromium.org>
    Gerrit-Attention: Scott Haseley <shas...@chromium.org>
    Gerrit-Comment-Date: Thu, 19 Feb 2026 02:20:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Feb 18, 2026, 11:56:48 PM (3 days ago) Feb 18
    to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
    Attention needed from Johannes Henkel and Scott Haseley

    Michal Mocny added 11 comments

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

    Expanded the test and fixed a couple more subtle issues. Will do more manual testing and audit the WPT (we have a few contextmenu tests)

    File third_party/blink/renderer/core/timing/responsiveness_metrics.h
    Line 190, Patchset 3: void NotifyPointerdown(PointerEntryAndInfo* pointer_info) const;
    Scott Haseley . resolved

    If you're making other changes, along the lines of the previous comment, this really could use some comments (or be renamed). I'd assume this gets called as soon as a PointerDown is detected (probably to start book-keeping), but that's not what it does.

    Michal Mocny

    Will do, even just to help reason about in the next patches.

    Michal Mocny

    Done

    Line 108, Patchset 3: bool was_notified_ = false;
    Scott Haseley . resolved
    I know this is tied to the "NotifyPointerDown" method, but it's not clear from context in this class what this means. 2 suggestions:
    1. Consider renaming to something like `was_entry_emitted_` or `was_flushed_to_peformance_timeline_` or something
    2. Add some comments to what this means (maybe to the public methods), especially if not renaming?
    Michal Mocny

    Good suggestions-- but also FYI this whole class goes away in 2-3 patches.

    That said, pointerdown buffering is the one thing that persists and I may want a similar solution. (My original patch didn't need it, but, it also didn't solve this specific CL as thoroughly as I did now)

    Michal Mocny

    Done

    File third_party/blink/renderer/core/timing/responsiveness_metrics.cc
    Line 222, Patchset 3: if (pending_pointer_down) {

    CHECK(pending_pointer_down->GetEntry()->name() ==
    event_type_names::kPointerdown);
    }
    Scott Haseley . resolved

    Not related to this change, but if you're making any other changes, I think this would be more readable and idiomatic as:

    ```suggestion
    CHECK(!pending_pointer_down || pending_pointer_down->GetEntry()->name() ==
    event_type_names::kPointerdown);
    ```
    Michal Mocny

    Done

    Line 240, Patchset 3: // A pointerdown followed by contextmenu is assigned an interactionId right

    // away. We leave the pointerdown in the map of pointer interactions so
    Scott Haseley . resolved

    This is probably because I don't know this code, but why? Is this so it can count as an interaction right away, and that we set the contextmenu entry's value to 0 so don't record metrics for it? Just want to confirm my understanding, but it could be worth explaining why in the comment too.

    (Aside/Q: do we end up emitting the contextmenu `entry` to the performance timeline with the 0 id?)

    Michal Mocny

    pointerdown are only meant to be "pending" until we know if they scroll, because this is a type of "next paint" that we cannot measure in the typical main thread scheduling way. (even then, I argue we could still measure the latency that pointerdown introduces to scroll start, or something-- but this is a big breaking change).

    A contextmenu is basically equivalent to pointerup, and comes before pointerup (or instead of on some platforms or conditions-- I guess it depends how fast the mouse moves over the contextmenu before lifting up).

    The contextmenu event itself *is* reported to perf timeline, but is specced NOT to get an interactionid, for 2 reasons:

    1. It already overlaps in duration with the pointer events (pointerdown) since this event is part of the same sync event dispatch. So adding this interactionId to it is not helping find new long INP durations.

    2. For attribution it would be maximally useful to expose *all* related events rather than just a few-- but this is difficult to do just from the "stream of event types". We've discussed basically doing something like "if the events are part of the same dispatch scope" or something. The Pointer Events spec authors are working on a generalized "gesture" concept that might help.

    Basically: contextmenu is the same as beforeinput, input, change, keypress, and a plethora of other useful syncthetic events, some of which are more commonly handled than their lower-level raw pointer/key events-- but they all overlap in time anyway. Getting interactionId attribution just helps with targetSelector (maybe?) and correct processingTime attribution. But this hasn't been a huge source of feedback surprisingly.

    For now-- I don't want to change existing behaviour here.

    Will expand comments.

    Michal Mocny

    I've decided not to document this here. This is just too much a part of the design and we can update docs / specs as needed to explain, and/or raise new directions.

    But this code is about to churn, anyway.

    Line 312, Patchset 3: // Try handle keyboard event simulated click.
    Scott Haseley . resolved

    This whole block (down to l. 347) is just formatting fixes, right? I didn't spot any functional changes, but want to check.

    Michal Mocny

    Yeah I fixed a bunch of it, but it keeps sneaking back, theres something weird with `git cl format` going on.

    Michal Mocny

    I just confirmed with a better diff tool that this is only renaming pending_pointer_down, removing the unneeded (and unhelpful) previous_entry, and changing the accidental +1 nesting of all lines.

    File third_party/blink/renderer/core/timing/window_performance.cc
    Line 1288, Patchset 3: if (event.type() != event_type_names::kContextmenu) {
    Scott Haseley . resolved

    optional/suggestion: it might be clearer at the call site if this was a CHECK here and the event type check happened at the call site.

    Alternatively, it would be neat if this and `ReportEventTimingsWithoutNextPaint()` could share code, taking the FallbackReason as a parameter, since they're doing something similar. But the bodies are probably too different?

    Michal Mocny

    The *next* patch tries to consolodate a bunch of the fallback reasons, but I hadn't considered the ReportEventTimingsWithoutNextPaint() be considered part of that. Will consider it.

    Michal Mocny

    Moved the Event check out-- because I actually had a bug because I confused myself because of the Event getting passed in.

    The bug was that we called the fallback method *before this event entry* was added to the list of pending, so the entry for the contextmenu wasn't getting the fallback, even though its event was the one passed into here.

    I think the pending events and the contextmenu event are both not worth measuring to next paint (for the same reasons).

    I think my updated test file catches this.

    Line 1297, Patchset 3: !processing_end.is_null() ? processing_end : base::TimeTicks::Now();
    Scott Haseley . resolved

    Should this use a consistent end time here instead of recomputing Now() in each iteration?

    Michal Mocny

    Good call!

    File third_party/blink/renderer/core/timing/window_performance_test.cc
    Line 1729, Patchset 3: EXPECT_FALSE(pointerdown_entry->HasKnownEndTime());
    Michal Mocny . resolved

    I could add also expectation on interactionID

    Michal Mocny

    Done

    Line 1735, Patchset 3: RegisterPointerEvent(event_type_names::kContextmenu, contextmenu_timestamp,
    Michal Mocny . resolved

    ...and here we can add expectations for the contextmenu event

    Michal Mocny

    Done

    Line 1744, Patchset 3: processing_end_pointerdown);
    Michal Mocny . resolved

    Could extend the test to also add pointerup after contextmenu and ensure it gets the same interactionid..

    Might want to move from WindowPerformanceTest to InteractionIdTest...

    Michal Mocny

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Johannes Henkel
    • Scott Haseley
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
      Gerrit-Change-Number: 7588183
      Gerrit-PatchSet: 3
      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: Johannes Henkel <joha...@chromium.org>
      Gerrit-Attention: Scott Haseley <shas...@chromium.org>
      Gerrit-Comment-Date: Thu, 19 Feb 2026 04:56:42 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
      Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michal Mocny (Gerrit)

      unread,
      Feb 19, 2026, 12:33:14 AM (3 days ago) Feb 19
      to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
      Attention needed from Johannes Henkel and Scott Haseley

      Michal Mocny voted Commit-Queue+0

      Commit-Queue+0
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Johannes Henkel
      • Scott Haseley
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
      Gerrit-Change-Number: 7588183
      Gerrit-PatchSet: 4
      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: Johannes Henkel <joha...@chromium.org>
      Gerrit-Attention: Scott Haseley <shas...@chromium.org>
      Gerrit-Comment-Date: Thu, 19 Feb 2026 05:33:07 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Johannes Henkel (Gerrit)

      unread,
      Feb 19, 2026, 12:57:39 AM (3 days ago) Feb 19
      to Michal Mocny, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
      Attention needed from Michal Mocny and Scott Haseley

      Johannes Henkel voted and added 8 comments

      Votes added by Johannes Henkel

      Code-Review+1

      8 comments

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

      As you know I'm not that familiar with this code, so my comments may be a little naive. Please enjoy or ignore as you see fit. :-)

      File third_party/blink/renderer/core/timing/responsiveness_metrics.cc
      Line 230, Patchset 4 (Latest): FlushPointerdownAndNotifyObservers(pending_pointer_down);
      Johannes Henkel . unresolved

      I think ideally, the naming of this method and the WasEntryEmitted() thing would be lined up, and since it's potentially not actually "flushing", being verbose and putting the check into the caller may make it easier to understand. E.g. this:

      if (!pending_pointer_down->WasEntryEmitted()) {
      EmitPointerDownToPerformanceTimeline(pending_pointer_down);
      }

      (EmitPointerDownToPerformanceTimeline could have CHECK(!pending_pointer_down->WasEntryEmitted()) at its beginning.

      PS: I see you discussed naming, and probably have more thoughts and context, so please feel free to skip this as you see fit.

      Line 233, Patchset 4 (Latest): entry->GetEventTimingReportingInfo()->pointer_id.value());
      Johannes Henkel . unresolved

      I think this can also be |pointer_id|.

      Potential yak shaving opportunity: I'm seeing that we query the pointer_id_entry_map_ three times, with Contains, at, and erase. If we were to use .Find instead, I think a single lookup could cover it since .Find returns an iterator (which can also be passed to erase).

      Line 242, Patchset 4 (Latest): if (!pending_pointer_down->GetEntry()->HasKnownInteractionID()) {
      Johannes Henkel . unresolved

      Idle thought: This makes me wonder whether the conditions "has been emitted to perf timeline" and "HasKnownInteractionID" are independent, equivalent, or one implies the other.

      Line 254, Patchset 4 (Latest): if (!pending_pointer_down->GetEntry()->HasKnownInteractionID()) {
      Johannes Henkel . unresolved

      I think inverting the condition (starting with the "known interaction id" branch) may make it slightly easier to read?

      Line 265, Patchset 4 (Latest): pending_pointer_down = nullptr;
      Johannes Henkel . unresolved

      This assignment feels redundant as pending_pointer_down isn't read afterwards.

      Line 617, Patchset 4 (Latest): // A pointerdown may be "flushed" to performance timeline when any number of
      Johannes Henkel . unresolved

      Hmm - It feels elsewhere, "flushed" means it's cleared from the map and/or emitted to UKM? Specifically, FlushAllPointerdownWithMeasuredPointerup, doesn't seem it emits anything to performance timeline.

      File third_party/blink/renderer/core/timing/window_performance_test.cc
      Line 2151, Patchset 4 (Latest):TEST_P(InteractionIdTest, ContextMenu) {
      Johannes Henkel . unresolved

      Sweet test! Above, I'm seeing that the tests end with some ukm checking - would this be relevant here as well?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Michal Mocny
      • Scott Haseley
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
        Gerrit-Change-Number: 7588183
        Gerrit-PatchSet: 4
        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: Michal Mocny <mmo...@chromium.org>
        Gerrit-Comment-Date: Thu, 19 Feb 2026 05:57:28 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Michal Mocny (Gerrit)

        unread,
        Feb 19, 2026, 1:08:31 AM (3 days ago) Feb 19
        to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
        Attention needed from Scott Haseley

        Michal Mocny added 1 comment

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

        In testing I found that one of the contextmenu WPT was timing out, because the event timing was not meeting the minimum duration threshold any more for reporting.

        I could have just updated the test, but I realized that this was symbolic of a less web interoperable behaviour than previously. I solved this in a neat way:

        1. I moved the context menu fallback to the ProcessingEnd for the context menu, and
        2. I use the known processing end time of that event to apply to all events

        The reason for (2) is that in testing I found that the contextmenu doesn't show until the event run the default action. So, the contextmenu end time == the visual feedback time, similar to js prompts. This is the perfect fallback time, that still measures attributable duration.

        It also happens to be a lot closer to previous behaviour.

        (A side benefit is somewhat cleaner fallback assignment, which will help in next patches)

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Scott Haseley
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
        Gerrit-Change-Number: 7588183
        Gerrit-PatchSet: 5
        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-Comment-Date: Thu, 19 Feb 2026 06:08:25 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Michal Mocny (Gerrit)

        unread,
        Feb 19, 2026, 1:10:59 AM (3 days ago) Feb 19
        to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
        Attention needed from Scott Haseley

        Michal Mocny voted Commit-Queue+1

        Commit-Queue+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Scott Haseley
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement satisfiedReview-Enforcement
        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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
        Gerrit-Change-Number: 7588183
        Gerrit-PatchSet: 6
        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-Comment-Date: Thu, 19 Feb 2026 06:10:52 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Michal Mocny (Gerrit)

        unread,
        Feb 19, 2026, 8:25:47 AM (3 days ago) Feb 19
        to Johannes Henkel, Scott Haseley, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
        Attention needed from Scott Haseley

        Michal Mocny added 7 comments

        File third_party/blink/renderer/core/timing/responsiveness_metrics.cc
        Line 230, Patchset 4: FlushPointerdownAndNotifyObservers(pending_pointer_down);
        Johannes Henkel . resolved

        I think ideally, the naming of this method and the WasEntryEmitted() thing would be lined up, and since it's potentially not actually "flushing", being verbose and putting the check into the caller may make it easier to understand. E.g. this:

        if (!pending_pointer_down->WasEntryEmitted()) {
        EmitPointerDownToPerformanceTimeline(pending_pointer_down);
        }

        (EmitPointerDownToPerformanceTimeline could have CHECK(!pending_pointer_down->WasEntryEmitted()) at its beginning.

        PS: I see you discussed naming, and probably have more thoughts and context, so please feel free to skip this as you see fit.

        Michal Mocny

        I think your suggestion is better, but I will resolve here to reduce churn.

        Not to ignore your feedback, but because this patch and a few others are small intermediate patches on the way to *removing all this code*. Let's have a long discussion on style/naming in *that* patch!

        Line 233, Patchset 4: entry->GetEventTimingReportingInfo()->pointer_id.value());
        Johannes Henkel . resolved

        I think this can also be |pointer_id|.

        Potential yak shaving opportunity: I'm seeing that we query the pointer_id_entry_map_ three times, with Contains, at, and erase. If we were to use .Find instead, I think a single lookup could cover it since .Find returns an iterator (which can also be passed to erase).

        Michal Mocny

        Acknowledged

        Line 242, Patchset 4: if (!pending_pointer_down->GetEntry()->HasKnownInteractionID()) {
        Johannes Henkel . resolved

        Idle thought: This makes me wonder whether the conditions "has been emitted to perf timeline" and "HasKnownInteractionID" are independent, equivalent, or one implies the other.

        Michal Mocny

        HasKnownInteractionID is meant to handle the case of pointerdown that is still in the "pending" state. Until we see future events that complete the decision making, it is unknown (`nullopt`).

        In the current state of the world that this patch is still in, ALL events start with unknown interactionID and have to finish measurement all the way to presentaton time before we even attempt to assign InteractionID to them. And more events than pointerdown will temporarily stay unknown as we wait for buffers and timers...

        Eventually the id becomes known, may or may not be 0, and this finally allows us to emit to perf timeline.

        So HasKnownInteractionID is necessary but not sufficient to know that we emitted to the perforamnce timeline.

        That is the current state of things.

        ---

        The direction I'm trying to move us (the goal of these patches):

        • Assign InteractionID immediately at ProcessingStart.
        • Remove all complex timers etc for all use cases, so you can always have all the context you need right away
        • Pointerdown continued to have a pending state (the one and only outlier now), but it will be handled differently

        Future possible direction:

        • I think we could evaluate making pointerdown always an interaction, and just ignore its Paint whenever it is handled by a default action (scroll) faster than it can paint. I think treating `pointercancel` as a type of Fallback signal for its paint might be enough -- but we have to finish this work and spec fallback times first.
        Line 254, Patchset 4: if (!pending_pointer_down->GetEntry()->HasKnownInteractionID()) {
        Johannes Henkel . resolved

        I think inverting the condition (starting with the "known interaction id" branch) may make it slightly easier to read?

        Michal Mocny

        Going away soon, and want to keep this less churn here.

        Line 265, Patchset 4: pending_pointer_down = nullptr;
        Johannes Henkel . resolved

        This assignment feels redundant as pending_pointer_down isn't read afterwards.

        Michal Mocny

        Done

        Line 617, Patchset 4: // A pointerdown may be "flushed" to performance timeline when any number of
        Johannes Henkel . resolved

        Hmm - It feels elsewhere, "flushed" means it's cleared from the map and/or emitted to UKM? Specifically, FlushAllPointerdownWithMeasuredPointerup, doesn't seem it emits anything to performance timeline.

        Michal Mocny

        Agree, but this is all going away and I'm keeping pre-existing as much as possible for this patch.

        File third_party/blink/renderer/core/timing/window_performance_test.cc
        Line 2151, Patchset 4:TEST_P(InteractionIdTest, ContextMenu) {
        Johannes Henkel . resolved

        Sweet test! Above, I'm seeing that the tests end with some ukm checking - would this be relevant here as well?

        Michal Mocny

        Good idea, added. Its actually a bit tricky because we could emit after contextmenu but right now we must see pointerup in order to do UKM reporting. SO the contextmenu without pointerup bug would not report to UKM even after this fix here, but it *will* get fixed in the next patches that force all UKM reporting eagerly.

        I'll update expectations and add a test for pointerdown + contextmenu only, but in that next patch.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Scott Haseley
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement satisfiedCode-Review
          • requirement satisfiedReview-Enforcement
          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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
          Gerrit-Change-Number: 7588183
          Gerrit-PatchSet: 6
          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-Comment-Date: Thu, 19 Feb 2026 13:25:41 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
          satisfied_requirement
          open
          diffy

          Scott Haseley (Gerrit)

          unread,
          Feb 19, 2026, 1:01:25 PM (3 days ago) Feb 19
          to Michal Mocny, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org
          Attention needed from Michal Mocny

          Scott Haseley voted and added 3 comments

          Votes added by Scott Haseley

          Code-Review+1

          3 comments

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

          LGTM % question about keyboard

          File third_party/blink/renderer/core/timing/responsiveness_metrics.h
          Line 200, Patchset 7 (Latest): void FlushPointerdownAndNotifyObservers(
          Scott Haseley . resolved

          This is a lot clearer, thanks!

          File third_party/blink/renderer/core/timing/responsiveness_metrics.cc
          Line 615, Patchset 7 (Parent): FlushKeydown();
          Scott Haseley . unresolved

          Does this need to be handled?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Michal Mocny
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement satisfiedReview-Enforcement
            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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
            Gerrit-Change-Number: 7588183
            Gerrit-PatchSet: 7
            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-Comment-Date: Thu, 19 Feb 2026 18:01:13 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Michal Mocny (Gerrit)

            unread,
            Feb 19, 2026, 1:19:26 PM (3 days ago) Feb 19
            to Scott Haseley, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org

            Michal Mocny voted and added 1 comment

            Votes added by Michal Mocny

            Commit-Queue+2

            1 comment

            File third_party/blink/renderer/core/timing/responsiveness_metrics.cc
            Scott Haseley . resolved

            Does this need to be handled?

            Michal Mocny

            The keydown event itself used to not be assigned an interactionId at keydown, now it is.

            However, we don't send the reported value to UKM until we know we are ready to flush, and this will now not happen after timer, and instead wait for arbitrarily long.

            This means that there is a minor regression, only for UKM reporting data-loss in some cases, only for contextmenu key.

            I think this is very acceptable as a temporary measure since we are going to flush to ukm immediately, soon.

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement satisfiedReview-Enforcement
              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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
              Gerrit-Change-Number: 7588183
              Gerrit-PatchSet: 7
              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-Comment-Date: Thu, 19 Feb 2026 18:19:21 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              Comment-In-Reply-To: Scott Haseley <shas...@chromium.org>
              satisfied_requirement
              open
              diffy

              Scott Haseley (Gerrit)

              unread,
              Feb 19, 2026, 1:21:47 PM (3 days ago) Feb 19
              to Michal Mocny, Johannes Henkel, Chromium LUCI CQ, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org

              Scott Haseley added 1 comment

              File third_party/blink/renderer/core/timing/responsiveness_metrics.cc
              Scott Haseley . resolved

              Does this need to be handled?

              Michal Mocny

              The keydown event itself used to not be assigned an interactionId at keydown, now it is.

              However, we don't send the reported value to UKM until we know we are ready to flush, and this will now not happen after timer, and instead wait for arbitrarily long.

              This means that there is a minor regression, only for UKM reporting data-loss in some cases, only for contextmenu key.

              I think this is very acceptable as a temporary measure since we are going to flush to ukm immediately, soon.

              Scott Haseley

              Cool, thanks for the explanation!

              Open in Gerrit

              Related details

              Attention set is empty
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement satisfiedReview-Enforcement
              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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
              Gerrit-Change-Number: 7588183
              Gerrit-PatchSet: 7
              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-Comment-Date: Thu, 19 Feb 2026 18:21:37 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              open
              diffy

              Chromium LUCI CQ (Gerrit)

              unread,
              Feb 19, 2026, 2:48:12 PM (3 days ago) Feb 19
              to Michal Mocny, Scott Haseley, Johannes Henkel, AyeAye, speed-metrics...@chromium.org, core-timi...@chromium.org, blink-...@chromium.org

              Chromium LUCI CQ submitted the change

              Change information

              Commit message:
              [event-timing] Assign fallback for events affected by context menu.

              A context menu interruption can prevent the subsequent 'Next Paint' from
              occurring (or being reported) for event timings, especially on platforms
              like Mac. This makes it fundamentally difficult/ undeterministic to
              measure these types of interactions.

              But also, a contextmenu provides real visual feedback to the user that
              is an alternative to next paint-- very much like a js alert() prompt,
              which we already treat as a fallback value.

              There has been a long list of known crbugs related to contextmenu and
              artificially large durations, which we have tried to fix with
              complicated patching and reliance on timers and "eventual" flushing. To
              do this we relied on a `contextmenu_flush_timer_` timer in
              ResponsivenessMetrics, and had the interactions state machine call back
              in to this measurement code to force flush these event timings. This is
              convoluted and brittle (and broken in subtle ways). More importantly, we
              are working towards removing the need for these timers and buffering so
              we need to fix this here.

              I tested locally, and just spamming right click on a simple test page
              would consistently lead to various reporting issues (assigning the same
              interaction id to multiple pointerdown, missing reports, etc). So our
              existing patches are not perfect, anyway.


              This CL introduces an explicit fallback mechanism right at the event
              dispatch to resolve the performance end time for preceding events when a
              'contextmenu' event is dispatched.

              After this fix, all tests continue to pass, but manual testing
              immediately showcases better behaviour. I haven't found a way to create
              a test to reliably reproduce the race conditions.

              Another side effect is that we flush these event timings more
              quickly/reliably to the performance timeline.
              Bug: 378647854, 41491625
              Change-Id: Ie6f6106e8206ae34df9708679acce4d36a6a6964
              Reviewed-by: Scott Haseley <shas...@chromium.org>
              Reviewed-by: Johannes Henkel <joha...@chromium.org>
              Commit-Queue: Michal Mocny <mmo...@chromium.org>
              Cr-Commit-Position: refs/heads/main@{#1587319}
              Files:
              • M third_party/blink/renderer/core/timing/performance_event_timing.cc
              • M third_party/blink/renderer/core/timing/performance_event_timing.h
              • M third_party/blink/renderer/core/timing/responsiveness_metrics.cc
              • M third_party/blink/renderer/core/timing/responsiveness_metrics.h
              • M third_party/blink/renderer/core/timing/window_performance.cc
              • M third_party/blink/renderer/core/timing/window_performance.h
              • M third_party/blink/renderer/core/timing/window_performance_test.cc
              Change size: L
              Delta: 7 files changed, 215 insertions(+), 122 deletions(-)
              Branch: refs/heads/main
              Submit Requirements:
              • requirement satisfiedCode-Review: +1 by Scott Haseley, +1 by Johannes Henkel
              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: Ie6f6106e8206ae34df9708679acce4d36a6a6964
              Gerrit-Change-Number: 7588183
              Gerrit-PatchSet: 8
              Gerrit-Owner: Michal Mocny <mmo...@chromium.org>
              Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
              open
              diffy
              satisfied_requirement
              Reply all
              Reply to author
              Forward
              0 new messages