Make light dismiss use click instead of pointerdown/up [chromium/src : main]

0 views
Skip to first unread message

Joey Arhar (Gerrit)

unread,
Jul 15, 2025, 2:18:42 PMJul 15
to Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Mason Freed and Mustaq Ahmed

Joey Arhar added 1 comment

Patchset-level comments
File-level comment, Patchset 8:
Joey Arhar . resolved

+masonf for core/html and tests
+mustaq for everything else

Open in Gerrit

Related details

Attention is currently required from:
  • Mason Freed
  • Mustaq Ahmed
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
Gerrit-Change-Number: 6664038
Gerrit-PatchSet: 8
Gerrit-Owner: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Comment-Date: Tue, 15 Jul 2025 18:18:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Mason Freed (Gerrit)

unread,
Jul 21, 2025, 5:48:01 PMJul 21
to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
Attention needed from Joey Arhar, Mustaq Ahmed and Robert Flack

Mason Freed added 6 comments

File third_party/blink/renderer/core/html/forms/select_type.cc
Line 490, Patchset 10 (Latest): if (FlatTreeTraversal::IsDescendantOf(*event.target()->ToNode(),
Mason Freed . unresolved

I think you likely want `IsInclusiveDescendantOf` which doesn't yet exist. But it's possible to click on the popover itself, right? (This case likely needs a test also.)

Line 537, Patchset 10 (Latest): select_->GetDocument().SetPopoverPointerdownTarget(popover_);
Mason Freed . unresolved

Can you add a CHECK inside SetPopoverPointerdownTarget() that `!RuntimeEnabledFeatures::LightDismissFromClickEnabled()`?

File third_party/blink/renderer/core/html/html_dialog_element.h
Line 89, Patchset 10 (Latest): static void HandleDialogLightDismissForClick(const Node& pointer_down_target,
Mason Freed . unresolved

Can you add comments explaining the two versions?

File third_party/blink/renderer/core/html/html_dialog_element.cc
Line 305, Patchset 10 (Latest): if (auto* pseudo = DynamicTo<PseudoElement>(target)) {
Mason Freed . unresolved

Is this a spec change? I think the effect should be identical, and I can't think of a way that it might be observable, but maybe I'm missing one.

Current spec includes the bounds check:

https://html.spec.whatwg.org/#nearest-clicked-dialog

File third_party/blink/renderer/core/html/html_element.h
Line 309, Patchset 10 (Latest): static void HandlePopoverLightDismissForClick(const Node& pointer_down_target,
Mason Freed . unresolved

ditto a comment would be nice

File third_party/blink/web_tests/external/wpt/html/semantics/popovers/light-dismiss-event-ordering-expected.txt
File-level comment, Patchset 10 (Latest):
Mason Freed . unresolved

Well, I guess at least this is observable. Should you change the test?

Open in Gerrit

Related details

Attention is currently required from:
  • Joey Arhar
  • Mustaq Ahmed
  • Robert Flack
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 10
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Mon, 21 Jul 2025 21:47:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mustaq Ahmed (Gerrit)

    unread,
    Jul 23, 2025, 11:01:04 AMJul 23
    to Robert Flack, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar and Robert Flack

    Mustaq Ahmed added 3 comments

    Patchset-level comments
    Mustaq Ahmed . resolved

    Thanks for the long wait for my comments here. The overall plan here looks good. I _think_ the PEF logging of down/up targets could bypass the need for extra parameters in some methods here, apologies if I am missing something here!

    File third_party/blink/renderer/core/input/event_handler.h
    Line 365, Patchset 10 (Latest): Node* target_node = nullptr,
    Mustaq Ahmed . unresolved

    Did you mean to call it `possibly_pseudo_target` or something?

    I am still scratching my head to understand why event dispatch would worry about a pseudo-target. What about a quick sync?

    File third_party/blink/renderer/core/input/mouse_event_manager.cc
    Line 250, Patchset 10 (Latest): if (!pointer_down_target) {
    Mustaq Ahmed . unresolved

    Ideally `MEM::DispatchMouseEvent` callers won't worry about the two extra parameters but would pull the data from PEF. What do you think?

    I believe the whole `if` blocking staring at L235 belongs to PEM where we already have access to PEF. Does it sound like a separate cleanup that could precede this CL to simplify things here? We switched click-like events from MEs to PEs but didn't get a chance to simplify the code after the flag got removed!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    • Robert Flack
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Wed, 23 Jul 2025 15:00:52 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Robert Flack (Gerrit)

    unread,
    Jul 23, 2025, 3:52:40 PMJul 23
    to Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar

    Robert Flack added 4 comments

    File third_party/blink/renderer/core/events/pointer_event_factory.cc
    Line 799, Patchset 10 (Latest): if (pointer_id_to_targets_.Contains(pointer_id)) {
    Robert Flack . unresolved

    Use `pointer_id_to_targets_.insert(MakeGarbageCollected<PointerTargets>())` to avoid double lookup. Then you can use the returned pair's value, similar to [CopyToActiveInterpolationsMap](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/animation/effect_stack.cc;l=48?q=%5C.insert%5C(.*,%5C%20MakeGarbageCollected).

    File third_party/blink/renderer/core/html/forms/select_type.cc
    Line 489, Patchset 10 (Latest): // prevent light dismiss from closing the picker.
    Robert Flack . unresolved

    I'm a bit confused by this. Is the intention to ignore events within inner elements? If so, can we do this by only acting on events whose event phase is kAtTarget to ignore clicks bubbling up from inner elements?

    File third_party/blink/renderer/core/input/event_handler.h
    Line 365, Patchset 10 (Latest): Node* target_node = nullptr,
    Mustaq Ahmed . unresolved

    Did you mean to call it `possibly_pseudo_target` or something?

    I am still scratching my head to understand why event dispatch would worry about a pseudo-target. What about a quick sync?

    Robert Flack

    This also seems problematic for standardizing. If we have a standardized way of accessing the down and up targets they would be the same targets that are observable on the events.

    File third_party/blink/renderer/core/input/event_handler.cc
    Line 936, Patchset 10 (Latest): mev.GetHitTestResult().InnerPossiblyPseudoNode());
    Robert Flack . unresolved

    This doesn't take into account pointer capture, however I think that we should.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 10
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Wed, 23 Jul 2025 19:52:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mustaq Ahmed <mus...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Jul 23, 2025, 4:56:44 PMJul 23
    to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Mustaq Ahmed

    Joey Arhar added 2 comments

    File third_party/blink/renderer/core/input/event_handler.h
    Line 365, Patchset 10 (Latest): Node* target_node = nullptr,
    Mustaq Ahmed . unresolved

    Did you mean to call it `possibly_pseudo_target` or something?

    I am still scratching my head to understand why event dispatch would worry about a pseudo-target. What about a quick sync?

    Joey Arhar

    Dialog light dismiss needs to worry about pseudo-elements because of the ::backdrop pseudo-element. When clicking on ::backdrop we should trigger light dismiss, but if we click on its corresponding dialog element then we should not light dismiss. If we just passed the corresponding element of a pseudo-element, then ::backdrop would always look like the dialog element itself. We currently have a hacky workaround for this, which this patch can effectively get rid of: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_dialog_element.cc;l=273-283;drc=a3c9c4dcd0d6de500f41d7272d9515b6b81b7729

    File third_party/blink/renderer/core/input/mouse_event_manager.cc
    Line 250, Patchset 10 (Latest): if (!pointer_down_target) {
    Mustaq Ahmed . unresolved

    Ideally `MEM::DispatchMouseEvent` callers won't worry about the two extra parameters but would pull the data from PEF. What do you think?

    I believe the whole `if` blocking staring at L235 belongs to PEM where we already have access to PEF. Does it sound like a separate cleanup that could precede this CL to simplify things here? We switched click-like events from MEs to PEs but didn't get a chance to simplify the code after the flag got removed!

    Joey Arhar

    So we can move this code to PointerEventManager? Can we move the entire DispatchMouseEvent method there?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mustaq Ahmed
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 10
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Comment-Date: Wed, 23 Jul 2025 20:56:34 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Jul 25, 2025, 1:36:14 PMJul 25
    to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Mason Freed, Mustaq Ahmed and Robert Flack

    Joey Arhar added 9 comments

    File third_party/blink/renderer/core/events/pointer_event_factory.cc
    Line 799, Patchset 10 (Latest): if (pointer_id_to_targets_.Contains(pointer_id)) {
    Robert Flack . resolved

    Use `pointer_id_to_targets_.insert(MakeGarbageCollected<PointerTargets>())` to avoid double lookup. Then you can use the returned pair's value, similar to [CopyToActiveInterpolationsMap](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/animation/effect_stack.cc;l=48?q=%5C.insert%5C(.*,%5C%20MakeGarbageCollected).

    Joey Arhar

    Done

    File third_party/blink/renderer/core/html/forms/select_type.cc
    Line 489, Patchset 10 (Latest): // prevent light dismiss from closing the picker.
    Robert Flack . unresolved

    I'm a bit confused by this. Is the intention to ignore events within inner elements? If so, can we do this by only acting on events whose event phase is kAtTarget to ignore clicks bubbling up from inner elements?

    Joey Arhar

    Events can bubble up from the author provided `<button>` or the author provided `<option>`/etc elements which are slotted into the picker, so I don't think we can figure this out without looking at the event path.

    Line 490, Patchset 10 (Latest): if (FlatTreeTraversal::IsDescendantOf(*event.target()->ToNode(),
    Mason Freed . unresolved

    I think you likely want `IsInclusiveDescendantOf` which doesn't yet exist. But it's possible to click on the popover itself, right? (This case likely needs a test also.)

    Joey Arhar

    I tried for a while to write a test, but testdriver is refusing to click on the area below the select's button while the picker is open. I included it as select-click-picker-light-dismiss.tentative.html

    I added a check to see if the event target is the popover.

    Line 537, Patchset 10 (Latest): select_->GetDocument().SetPopoverPointerdownTarget(popover_);
    Mason Freed . resolved

    Can you add a CHECK inside SetPopoverPointerdownTarget() that `!RuntimeEnabledFeatures::LightDismissFromClickEnabled()`?

    Joey Arhar

    Done

    File third_party/blink/renderer/core/html/html_dialog_element.h
    Line 89, Patchset 10 (Latest): static void HandleDialogLightDismissForClick(const Node& pointer_down_target,
    Mason Freed . resolved

    Can you add comments explaining the two versions?

    Joey Arhar

    Done

    File third_party/blink/renderer/core/html/html_dialog_element.cc
    Line 305, Patchset 10 (Latest): if (auto* pseudo = DynamicTo<PseudoElement>(target)) {
    Mason Freed . unresolved

    Is this a spec change? I think the effect should be identical, and I can't think of a way that it might be observable, but maybe I'm missing one.

    Current spec includes the bounds check:

    https://html.spec.whatwg.org/#nearest-clicked-dialog

    Joey Arhar

    Yeah I will certainly have to rewrite this portion of the spec, at the very least to remove the existing x and y coordinate checks to figure out if the ::backdrop was clicked. Does this answer your question?

    File third_party/blink/renderer/core/html/html_element.h
    Line 309, Patchset 10 (Latest): static void HandlePopoverLightDismissForClick(const Node& pointer_down_target,
    Mason Freed . resolved

    ditto a comment would be nice

    Joey Arhar

    Done

    File third_party/blink/renderer/core/input/event_handler.cc
    Line 936, Patchset 10 (Latest): mev.GetHitTestResult().InnerPossiblyPseudoNode());
    Robert Flack . unresolved

    This doesn't take into account pointer capture, however I think that we should.

    Joey Arhar

    What is pointer capture?

    File third_party/blink/web_tests/external/wpt/html/semantics/popovers/light-dismiss-event-ordering-expected.txt
    Mason Freed . unresolved

    Well, I guess at least this is observable. Should you change the test?

    Joey Arhar

    I'm not sure if we should change the test before changing the spec

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mason Freed
    • Mustaq Ahmed
    • Robert Flack
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Fri, 25 Jul 2025 17:36:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Jul 25, 2025, 4:19:08 PMJul 25
    to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar, Mustaq Ahmed and Robert Flack

    Mason Freed added 6 comments

    File third_party/blink/renderer/core/html/forms/select_type.cc
    Line 490, Patchset 10: if (FlatTreeTraversal::IsDescendantOf(*event.target()->ToNode(),
    Mason Freed . resolved

    I think you likely want `IsInclusiveDescendantOf` which doesn't yet exist. But it's possible to click on the popover itself, right? (This case likely needs a test also.)

    Joey Arhar

    I tried for a while to write a test, but testdriver is refusing to click on the area below the select's button while the picker is open. I included it as select-click-picker-light-dismiss.tentative.html

    I added a check to see if the event target is the popover.

    Mason Freed

    Acknowledged

    File third_party/blink/renderer/core/html/html_dialog_element.cc
    Line 305, Patchset 10: if (auto* pseudo = DynamicTo<PseudoElement>(target)) {
    Mason Freed . resolved

    Is this a spec change? I think the effect should be identical, and I can't think of a way that it might be observable, but maybe I'm missing one.

    Current spec includes the bounds check:

    https://html.spec.whatwg.org/#nearest-clicked-dialog

    Joey Arhar

    Yeah I will certainly have to rewrite this portion of the spec, at the very least to remove the existing x and y coordinate checks to figure out if the ::backdrop was clicked. Does this answer your question?

    Mason Freed

    Yes, thanks.

    File third_party/blink/web_tests/external/wpt/html/semantics/forms/the-select-element/customizable-select/select-click-picker-light-dismiss.tentative.html
    Line 23, Patchset 11 (Latest): const option = document.querySelector('option');
    Mason Freed . unresolved

    unused (and `undefined`)

    Line 33, Patchset 11 (Latest): // We can't get layout information of ::picker(select), so this is a guess of
    Mason Freed . unresolved

    For the test, you can always position and size it however you want, which feels like the right thing to do here.

    Line 41, Patchset 11 (Latest): bodyClicked = true;
    Mason Freed . unresolved

    The click event bubbles, so I'm not sure this is testing what you think it's testing...

    File third_party/blink/web_tests/external/wpt/html/semantics/popovers/light-dismiss-event-ordering-expected.txt
    Mason Freed . unresolved

    Well, I guess at least this is observable. Should you change the test?

    Joey Arhar

    I'm not sure if we should change the test before changing the spec

    Mason Freed

    Ok. But perhaps it's a good idea to copy/paste this to a .tentative test and modify it, so you have some proof that it does what you expect, and you can rename/delete when the spec PR lands?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    • Mustaq Ahmed
    • Robert Flack
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 11
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Fri, 25 Jul 2025 20:18:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Jul 28, 2025, 11:38:02 AMJul 28
    to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Mason Freed, Mustaq Ahmed and Robert Flack

    Joey Arhar added 1 comment

    File third_party/blink/web_tests/external/wpt/html/semantics/forms/the-select-element/customizable-select/select-click-picker-light-dismiss.tentative.html
    Line 41, Patchset 11 (Latest): bodyClicked = true;
    Mason Freed . unresolved

    The click event bubbles, so I'm not sure this is testing what you think it's testing...

    Joey Arhar

    Since this assert is failing, it proves to me that test driver isn't clicking anything at all when i ask it to click an x and y where the picker is. I'm not sure how to make this test work.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mason Freed
    • Mustaq Ahmed
    • Robert Flack
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Mon, 28 Jul 2025 15:37:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Jul 28, 2025, 12:20:32 PMJul 28
    to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar, Mustaq Ahmed and Robert Flack

    Mason Freed added 1 comment

    File third_party/blink/web_tests/external/wpt/html/semantics/forms/the-select-element/customizable-select/select-click-picker-light-dismiss.tentative.html
    Line 41, Patchset 11 (Latest): bodyClicked = true;
    Mason Freed . unresolved

    The click event bubbles, so I'm not sure this is testing what you think it's testing...

    Joey Arhar

    Since this assert is failing, it proves to me that test driver isn't clicking anything at all when i ask it to click an x and y where the picker is. I'm not sure how to make this test work.

    Mason Freed

    Weird. Maybe add another couple `await rAF()`s after the click?

    This would likely help a little, if nothing else, for readability:

    ```
    ::picker(select) {
    width: 600px;
    height: 600px;
    top:0;
    left:0;
    }
    ```

    and then just

    ```
    .pointerMove(300, 300)
    ```


    You might (?) also need to add

    ```
    position-area: none;
    position-try-fallbacks: none;
    ```

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    • Mustaq Ahmed
    • Robert Flack
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Mon, 28 Jul 2025 16:20:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Jul 28, 2025, 6:47:21 PMJul 28
    to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Mason Freed, Mustaq Ahmed and Robert Flack

    Joey Arhar added 7 comments

    File third_party/blink/renderer/core/input/event_handler.h
    Line 365, Patchset 10: Node* target_node = nullptr,
    Mustaq Ahmed . resolved

    Did you mean to call it `possibly_pseudo_target` or something?

    I am still scratching my head to understand why event dispatch would worry about a pseudo-target. What about a quick sync?

    Joey Arhar

    Dialog light dismiss needs to worry about pseudo-elements because of the ::backdrop pseudo-element. When clicking on ::backdrop we should trigger light dismiss, but if we click on its corresponding dialog element then we should not light dismiss. If we just passed the corresponding element of a pseudo-element, then ::backdrop would always look like the dialog element itself. We currently have a hacky workaround for this, which this patch can effectively get rid of: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_dialog_element.cc;l=273-283;drc=a3c9c4dcd0d6de500f41d7272d9515b6b81b7729

    Joey Arhar

    I re-added the ::backdrop logic since it sounds like we can't use pseudo-elements in the spec.

    File third_party/blink/renderer/core/input/event_handler.cc
    Line 936, Patchset 10: mev.GetHitTestResult().InnerPossiblyPseudoNode());
    Robert Flack . unresolved

    This doesn't take into account pointer capture, however I think that we should.

    Joey Arhar

    What is pointer capture?

    Joey Arhar

    I removed this parameter. Does that address your question?

    File third_party/blink/renderer/core/input/mouse_event_manager.cc
    Line 250, Patchset 10: if (!pointer_down_target) {
    Mustaq Ahmed . unresolved

    Ideally `MEM::DispatchMouseEvent` callers won't worry about the two extra parameters but would pull the data from PEF. What do you think?

    I believe the whole `if` blocking staring at L235 belongs to PEM where we already have access to PEF. Does it sound like a separate cleanup that could precede this CL to simplify things here? We switched click-like events from MEs to PEs but didn't get a chance to simplify the code after the flag got removed!

    Joey Arhar

    So we can move this code to PointerEventManager? Can we move the entire DispatchMouseEvent method there?

    Joey Arhar

    As per offline discussion, I'll plan on landing this as-is and we can try improving afterwards.

    File third_party/blink/web_tests/external/wpt/html/semantics/forms/the-select-element/customizable-select/select-click-picker-light-dismiss.tentative.html
    Line 23, Patchset 11: const option = document.querySelector('option');
    Mason Freed . resolved

    unused (and `undefined`)

    Joey Arhar

    Done

    Line 33, Patchset 11: // We can't get layout information of ::picker(select), so this is a guess of
    Mason Freed . resolved

    For the test, you can always position and size it however you want, which feels like the right thing to do here.

    Joey Arhar

    Done

    Line 41, Patchset 11: bodyClicked = true;
    Mason Freed . resolved

    The click event bubbles, so I'm not sure this is testing what you think it's testing...

    Joey Arhar

    Since this assert is failing, it proves to me that test driver isn't clicking anything at all when i ask it to click an x and y where the picker is. I'm not sure how to make this test work.

    Mason Freed

    Weird. Maybe add another couple `await rAF()`s after the click?

    This would likely help a little, if nothing else, for readability:

    ```
    ::picker(select) {
    width: 600px;
    height: 600px;
    top:0;
    left:0;
    }
    ```

    and then just

    ```
    .pointerMove(300, 300)
    ```


    You might (?) also need to add

    ```
    position-area: none;
    position-try-fallbacks: none;
    ```

    Joey Arhar

    hey that fixed it, thanks!!!

    File third_party/blink/web_tests/external/wpt/html/semantics/popovers/light-dismiss-event-ordering-expected.txt
    File-level comment, Patchset 10:
    Mason Freed . resolved

    Well, I guess at least this is observable. Should you change the test?

    Joey Arhar

    I'm not sure if we should change the test before changing the spec

    Mason Freed

    Ok. But perhaps it's a good idea to copy/paste this to a .tentative test and modify it, so you have some proof that it does what you expect, and you can rename/delete when the spec PR lands?

    Joey Arhar

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mason Freed
    • Mustaq Ahmed
    • Robert Flack
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Mon, 28 Jul 2025 22:47:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mustaq Ahmed <mus...@chromium.org>
    Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Robert Flack (Gerrit)

    unread,
    Jul 29, 2025, 2:01:32 PMJul 29
    to Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar, Mason Freed and Mustaq Ahmed

    Robert Flack added 1 comment

    File third_party/blink/renderer/core/html/forms/select_type.cc
    Line 489, Patchset 10: // prevent light dismiss from closing the picker.
    Robert Flack . unresolved

    I'm a bit confused by this. Is the intention to ignore events within inner elements? If so, can we do this by only acting on events whose event phase is kAtTarget to ignore clicks bubbling up from inner elements?

    Joey Arhar

    Events can bubble up from the author provided `<button>` or the author provided `<option>`/etc elements which are slotted into the picker, so I don't think we can figure this out without looking at the event path.

    Robert Flack

    Hmm, it seems like you're only interested in handling events targeting the popover. It seems like you wouldn't need these ancestor checks if the event handling happened in PopoverElementForAppearanceBase::DefaultEventHandler since then you would only be seeing events targeting the popover or some descendant of it.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    • Mason Freed
    • Mustaq Ahmed
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 12
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Tue, 29 Jul 2025 18:01:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Jul 29, 2025, 5:22:50 PMJul 29
    to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar and Mustaq Ahmed

    Mason Freed added 1 comment

    File third_party/blink/renderer/core/html/forms/select_type.cc
    Line 489, Patchset 10: // prevent light dismiss from closing the picker.
    Robert Flack . unresolved

    I'm a bit confused by this. Is the intention to ignore events within inner elements? If so, can we do this by only acting on events whose event phase is kAtTarget to ignore clicks bubbling up from inner elements?

    Joey Arhar

    Events can bubble up from the author provided `<button>` or the author provided `<option>`/etc elements which are slotted into the picker, so I don't think we can figure this out without looking at the event path.

    Robert Flack

    Hmm, it seems like you're only interested in handling events targeting the popover. It seems like you wouldn't need these ancestor checks if the event handling happened in PopoverElementForAppearanceBase::DefaultEventHandler since then you would only be seeing events targeting the popover or some descendant of it.

    Mason Freed

    I think the problem is that we want to handle clicks on the <select> button or its descendants, but **not** descendants of the ::picker element popover (which is also a descendant of the <select>. So it's part of the tree, not just the popover and not just the select. Right jarhar@?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    • Mustaq Ahmed
    Gerrit-Comment-Date: Tue, 29 Jul 2025 21:22:41 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Robert Flack (Gerrit)

    unread,
    Jul 30, 2025, 9:58:31 AMJul 30
    to Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar and Mustaq Ahmed

    Robert Flack added 1 comment

    File third_party/blink/renderer/core/html/forms/select_type.cc
    Line 489, Patchset 10: // prevent light dismiss from closing the picker.
    Robert Flack . unresolved

    I'm a bit confused by this. Is the intention to ignore events within inner elements? If so, can we do this by only acting on events whose event phase is kAtTarget to ignore clicks bubbling up from inner elements?

    Joey Arhar

    Events can bubble up from the author provided `<button>` or the author provided `<option>`/etc elements which are slotted into the picker, so I don't think we can figure this out without looking at the event path.

    Robert Flack

    Hmm, it seems like you're only interested in handling events targeting the popover. It seems like you wouldn't need these ancestor checks if the event handling happened in PopoverElementForAppearanceBase::DefaultEventHandler since then you would only be seeing events targeting the popover or some descendant of it.

    Mason Freed

    I think the problem is that we want to handle clicks on the <select> button or its descendants, but **not** descendants of the ::picker element popover (which is also a descendant of the <select>. So it's part of the tree, not just the popover and not just the select. Right jarhar@?

    Robert Flack

    Ah right, it's the inversion, it doesn't want to handle events whose target includes the popover, but it does want to handle events in other descendants.

    It seems like architecturally it would be cleaner to have the popover preventDefault or stopPropagation the event, but that would probably be too heavy handed since it would also prevent other default behaviors.

    Gerrit-Comment-Date: Wed, 30 Jul 2025 13:58:17 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
    Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Robert Flack (Gerrit)

    unread,
    Jul 30, 2025, 10:13:17 AMJul 30
    to Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar and Mustaq Ahmed

    Robert Flack added 3 comments

    File third_party/blink/renderer/core/events/pointer_event_factory.cc
    Line 629, Patchset 12 (Latest): PointerAttributes attributes = pointer_id_to_attributes_.Take(mapped_id);
    Robert Flack . unresolved

    It really feels like we should add the down and up nodes to the PointerAttributes data rather than create a second map.

    Line 635, Patchset 12 (Latest): pointer_id_to_targets_.erase(mapped_id);
    Robert Flack . unresolved

    For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

    File third_party/blink/renderer/core/input/pointer_event_manager.cc
    Line 1053, Patchset 12 (Latest): pointer_event, target, &mouse_event);
    Robert Flack . unresolved

    You should probably be using the effective_target here so that if pointer capture is used we use the captured target and have the same target as the actual down and up events are dispatched to.

    Gerrit-Comment-Date: Wed, 30 Jul 2025 14:13:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mustaq Ahmed (Gerrit)

    unread,
    Jul 30, 2025, 3:05:14 PMJul 30
    to Robert Flack, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar

    Mustaq Ahmed added 3 comments

    File third_party/blink/renderer/core/events/pointer_event_factory.h
    Line 119, Patchset 12 (Latest): Node* GetPointerTarget(WebInputEvent::Type type, PointerId pointer_id) const;
    Mustaq Ahmed . unresolved

    I think two separate functions are better because this is only for two types: `GetPointerDownTarget` and `GetPointerUpTarget`.

    File third_party/blink/renderer/core/input/mouse_event_manager.cc
    Line 250, Patchset 10: if (!pointer_down_target) {
    Mustaq Ahmed . resolved

    Ideally `MEM::DispatchMouseEvent` callers won't worry about the two extra parameters but would pull the data from PEF. What do you think?

    I believe the whole `if` blocking staring at L235 belongs to PEM where we already have access to PEF. Does it sound like a separate cleanup that could precede this CL to simplify things here? We switched click-like events from MEs to PEs but didn't get a chance to simplify the code after the flag got removed!

    Joey Arhar

    So we can move this code to PointerEventManager? Can we move the entire DispatchMouseEvent method there?

    Joey Arhar

    As per offline discussion, I'll plan on landing this as-is and we can try improving afterwards.

    Mustaq Ahmed

    Acknowledged

    File third_party/blink/renderer/core/input/pointer_event_manager.cc
    Line 1053, Patchset 12 (Latest): pointer_event, target, &mouse_event);
    Robert Flack . unresolved

    You should probably be using the effective_target here so that if pointer capture is used we use the captured target and have the same target as the actual down and up events are dispatched to.

    Mustaq Ahmed

    The cleanest (and ideal) way to achieve it would be to call `PEF::SetPointerTarget` when dispatching down/up events at `PEM::DispatchPointerEvent`. But pseudo-element make it tricky!

    I think the core question is: what is the expected behavior when `pointerdown` goes to the backdrop and `pointerup` goes to the popover element but anytime in-between, the pointer was captured to the popover element? Maybe we could consider pseudo targets only for the default implicit capture with touch but that sounds hacky.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 12
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Wed, 30 Jul 2025 19:05:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mustaq Ahmed <mus...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Jul 31, 2025, 12:01:34 PMJul 31
    to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Robert Flack

    Joey Arhar added 2 comments

    File third_party/blink/renderer/core/events/pointer_event_factory.cc
    Line 629, Patchset 12 (Latest): PointerAttributes attributes = pointer_id_to_attributes_.Take(mapped_id);
    Robert Flack . unresolved

    It really feels like we should add the down and up nodes to the PointerAttributes data rather than create a second map.

    Joey Arhar

    I initially tried this but gave up, and I just tried again and I think I got it to work. How does it look?

    Line 635, Patchset 12 (Latest): pointer_id_to_targets_.erase(mapped_id);
    Robert Flack . unresolved

    For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

    Joey Arhar

    I have been able to successfully get the pointer targets when a click is generated on a touch input, but now that PointerAttributes has all the info with the latest patchset I could look in the recently removed pointers for the down/up targets when retrieving the up/down targets. Should I do that in GetPointerTarget?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Robert Flack
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 12
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Comment-Date: Thu, 31 Jul 2025 16:01:23 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Aug 1, 2025, 11:56:03 AMAug 1
    to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Robert Flack

    Joey Arhar added 1 comment

    File third_party/blink/renderer/core/events/pointer_event_factory.cc
    Line 629, Patchset 12: PointerAttributes attributes = pointer_id_to_attributes_.Take(mapped_id);
    Robert Flack . unresolved

    It really feels like we should add the down and up nodes to the PointerAttributes data rather than create a second map.

    Joey Arhar

    I initially tried this but gave up, and I just tried again and I think I got it to work. How does it look?

    Joey Arhar

    It looks like I ended up causing a weird memory issue by doing this:
    ```
    # Fatal error in ../../v8/src/heap/cppgc/memory.h, line 33
    # Check failed: kZappedValue == reinterpret_cast<ConstAddress>(address)[i] (\xdc vs. '\0').
    #
    #
    #
    #FailureMessage Object: 0x7ffcbdbfd780#0 0x59765c472792 base::debug::CollectStackTrace()
    #1 0x59765c459d41 base::debug::StackTrace::StackTrace()
    #2 0x5976611b660d gin::(anonymous namespace)::PrintStackTrace()
    #3 0x59765e5b9b93 V8_Fatal()
    #4 0x597655f316de cppgc::internal::CheckMemoryIsInaccessible()
    #5 0x597655f43de1 cppgc::internal::HeapVisitor<>::Traverse()
    #6 0x597655f43256 cppgc::internal::(anonymous namespace)::MutatorThreadSweeper::Sweep()
    #7 0x597655f42dfb cppgc::internal::Sweeper::SweeperImpl::Finish()
    #8 0x597655f3d852 cppgc::internal::Sweeper::SweeperImpl::FinishIfRunning()
    #9 0x5976549b4ae7 v8::internal::CppHeap::FinishAtomicSweepingIfRunning()
    #10 0x597654a8bdc9 v8::internal::Heap::CollectGarbage()::$_0::operator()()
    #11 0x597654a8b95f heap::base::Stack::SetMarkerAndCallbackImpl<>()
    #12 0x597655f4ae8b PushAllRegistersAndIterateStack
    ```
    I can try figuring out what went wrong, but do you still feel that making PointerAttributes GarbageCollected is a good idea?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Robert Flack
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 13
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Comment-Date: Fri, 01 Aug 2025 15:55:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
    Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Aug 1, 2025, 12:57:29 PMAug 1
    to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Mustaq Ahmed and Robert Flack

    Joey Arhar added 1 comment

    File third_party/blink/renderer/core/events/pointer_event_factory.h
    Line 119, Patchset 12: Node* GetPointerTarget(WebInputEvent::Type type, PointerId pointer_id) const;
    Mustaq Ahmed . resolved

    I think two separate functions are better because this is only for two types: `GetPointerDownTarget` and `GetPointerUpTarget`.

    Joey Arhar

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mustaq Ahmed
    • Robert Flack
    Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Comment-Date: Fri, 01 Aug 2025 16:57:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mustaq Ahmed <mus...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Robert Flack (Gerrit)

    unread,
    Aug 6, 2025, 10:13:42 AMAug 6
    to Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar

    Robert Flack added 2 comments

    File third_party/blink/renderer/core/events/pointer_event_factory.cc
    Robert Flack

    Yes, this is where we get the attributes for a click for gestures, see PointerEventFactory::GetPointerIdForTouchGesture. If we need to know the down and up nodes for clicks as well we should add it here rather than creating a new structure.

    Line 635, Patchset 12: pointer_id_to_targets_.erase(mapped_id);
    Robert Flack . unresolved

    For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

    Joey Arhar

    I have been able to successfully get the pointer targets when a click is generated on a touch input, but now that PointerAttributes has all the info with the latest patchset I could look in the recently removed pointers for the down/up targets when retrieving the up/down targets. Should I do that in GetPointerTarget?

    Robert Flack

    Have you tested with a page that has double tap to zoom? In these cases the click comes 300ms after the pointerup.

    I do think we should look in the recently removed pointers as well, as this was added specifically for this case - to be able to get data for the click event (like the pointerid) that normally would have been forgotten by the time the click was generated.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 14
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Comment-Date: Wed, 06 Aug 2025 14:13:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Aug 13, 2025, 2:52:40 PMAug 13
    to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Mason Freed, Mustaq Ahmed and Robert Flack

    Joey Arhar added 4 comments

    File third_party/blink/renderer/core/events/pointer_event_factory.cc
    Line 629, Patchset 12: PointerAttributes attributes = pointer_id_to_attributes_.Take(mapped_id);
    Robert Flack . resolved
    Joey Arhar

    Done

    File third_party/blink/renderer/core/html/forms/select_type.cc
    Line 489, Patchset 10: // prevent light dismiss from closing the picker.
    Robert Flack . resolved

    I'm a bit confused by this. Is the intention to ignore events within inner elements? If so, can we do this by only acting on events whose event phase is kAtTarget to ignore clicks bubbling up from inner elements?

    Joey Arhar

    Events can bubble up from the author provided `<button>` or the author provided `<option>`/etc elements which are slotted into the picker, so I don't think we can figure this out without looking at the event path.

    Robert Flack

    Hmm, it seems like you're only interested in handling events targeting the popover. It seems like you wouldn't need these ancestor checks if the event handling happened in PopoverElementForAppearanceBase::DefaultEventHandler since then you would only be seeing events targeting the popover or some descendant of it.

    Mason Freed

    I think the problem is that we want to handle clicks on the <select> button or its descendants, but **not** descendants of the ::picker element popover (which is also a descendant of the <select>. So it's part of the tree, not just the popover and not just the select. Right jarhar@?

    Robert Flack

    Ah right, it's the inversion, it doesn't want to handle events whose target includes the popover, but it does want to handle events in other descendants.

    It seems like architecturally it would be cleaner to have the popover preventDefault or stopPropagation the event, but that would probably be too heavy handed since it would also prevent other default behaviors.

    Joey Arhar

    I'm guessing this is ok as is

    File third_party/blink/renderer/core/input/event_handler.cc
    Line 936, Patchset 10: mev.GetHitTestResult().InnerPossiblyPseudoNode());
    Robert Flack . resolved

    This doesn't take into account pointer capture, however I think that we should.

    Joey Arhar

    What is pointer capture?

    Joey Arhar

    I removed this parameter. Does that address your question?

    Joey Arhar

    I'm guessing it does

    File third_party/blink/renderer/core/input/pointer_event_manager.cc
    Line 1053, Patchset 12: pointer_event, target, &mouse_event);
    Robert Flack . unresolved

    You should probably be using the effective_target here so that if pointer capture is used we use the captured target and have the same target as the actual down and up events are dispatched to.

    Mustaq Ahmed

    The cleanest (and ideal) way to achieve it would be to call `PEF::SetPointerTarget` when dispatching down/up events at `PEM::DispatchPointerEvent`. But pseudo-element make it tricky!

    I think the core question is: what is the expected behavior when `pointerdown` goes to the backdrop and `pointerup` goes to the popover element but anytime in-between, the pointer was captured to the popover element? Maybe we could consider pseudo targets only for the default implicit capture with touch but that sounds hacky.

    Joey Arhar

    I'm no longer using pseudo-elements with this patch. Is this comment still relevant? Should I be passing something else to DispatchMouseClickIfNeeded later in this method?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mason Freed
    • Mustaq Ahmed
    • Robert Flack
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
    Gerrit-Change-Number: 6664038
    Gerrit-PatchSet: 17
    Gerrit-Owner: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Wed, 13 Aug 2025 18:52:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Mustaq Ahmed <mus...@chromium.org>
    Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
    Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
    Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Aug 13, 2025, 6:41:31 PMAug 13
    to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
    Attention needed from Joey Arhar, Mustaq Ahmed and Robert Flack

    Mason Freed added 3 comments

    Patchset-level comments
    File-level comment, Patchset 17 (Latest):
    Mason Freed . resolved

    This looks good I think. Just one question about resetting the pointers.

    File third_party/blink/renderer/core/events/pointer_event_factory.h
    Line 225, Patchset 11: // The number of entries in the list is kept below the inline capacity of the
    // `Deque` for performance reasons---we don't expect delayed requests for an
    // inactive pointer after a few latter pointers became inactive.
    Mason Freed . unresolved

    While there's no more inline capacity (intentional?) this is still the limit for the number of entries in the deque. Perhaps a quick comment about why "10"?

    File third_party/blink/renderer/core/input/pointer_event_manager.cc
    Line 1032, Patchset 17 (Latest): pointer_event_factory_->SetPointerDownTarget(pointer_event->pointerId(),
    Mason Freed . unresolved

    Do these need to be cleared somewhere? It feels like they could get left with stale results, which might be misinterpreted later. E.g. touchscreen seems to sometimes fire just a pointerup, without a corresponding pointerdown.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    • Mustaq Ahmed
    • Robert Flack
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedRecitation-Check
      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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
      Gerrit-Change-Number: 6664038
      Gerrit-PatchSet: 17
      Gerrit-Owner: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: David Bokan <bo...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Attention: Robert Flack <fla...@chromium.org>
      Gerrit-Attention: Joey Arhar <jar...@chromium.org>
      Gerrit-Comment-Date: Wed, 13 Aug 2025 22:41:21 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joey Arhar (Gerrit)

      unread,
      Aug 14, 2025, 6:46:50 PMAug 14
      to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Mason Freed, Mustaq Ahmed and Robert Flack

      Joey Arhar added 3 comments

      File third_party/blink/renderer/core/events/pointer_event_factory.h
      Line 225, Patchset 11: // The number of entries in the list is kept below the inline capacity of the
      // `Deque` for performance reasons---we don't expect delayed requests for an
      // inactive pointer after a few latter pointers became inactive.
      Mason Freed . resolved

      While there's no more inline capacity (intentional?) this is still the limit for the number of entries in the deque. Perhaps a quick comment about why "10"?

      Joey Arhar

      I moved the int to the cc file and re-added this comment with some more context.

      File third_party/blink/renderer/core/events/pointer_event_factory.cc
      Line 635, Patchset 12: pointer_id_to_targets_.erase(mapped_id);
      Robert Flack . unresolved

      For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

      Joey Arhar

      I have been able to successfully get the pointer targets when a click is generated on a touch input, but now that PointerAttributes has all the info with the latest patchset I could look in the recently removed pointers for the down/up targets when retrieving the up/down targets. Should I do that in GetPointerTarget?

      Robert Flack

      Have you tested with a page that has double tap to zoom? In these cases the click comes 300ms after the pointerup.

      I do think we should look in the recently removed pointers as well, as this was added specifically for this case - to be able to get data for the click event (like the pointerid) that normally would have been forgotten by the time the click was generated.

      Joey Arhar

      How does a page opt into double tap to zoom? Or how do i test this?

      Also, if the user is performing an action which zooms the page, I don't see why we would need to trigger light dismiss anyway.

      File third_party/blink/renderer/core/input/pointer_event_manager.cc
      Line 1032, Patchset 17 (Latest): pointer_event_factory_->SetPointerDownTarget(pointer_event->pointerId(),
      Mason Freed . unresolved

      Do these need to be cleared somewhere? It feels like they could get left with stale results, which might be misinterpreted later. E.g. touchscreen seems to sometimes fire just a pointerup, without a corresponding pointerdown.

      Joey Arhar

      I tried changing it to a WeakMember, lets see if the tests still pass

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mason Freed
      • Mustaq Ahmed
      • Robert Flack
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
      Gerrit-Change-Number: 6664038
      Gerrit-PatchSet: 17
      Gerrit-Owner: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: David Bokan <bo...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Attention: Robert Flack <fla...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Thu, 14 Aug 2025 22:46:40 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Robert Flack (Gerrit)

      unread,
      Aug 18, 2025, 2:14:51 PMAug 18
      to Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Joey Arhar, Mason Freed and Mustaq Ahmed

      Robert Flack added 1 comment

      File third_party/blink/renderer/core/events/pointer_event_factory.cc
      Line 635, Patchset 12: pointer_id_to_targets_.erase(mapped_id);
      Robert Flack . unresolved

      For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

      Joey Arhar

      I have been able to successfully get the pointer targets when a click is generated on a touch input, but now that PointerAttributes has all the info with the latest patchset I could look in the recently removed pointers for the down/up targets when retrieving the up/down targets. Should I do that in GetPointerTarget?

      Robert Flack

      Have you tested with a page that has double tap to zoom? In these cases the click comes 300ms after the pointerup.

      I do think we should look in the recently removed pointers as well, as this was added specifically for this case - to be able to get data for the click event (like the pointerid) that normally would have been forgotten by the time the click was generated.

      Joey Arhar

      How does a page opt into double tap to zoom? Or how do i test this?

      Also, if the user is performing an action which zooms the page, I don't see why we would need to trigger light dismiss anyway.

      Robert Flack

      The important difference is that when double tap to zoom is possible, we delay the click by 300ms so that if you double-tap within 300ms we don't click on the first tap. Double-tap to zoom is enabled by default on most sites that don't have a viewport meta tag, e.g. https://output.jsbin.com/feculinubo

      This means that when the click event is generated is long after the pointerdown/pointerup events.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Joey Arhar
      • Mason Freed
      • Mustaq Ahmed
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
      Gerrit-Change-Number: 6664038
      Gerrit-PatchSet: 18
      Gerrit-Owner: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: David Bokan <bo...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Attention: Joey Arhar <jar...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Mon, 18 Aug 2025 18:14:45 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      Aug 18, 2025, 3:54:07 PMAug 18
      to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Joey Arhar and Mustaq Ahmed

      Mason Freed added 1 comment

      File third_party/blink/renderer/core/input/pointer_event_manager.cc
      Line 1032, Patchset 17: pointer_event_factory_->SetPointerDownTarget(pointer_event->pointerId(),
      Mason Freed . unresolved

      Do these need to be cleared somewhere? It feels like they could get left with stale results, which might be misinterpreted later. E.g. touchscreen seems to sometimes fire just a pointerup, without a corresponding pointerdown.

      Joey Arhar

      I tried changing it to a WeakMember, lets see if the tests still pass

      Mason Freed

      I was thinking more about proactively setting the targets back to null when you're done with them. Relying on garbage collection to do that feels like a bug waiting to happen.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Joey Arhar
      • Mustaq Ahmed
      Gerrit-Comment-Date: Mon, 18 Aug 2025 19:53:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joey Arhar (Gerrit)

      unread,
      Aug 21, 2025, 6:33:41 PMAug 21
      to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Mason Freed, Mustaq Ahmed and Robert Flack

      Joey Arhar added 2 comments

      File third_party/blink/renderer/core/events/pointer_event_factory.cc
      Line 635, Patchset 12: pointer_id_to_targets_.erase(mapped_id);
      Robert Flack . unresolved

      For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

      Joey Arhar

      I have been able to successfully get the pointer targets when a click is generated on a touch input, but now that PointerAttributes has all the info with the latest patchset I could look in the recently removed pointers for the down/up targets when retrieving the up/down targets. Should I do that in GetPointerTarget?

      Robert Flack

      Have you tested with a page that has double tap to zoom? In these cases the click comes 300ms after the pointerup.

      I do think we should look in the recently removed pointers as well, as this was added specifically for this case - to be able to get data for the click event (like the pointerid) that normally would have been forgotten by the time the click was generated.

      Joey Arhar

      How does a page opt into double tap to zoom? Or how do i test this?

      Also, if the user is performing an action which zooms the page, I don't see why we would need to trigger light dismiss anyway.

      Robert Flack

      The important difference is that when double tap to zoom is possible, we delay the click by 300ms so that if you double-tap within 300ms we don't click on the first tap. Double-tap to zoom is enabled by default on most sites that don't have a viewport meta tag, e.g. https://output.jsbin.com/feculinubo

      This means that when the click event is generated is long after the pointerdown/pointerup events.

      Joey Arhar

      Thanks, I manually tested this out with mobile device emulation. I observed that double tap to zoom did zoom, and I could see that clicks were delayed. Light dismiss worked as expected, including with nested popovers, so I think the current patch is good.

      File third_party/blink/renderer/core/input/pointer_event_manager.cc
      Line 1032, Patchset 17: pointer_event_factory_->SetPointerDownTarget(pointer_event->pointerId(),
      Mason Freed . resolved

      Do these need to be cleared somewhere? It feels like they could get left with stale results, which might be misinterpreted later. E.g. touchscreen seems to sometimes fire just a pointerup, without a corresponding pointerdown.

      Joey Arhar

      I tried changing it to a WeakMember, lets see if the tests still pass

      Mason Freed

      I was thinking more about proactively setting the targets back to null when you're done with them. Relying on garbage collection to do that feels like a bug waiting to happen.

      Joey Arhar

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mason Freed
      • Mustaq Ahmed
      • Robert Flack
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
      Gerrit-Change-Number: 6664038
      Gerrit-PatchSet: 19
      Gerrit-Owner: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: David Bokan <bo...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Attention: Robert Flack <fla...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Thu, 21 Aug 2025 22:33:30 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joey Arhar (Gerrit)

      unread,
      Aug 22, 2025, 10:58:26 AMAug 22
      to Robert Flack, Mustaq Ahmed, Mason Freed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Mason Freed, Mustaq Ahmed and Robert Flack

      Joey Arhar voted Commit-Queue+1

      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mason Freed
      • Mustaq Ahmed
      • Robert Flack
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
      Gerrit-Change-Number: 6664038
      Gerrit-PatchSet: 20
      Gerrit-Owner: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: David Bokan <bo...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
      Gerrit-Attention: Robert Flack <fla...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Fri, 22 Aug 2025 14:58:15 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      Aug 22, 2025, 7:50:43 PMAug 22
      to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
      Attention needed from Joey Arhar, Mustaq Ahmed and Robert Flack

      Mason Freed voted and added 2 comments

      Votes added by Mason Freed

      Code-Review+1

      2 comments

      File third_party/blink/renderer/core/events/pointer_event_factory.cc
      Line 25, Patchset 20 (Latest):// recently_removed_pointers_ is kept below the inline capacity of the `Deque`
      Mason Freed . unresolved

      Is there a Deque somewhere that still uses this? `recently_removed_pointers_` no longer uses it, anyway...

      File third_party/blink/renderer/core/input/pointer_event_manager.cc
      Line 1163, Patchset 20 (Latest): pointer_event_factory_->SetPointerDownTarget(pointer_event->pointerId(),
      nullptr);
      pointer_event_factory_->SetPointerUpTarget(pointer_event->pointerId(),
      nullptr);
      Mason Freed . resolved

      Thanks.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Joey Arhar
      • Mustaq Ahmed
      • Robert Flack
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
        Gerrit-Change-Number: 6664038
        Gerrit-PatchSet: 20
        Gerrit-Owner: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
        Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
        Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
        Gerrit-CC: David Bokan <bo...@chromium.org>
        Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Attention: Robert Flack <fla...@chromium.org>
        Gerrit-Attention: Joey Arhar <jar...@chromium.org>
        Gerrit-Comment-Date: Fri, 22 Aug 2025 23:50:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Joey Arhar (Gerrit)

        unread,
        Aug 25, 2025, 7:31:14 PMAug 25
        to Mason Freed, Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Mason Freed, Mustaq Ahmed and Robert Flack

        Joey Arhar added 1 comment

        File third_party/blink/renderer/core/events/pointer_event_factory.cc
        Line 25, Patchset 20 (Latest):// recently_removed_pointers_ is kept below the inline capacity of the `Deque`
        Mason Freed . unresolved

        Is there a Deque somewhere that still uses this? `recently_removed_pointers_` no longer uses it, anyway...

        Joey Arhar

        We are using this on recently_removed_pointers_ in order to keep the size below 10. So there is a deque which uses it, depending on how you define using it, right?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Mason Freed
        • Mustaq Ahmed
        • Robert Flack
        Gerrit-Attention: Mason Freed <mas...@chromium.org>
        Gerrit-Comment-Date: Mon, 25 Aug 2025 23:31:03 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mason Freed (Gerrit)

        unread,
        Aug 26, 2025, 12:15:04 PMAug 26
        to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Joey Arhar, Mustaq Ahmed and Robert Flack

        Mason Freed added 1 comment

        File third_party/blink/renderer/core/events/pointer_event_factory.cc
        Line 25, Patchset 20 (Latest):// recently_removed_pointers_ is kept below the inline capacity of the `Deque`
        Mason Freed . unresolved

        Is there a Deque somewhere that still uses this? `recently_removed_pointers_` no longer uses it, anyway...

        Joey Arhar

        We are using this on recently_removed_pointers_ in order to keep the size below 10. So there is a deque which uses it, depending on how you define using it, right?

        Mason Freed

        I just meant that it says "the inline capacity of the Deque" and the Deque doesn't have any inline capacity any longer:

        ```
        HeapDeque<Member<PointerIdAndAttributes>> recently_removed_pointers_;
        ```
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joey Arhar
        • Mustaq Ahmed
        • Robert Flack
        Gerrit-Attention: Joey Arhar <jar...@chromium.org>
        Gerrit-Comment-Date: Tue, 26 Aug 2025 16:14:49 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Robert Flack (Gerrit)

        unread,
        Aug 26, 2025, 2:51:51 PMAug 26
        to Mason Freed, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Joey Arhar and Mustaq Ahmed

        Robert Flack added 1 comment

        File third_party/blink/renderer/core/events/pointer_event_factory.cc
        Line 635, Patchset 12: pointer_id_to_targets_.erase(mapped_id);
        Robert Flack . unresolved

        For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

        Joey Arhar

        I have been able to successfully get the pointer targets when a click is generated on a touch input, but now that PointerAttributes has all the info with the latest patchset I could look in the recently removed pointers for the down/up targets when retrieving the up/down targets. Should I do that in GetPointerTarget?

        Robert Flack

        Have you tested with a page that has double tap to zoom? In these cases the click comes 300ms after the pointerup.

        I do think we should look in the recently removed pointers as well, as this was added specifically for this case - to be able to get data for the click event (like the pointerid) that normally would have been forgotten by the time the click was generated.

        Joey Arhar

        How does a page opt into double tap to zoom? Or how do i test this?

        Also, if the user is performing an action which zooms the page, I don't see why we would need to trigger light dismiss anyway.

        Robert Flack

        The important difference is that when double tap to zoom is possible, we delay the click by 300ms so that if you double-tap within 300ms we don't click on the first tap. Double-tap to zoom is enabled by default on most sites that don't have a viewport meta tag, e.g. https://output.jsbin.com/feculinubo

        This means that when the click event is generated is long after the pointerdown/pointerup events.

        Joey Arhar

        Thanks, I manually tested this out with mobile device emulation. I observed that double tap to zoom did zoom, and I could see that clicks were delayed. Light dismiss worked as expected, including with nested popovers, so I think the current patch is good.

        Robert Flack

        I'm sorry, I don't understand how this could work.

        See PointerEventFactory::GetPointerIdForTouchGesture for how we search recently_removed_pointers_ to get the pointer id for clicks for delayed taps (called from [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=1395;drc=e7c5ae7ea3380cd3dcb7cde4d784b7bd96fdabee;bpv=1;bpt=1)).

        If we have to search the recently_removed_pointers_ to get the pointer id for a delayed tap then I'd expect we'd have to do something similar when finding the last down or up node. Maybe dev tools isn't sufficient to test this code path and it needs to be run on a real device?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joey Arhar
        • Mustaq Ahmed
        Gerrit-Attention: Joey Arhar <jar...@chromium.org>
        Gerrit-Comment-Date: Tue, 26 Aug 2025 18:51:45 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Joey Arhar (Gerrit)

        unread,
        Aug 26, 2025, 6:55:09 PMAug 26
        to Mason Freed, Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Mustaq Ahmed and Robert Flack

        Joey Arhar added 1 comment

        File third_party/blink/renderer/core/events/pointer_event_factory.cc
        Line 635, Patchset 12: pointer_id_to_targets_.erase(mapped_id);
        Robert Flack . unresolved

        For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

        Joey Arhar

        I have been able to successfully get the pointer targets when a click is generated on a touch input, but now that PointerAttributes has all the info with the latest patchset I could look in the recently removed pointers for the down/up targets when retrieving the up/down targets. Should I do that in GetPointerTarget?

        Robert Flack

        Have you tested with a page that has double tap to zoom? In these cases the click comes 300ms after the pointerup.

        I do think we should look in the recently removed pointers as well, as this was added specifically for this case - to be able to get data for the click event (like the pointerid) that normally would have been forgotten by the time the click was generated.

        Joey Arhar

        How does a page opt into double tap to zoom? Or how do i test this?

        Also, if the user is performing an action which zooms the page, I don't see why we would need to trigger light dismiss anyway.

        Robert Flack

        The important difference is that when double tap to zoom is possible, we delay the click by 300ms so that if you double-tap within 300ms we don't click on the first tap. Double-tap to zoom is enabled by default on most sites that don't have a viewport meta tag, e.g. https://output.jsbin.com/feculinubo

        This means that when the click event is generated is long after the pointerdown/pointerup events.

        Joey Arhar

        Thanks, I manually tested this out with mobile device emulation. I observed that double tap to zoom did zoom, and I could see that clicks were delayed. Light dismiss worked as expected, including with nested popovers, so I think the current patch is good.

        Robert Flack

        I'm sorry, I don't understand how this could work.

        See PointerEventFactory::GetPointerIdForTouchGesture for how we search recently_removed_pointers_ to get the pointer id for clicks for delayed taps (called from [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=1395;drc=e7c5ae7ea3380cd3dcb7cde4d784b7bd96fdabee;bpv=1;bpt=1)).

        If we have to search the recently_removed_pointers_ to get the pointer id for a delayed tap then I'd expect we'd have to do something similar when finding the last down or up node. Maybe dev tools isn't sufficient to test this code path and it needs to be run on a real device?

        Joey Arhar

        I built this patch and ran it on my pixel 7, and I got the same results from testing it out as I did with mobile device emulation - the light dismiss is delayed like the click is, but it works and also works with nested popovers.

        Maybe this works because PointerEventFactory::Remove in the latest patchset doesn't have much changes to it anymore, now that I combined the new struct with the existing one?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Mustaq Ahmed
        • Robert Flack
        Gerrit-Attention: Robert Flack <fla...@chromium.org>
        Gerrit-Comment-Date: Tue, 26 Aug 2025 22:54:58 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Robert Flack (Gerrit)

        unread,
        Aug 27, 2025, 9:02:39 PMAug 27
        to Mason Freed, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Joey Arhar and Mustaq Ahmed

        Robert Flack added 7 comments

        File third_party/blink/renderer/core/events/pointer_event_factory.cc
        Line 635, Patchset 12: pointer_id_to_targets_.erase(mapped_id);
        Robert Flack . resolved

        For touch we remove the pointer before the click is generated, see https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=600;drc=6ef235e211f9d0e6f493d65570859fef5e9d54f0;bpv=1;bpt=1. You might need to add this to the data saved in SaveRecentlyRemovedPointer so that when the click is generated we can look this up. That said, touch also has implicit capture so unless the developer explicitly removed the implicit capture the target of the click would also be the target of both the down and up event.

        Joey Arhar

        I have been able to successfully get the pointer targets when a click is generated on a touch input, but now that PointerAttributes has all the info with the latest patchset I could look in the recently removed pointers for the down/up targets when retrieving the up/down targets. Should I do that in GetPointerTarget?

        Robert Flack

        Have you tested with a page that has double tap to zoom? In these cases the click comes 300ms after the pointerup.

        I do think we should look in the recently removed pointers as well, as this was added specifically for this case - to be able to get data for the click event (like the pointerid) that normally would have been forgotten by the time the click was generated.

        Joey Arhar

        How does a page opt into double tap to zoom? Or how do i test this?

        Also, if the user is performing an action which zooms the page, I don't see why we would need to trigger light dismiss anyway.

        Robert Flack

        The important difference is that when double tap to zoom is possible, we delay the click by 300ms so that if you double-tap within 300ms we don't click on the first tap. Double-tap to zoom is enabled by default on most sites that don't have a viewport meta tag, e.g. https://output.jsbin.com/feculinubo

        This means that when the click event is generated is long after the pointerdown/pointerup events.

        Joey Arhar

        Thanks, I manually tested this out with mobile device emulation. I observed that double tap to zoom did zoom, and I could see that clicks were delayed. Light dismiss worked as expected, including with nested popovers, so I think the current patch is good.

        Robert Flack

        I'm sorry, I don't understand how this could work.

        See PointerEventFactory::GetPointerIdForTouchGesture for how we search recently_removed_pointers_ to get the pointer id for clicks for delayed taps (called from [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/pointer_event_manager.cc;l=1395;drc=e7c5ae7ea3380cd3dcb7cde4d784b7bd96fdabee;bpv=1;bpt=1)).

        If we have to search the recently_removed_pointers_ to get the pointer id for a delayed tap then I'd expect we'd have to do something similar when finding the last down or up node. Maybe dev tools isn't sufficient to test this code path and it needs to be run on a real device?

        Joey Arhar

        I built this patch and ran it on my pixel 7, and I got the same results from testing it out as I did with mobile device emulation - the light dismiss is delayed like the click is, but it works and also works with nested popovers.

        Maybe this works because PointerEventFactory::Remove in the latest patchset doesn't have much changes to it anymore, now that I combined the new struct with the existing one?

        Robert Flack

        I figured out why this is working, see my new comment in gesture_manager.cc.

        File third_party/blink/renderer/core/html/html_dialog_element.cc
        Line 357, Patchset 20 (Latest): FindNearestDialog(pointer_up_target, client_x, client_y);
        Robert Flack . unresolved

        It seems to me that since we use the final position this doesn't handle the drag out case that it is intended to handle. Testing on https://jsbin.com/ralifet/edit?html,css,js,output it seems that drags that start selecting text and end outside the dialog still close it which I thought was not the intended behavior.

        File third_party/blink/renderer/core/input/gesture_manager.cc
        Line 359, Patchset 20 (Latest): /*pointer_up_target=*/current_hit_test.InnerElement());
        Robert Flack . unresolved

        Ah I see, you're not currently using the remembered pointerdown and pointerup targets for clicks from taps. This is why it didn't matter that you weren't checking recently_removed_pointers_.

        This won't necessarily match the down and up events that lead to the click which could have modified the dom or used pointer capture which I assume means it won't match the specified behavior in these cases. Is this okay?

        File third_party/blink/renderer/core/input/mouse_event_manager.cc
        Line 247, Patchset 20 (Latest): mouse_event_type == event_type_names::kClick && pointer_up_target) {
        Robert Flack . unresolved

        It seems to me that we should do this after calling DispatchEvent and determining that the input_event_result is kNotHandled so that if the developer calls preventDefault it will prevent the dialog from closing, e.g. https://jsbin.com/ralifet/edit?html,css,js,output

        Line 249, Patchset 20 (Latest): // isn't.
        Robert Flack . unresolved

        What's an example of when this happens? Is this behavior broken?

        File third_party/blink/renderer/core/input/pointer_event_manager.h
        Line 49, Patchset 20 (Latest): // which might be null in cases where there is no HitTestResult.
        Robert Flack . unresolved

        Do you mean target?

        File third_party/blink/renderer/core/input/pointer_event_manager.cc
        Line 1053, Patchset 12: pointer_event, target, &mouse_event);
        Robert Flack . unresolved

        You should probably be using the effective_target here so that if pointer capture is used we use the captured target and have the same target as the actual down and up events are dispatched to.

        Mustaq Ahmed

        The cleanest (and ideal) way to achieve it would be to call `PEF::SetPointerTarget` when dispatching down/up events at `PEM::DispatchPointerEvent`. But pseudo-element make it tricky!

        I think the core question is: what is the expected behavior when `pointerdown` goes to the backdrop and `pointerup` goes to the popover element but anytime in-between, the pointer was captured to the popover element? Maybe we could consider pseudo targets only for the default implicit capture with touch but that sounds hacky.

        Joey Arhar

        I'm no longer using pseudo-elements with this patch. Is this comment still relevant? Should I be passing something else to DispatchMouseClickIfNeeded later in this method?

        Robert Flack

        Yes, my comment applies to regular targets. If the developer has called setPointerCapture this line can change the effective target. We should already be taking capture targets into account for click targeting, and as such we should also use captured targets for the pointer down / up nodes.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joey Arhar
        • Mustaq Ahmed
        Gerrit-Attention: Joey Arhar <jar...@chromium.org>
        Gerrit-Comment-Date: Thu, 28 Aug 2025 01:02:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Mustaq Ahmed <mus...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Joey Arhar (Gerrit)

        unread,
        Aug 29, 2025, 4:24:40 PMAug 29
        to Mason Freed, Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Mustaq Ahmed and Robert Flack

        Joey Arhar added 6 comments

        File third_party/blink/renderer/core/html/html_dialog_element.cc
        Line 357, Patchset 20: FindNearestDialog(pointer_up_target, client_x, client_y);
        Robert Flack . unresolved

        It seems to me that since we use the final position this doesn't handle the drag out case that it is intended to handle. Testing on https://jsbin.com/ralifet/edit?html,css,js,output it seems that drags that start selecting text and end outside the dialog still close it which I thought was not the intended behavior.

        Joey Arhar

        You're right, and I don't think we're storing the x and y coordinates of the pointerdown anywhere. I wonder if that would be even harder to spell out in the spec.

        This makes me want to go back to using pseudo-elements so we can get rid of the x and y coordinates here.

        Do you have any recommendation on which to choose?

        File third_party/blink/renderer/core/input/gesture_manager.cc
        Line 359, Patchset 20: /*pointer_up_target=*/current_hit_test.InnerElement());
        Robert Flack . unresolved

        Ah I see, you're not currently using the remembered pointerdown and pointerup targets for clicks from taps. This is why it didn't matter that you weren't checking recently_removed_pointers_.

        This won't necessarily match the down and up events that lead to the click which could have modified the dom or used pointer capture which I assume means it won't match the specified behavior in these cases. Is this okay?

        Joey Arhar

        I think its fine, I'm having a hard time imagining a scenario where a click and drag with a touch device with pointer capture ends up leading to a gesturetap in a way which actually affects light dismiss.

        The reason I wrote this code is because I assumed that a gesturetap event means that it was not a click and drag

        File third_party/blink/renderer/core/input/mouse_event_manager.cc
        Line 247, Patchset 20: mouse_event_type == event_type_names::kClick && pointer_up_target) {
        Robert Flack . unresolved

        It seems to me that we should do this after calling DispatchEvent and determining that the input_event_result is kNotHandled so that if the developer calls preventDefault it will prevent the dialog from closing, e.g. https://jsbin.com/ralifet/edit?html,css,js,output

        Joey Arhar

        That would make sense, but we had a whole spec discussion when implementing light dismiss for popovers about how the reviewer believed that we should do events completely separately from the actual light dismiss handling, and cited this: https://dom.spec.whatwg.org/#action-versus-occurrence

        You can see in the existing implementation that calling preventDefault on pointerdown doesn't stop the light dismiss from happening.

        I think that making preventDefault work makes sense, but I think it would be a separate discussion from this change.

        Robert Flack . unresolved

        What's an example of when this happens? Is this behavior broken?

        Joey Arhar

        I'm going to try removing it to find the case again

        File third_party/blink/renderer/core/input/pointer_event_manager.h
        Line 49, Patchset 20: // which might be null in cases where there is no HitTestResult.
        Robert Flack . resolved

        Do you mean target?

        Joey Arhar

        Removed this comment, thanks

        File third_party/blink/renderer/core/input/pointer_event_manager.cc
        Line 1053, Patchset 12: pointer_event, target, &mouse_event);
        Robert Flack . unresolved

        You should probably be using the effective_target here so that if pointer capture is used we use the captured target and have the same target as the actual down and up events are dispatched to.

        Mustaq Ahmed

        The cleanest (and ideal) way to achieve it would be to call `PEF::SetPointerTarget` when dispatching down/up events at `PEM::DispatchPointerEvent`. But pseudo-element make it tricky!

        I think the core question is: what is the expected behavior when `pointerdown` goes to the backdrop and `pointerup` goes to the popover element but anytime in-between, the pointer was captured to the popover element? Maybe we could consider pseudo targets only for the default implicit capture with touch but that sounds hacky.

        Joey Arhar

        I'm no longer using pseudo-elements with this patch. Is this comment still relevant? Should I be passing something else to DispatchMouseClickIfNeeded later in this method?

        Robert Flack

        Yes, my comment applies to regular targets. If the developer has called setPointerCapture this line can change the effective target. We should already be taking capture targets into account for click targeting, and as such we should also use captured targets for the pointer down / up nodes.

        Joey Arhar

        Ok, I changed this to store effective_target instead of target

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Mustaq Ahmed
        • Robert Flack
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
        Gerrit-Change-Number: 6664038
        Gerrit-PatchSet: 21
        Gerrit-Owner: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
        Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
        Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
        Gerrit-CC: David Bokan <bo...@chromium.org>
        Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Attention: Robert Flack <fla...@chromium.org>
        Gerrit-Comment-Date: Fri, 29 Aug 2025 20:24:26 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Joey Arhar (Gerrit)

        unread,
        Sep 2, 2025, 4:21:47 PMSep 2
        to Mason Freed, Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Mustaq Ahmed and Robert Flack

        Joey Arhar added 1 comment

        File third_party/blink/renderer/core/input/mouse_event_manager.cc
        Robert Flack . resolved

        What's an example of when this happens? Is this behavior broken?

        Joey Arhar

        I'm going to try removing it to find the case again

        Joey Arhar

        I wasn't able to reproduce this issue, so I replaced this with a CHECK that both are non-null

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Mustaq Ahmed
        • Robert Flack
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
        Gerrit-Change-Number: 6664038
        Gerrit-PatchSet: 22
        Gerrit-Owner: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
        Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
        Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
        Gerrit-CC: David Bokan <bo...@chromium.org>
        Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Attention: Robert Flack <fla...@chromium.org>
        Gerrit-Comment-Date: Tue, 02 Sep 2025 20:21:36 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Robert Flack (Gerrit)

        unread,
        Sep 3, 2025, 5:13:50 PMSep 3
        to Mason Freed, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Joey Arhar and Mustaq Ahmed

        Robert Flack added 4 comments

        File third_party/blink/renderer/core/html/html_dialog_element.cc
        Line 357, Patchset 20: FindNearestDialog(pointer_up_target, client_x, client_y);
        Robert Flack . unresolved

        It seems to me that since we use the final position this doesn't handle the drag out case that it is intended to handle. Testing on https://jsbin.com/ralifet/edit?html,css,js,output it seems that drags that start selecting text and end outside the dialog still close it which I thought was not the intended behavior.

        Joey Arhar

        You're right, and I don't think we're storing the x and y coordinates of the pointerdown anywhere. I wonder if that would be even harder to spell out in the spec.

        This makes me want to go back to using pseudo-elements so we can get rid of the x and y coordinates here.

        Do you have any recommendation on which to choose?

        Robert Flack

        I think keeping the pseudoelement targets internally is cleaner.

        File third_party/blink/renderer/core/input/gesture_manager.cc
        Line 359, Patchset 20: /*pointer_up_target=*/current_hit_test.InnerElement());
        Robert Flack . unresolved

        Ah I see, you're not currently using the remembered pointerdown and pointerup targets for clicks from taps. This is why it didn't matter that you weren't checking recently_removed_pointers_.

        This won't necessarily match the down and up events that lead to the click which could have modified the dom or used pointer capture which I assume means it won't match the specified behavior in these cases. Is this okay?

        Joey Arhar

        I think its fine, I'm having a hard time imagining a scenario where a click and drag with a touch device with pointer capture ends up leading to a gesturetap in a way which actually affects light dismiss.

        The reason I wrote this code is because I assumed that a gesturetap event means that it was not a click and drag

        Robert Flack

        Yes, a gesturetap is a stationary down and up event, and yes, I agree that it will probably do what you want. However, from a specification point of view, there are a few situations that can happen where these are not technically correct:

        1. A developer calls releasePointerCapture in the pointerdown listener releasing the [implicit pointer capture](https://w3c.github.io/pointerevents/#dfn-implicit-pointer-capture), and modifies the dom such that the up event has a different target.
        2. A developer calls [setPointerCapture](https://w3c.github.io/pointerevents/#dom-element-setpointercapture) on pointerdown to capture the events (and clicks) to some other node.

        While it's probably going to work fine most of the time, these edge cases are not going to match your specified behavior if you ignore the resolved down and up targets.

        File third_party/blink/renderer/core/input/mouse_event_manager.cc
        Line 247, Patchset 20: mouse_event_type == event_type_names::kClick && pointer_up_target) {
        Robert Flack . resolved

        It seems to me that we should do this after calling DispatchEvent and determining that the input_event_result is kNotHandled so that if the developer calls preventDefault it will prevent the dialog from closing, e.g. https://jsbin.com/ralifet/edit?html,css,js,output

        Joey Arhar

        That would make sense, but we had a whole spec discussion when implementing light dismiss for popovers about how the reviewer believed that we should do events completely separately from the actual light dismiss handling, and cited this: https://dom.spec.whatwg.org/#action-versus-occurrence

        You can see in the existing implementation that calling preventDefault on pointerdown doesn't stop the light dismiss from happening.

        I think that making preventDefault work makes sense, but I think it would be a separate discussion from this change.

        Robert Flack

        Acknowledged, treating this as a separate issue seems reasonable.

        Robert Flack . unresolved

        What's an example of when this happens? Is this behavior broken?

        Joey Arhar

        I'm going to try removing it to find the case again

        Joey Arhar

        I wasn't able to reproduce this issue, so I replaced this with a CHECK that both are non-null

        Robert Flack

        I suppose an example of this would be if an earlier event listener removes the pointerdown or pointerup target. We maybe need similar behavior to how we track the still attached ancestor if a node is removed, see MouseEventManager handling here: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/mouse_event_manager.cc?q=file:mouse_event_manager%5C.cc%20MouseEventManager::HandleRemoveSubtree&ss=chromium%2Fchromium%2Fsrc

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joey Arhar
        • Mustaq Ahmed
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
        Gerrit-Change-Number: 6664038
        Gerrit-PatchSet: 23
        Gerrit-Owner: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
        Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
        Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
        Gerrit-CC: David Bokan <bo...@chromium.org>
        Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Attention: Joey Arhar <jar...@chromium.org>
        Gerrit-Comment-Date: Wed, 03 Sep 2025 21:13:35 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mason Freed (Gerrit)

        unread,
        Sep 15, 2025, 4:49:29 PM (4 days ago) Sep 15
        to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Joey Arhar and Mustaq Ahmed

        Mason Freed voted and added 4 comments

        Votes added by Mason Freed

        Code-Review+1

        4 comments

        Patchset-level comments
        File-level comment, Patchset 27 (Latest):
        Mason Freed . resolved

        Still seems ok to me, modulo flackr@ comments/questions.

        File third_party/blink/renderer/core/events/pointer_event_factory.h
        Line 131, Patchset 27 (Latest): Node* target,
        double client_x,
        double client_y);
        Mason Freed . unresolved

        Any reason not to take in a PointerTarget instead of the three parts?

        File third_party/blink/renderer/core/html/html_dialog_element.cc
        Line 342, Patchset 27 (Latest): const Node& pointer_down_target,
        double pointer_down_client_x,
        double pointer_down_client_y,
        Mason Freed . unresolved

        Perhaps here too?

        File third_party/blink/renderer/core/input/gesture_manager.cc
        Line 370, Patchset 27 (Latest): // pointer events weren't fired for this touch, so we need to fake the
        Mason Freed . unresolved

        Can you elaborate on when/why that happens?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joey Arhar
        • Mustaq Ahmed
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
        Gerrit-Change-Number: 6664038
        Gerrit-PatchSet: 27
        Gerrit-Owner: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
        Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
        Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
        Gerrit-CC: David Bokan <bo...@chromium.org>
        Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Attention: Joey Arhar <jar...@chromium.org>
        Gerrit-Comment-Date: Mon, 15 Sep 2025 20:49:17 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Joey Arhar (Gerrit)

        unread,
        Sep 16, 2025, 1:42:56 PM (3 days ago) Sep 16
        to Mason Freed, Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Mustaq Ahmed and Robert Flack

        Joey Arhar added 2 comments

        File third_party/blink/renderer/core/html/html_dialog_element.cc
        Line 357, Patchset 20: FindNearestDialog(pointer_up_target, client_x, client_y);
        Robert Flack . unresolved

        It seems to me that since we use the final position this doesn't handle the drag out case that it is intended to handle. Testing on https://jsbin.com/ralifet/edit?html,css,js,output it seems that drags that start selecting text and end outside the dialog still close it which I thought was not the intended behavior.

        Joey Arhar

        You're right, and I don't think we're storing the x and y coordinates of the pointerdown anywhere. I wonder if that would be even harder to spell out in the spec.

        This makes me want to go back to using pseudo-elements so we can get rid of the x and y coordinates here.

        Do you have any recommendation on which to choose?

        Robert Flack

        I think keeping the pseudoelement targets internally is cleaner.

        Joey Arhar

        I tried going back to pseudo-elements briefly, but found that it was harder with the way this patch has gone now. I am now storing the x and y coordinates along with the pointerdown and pointerup target elements, and I added a test for this case.

        File third_party/blink/renderer/core/input/gesture_manager.cc
        Line 359, Patchset 20: /*pointer_up_target=*/current_hit_test.InnerElement());
        Robert Flack . unresolved

        Ah I see, you're not currently using the remembered pointerdown and pointerup targets for clicks from taps. This is why it didn't matter that you weren't checking recently_removed_pointers_.

        This won't necessarily match the down and up events that lead to the click which could have modified the dom or used pointer capture which I assume means it won't match the specified behavior in these cases. Is this okay?

        Joey Arhar

        I think its fine, I'm having a hard time imagining a scenario where a click and drag with a touch device with pointer capture ends up leading to a gesturetap in a way which actually affects light dismiss.

        The reason I wrote this code is because I assumed that a gesturetap event means that it was not a click and drag

        Robert Flack

        Yes, a gesturetap is a stationary down and up event, and yes, I agree that it will probably do what you want. However, from a specification point of view, there are a few situations that can happen where these are not technically correct:

        1. A developer calls releasePointerCapture in the pointerdown listener releasing the [implicit pointer capture](https://w3c.github.io/pointerevents/#dfn-implicit-pointer-capture), and modifies the dom such that the up event has a different target.
        2. A developer calls [setPointerCapture](https://w3c.github.io/pointerevents/#dom-element-setpointercapture) on pointerdown to capture the events (and clicks) to some other node.

        While it's probably going to work fine most of the time, these edge cases are not going to match your specified behavior if you ignore the resolved down and up targets.

        Joey Arhar

        Thanks, I added a test for this case and changed things to use the stored targets of pointer events if pointer events were fired.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Mustaq Ahmed
        • Robert Flack
        Gerrit-Attention: Robert Flack <fla...@chromium.org>
        Gerrit-Comment-Date: Tue, 16 Sep 2025 17:42:45 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mustaq Ahmed (Gerrit)

        unread,
        Sep 17, 2025, 11:32:16 AM (2 days ago) Sep 17
        to Mason Freed, Robert Flack, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Joey Arhar and Robert Flack

        Mustaq Ahmed added 6 comments

        Patchset-level comments
        Mustaq Ahmed . unresolved

        Here are a few comments from me. I tried to make them mostly independent from Rob's to avoid confusions.

        My biggest concern here is attempting an XL-sized CL that touches the input event "state machine" that is known to cause compat problems with even subtle changes! I suggested two possible splits below: making PEM etc GCed, and event target tracking with DOM changes. I will be happy to suggest other possibilities if you also see this as a logical way forward here.

        File third_party/blink/renderer/core/events/pointer_event_factory.h
        Line 248, Patchset 27 (Latest): HeapDeque<Member<PointerIdAndAttributes>> recently_removed_pointers_;
        Mustaq Ahmed . unresolved

        It seems [`HeapVector`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/heap/collection_support/heap_vector.h;drc=5bd71e097f24bdc168e1add9159532f7951bd673;l=175) supports inline capacity, right? Since we are enforcing `kRemovedPointersCapacity` in .cc anyway, please consider adding back the capacity here.

        Line 33, Patchset 27 (Latest): : public GarbageCollected<PointerEventFactory> {
        Mustaq Ahmed . unresolved

        Any chance we can split this XL-sized CL into smaller ones? Perhaps "making the PEM/PEF GarbageCollected" is an independent change that could land w/o waiting for any popover discussion here.

        File third_party/blink/renderer/core/input/gesture_manager.cc
        Line 370, Patchset 27 (Latest): // pointer events weren't fired for this touch, so we need to fake the
        Mason Freed . unresolved

        Can you elaborate on when/why that happens?

        Mustaq Ahmed

        I would suggest a comment like this: "The browser didn't send any pointer events for this touch (e.g. because there is no event handlers) ...".

        File third_party/blink/renderer/core/input/mouse_event_manager.cc
        Robert Flack . unresolved

        What's an example of when this happens? Is this behavior broken?

        Joey Arhar

        I'm going to try removing it to find the case again

        Joey Arhar

        I wasn't able to reproduce this issue, so I replaced this with a CHECK that both are non-null

        Robert Flack

        I suppose an example of this would be if an earlier event listener removes the pointerdown or pointerup target. We maybe need similar behavior to how we track the still attached ancestor if a node is removed, see MouseEventManager handling here: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/mouse_event_manager.cc?q=file:mouse_event_manager%5C.cc%20MouseEventManager::HandleRemoveSubtree&ss=chromium%2Fchromium%2Fsrc

        Mustaq Ahmed

        I would suggest that in a separate CL before/after this one to track the removed down/up target. I fear making PEF aware of DOM changes is another big change that should perhaps go separately from this.

        File third_party/blink/renderer/platform/runtime_enabled_features.json5
        Line 2911, Patchset 27 (Latest): // bugs for touch inputs.
        Mustaq Ahmed . unresolved

        Nit: maybe a crbug ref?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joey Arhar
        • Robert Flack
        Gerrit-Attention: Joey Arhar <jar...@chromium.org>
        Gerrit-Attention: Robert Flack <fla...@chromium.org>
        Gerrit-Comment-Date: Wed, 17 Sep 2025 15:32:09 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
        Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
        Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mason Freed (Gerrit)

        unread,
        Sep 18, 2025, 4:43:55 PM (yesterday) Sep 18
        to Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Joey Arhar and Robert Flack

        Mason Freed voted and added 1 comment

        Votes added by Mason Freed

        Code-Review+1

        1 comment

        Patchset-level comments
        File-level comment, Patchset 28 (Latest):
        Mason Freed . resolved

        27->28 looks like a rebase. Not sure what cleared my +1. But here it is again.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joey Arhar
        • Robert Flack
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
        Gerrit-Change-Number: 6664038
        Gerrit-PatchSet: 28
        Gerrit-Owner: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
        Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
        Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
        Gerrit-CC: David Bokan <bo...@chromium.org>
        Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Joey Arhar <jar...@chromium.org>
        Gerrit-Attention: Robert Flack <fla...@chromium.org>
        Gerrit-Comment-Date: Thu, 18 Sep 2025 20:43:44 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Joey Arhar (Gerrit)

        unread,
        Sep 18, 2025, 7:48:35 PM (21 hours ago) Sep 18
        to Mason Freed, Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Mustaq Ahmed and Robert Flack

        Joey Arhar voted and added 6 comments

        Votes added by Joey Arhar

        Commit-Queue+1

        6 comments

        Patchset-level comments
        File-level comment, Patchset 27:
        Mustaq Ahmed . resolved

        Here are a few comments from me. I tried to make them mostly independent from Rob's to avoid confusions.

        My biggest concern here is attempting an XL-sized CL that touches the input event "state machine" that is known to cause compat problems with even subtle changes! I suggested two possible splits below: making PEM etc GCed, and event target tracking with DOM changes. I will be happy to suggest other possibilities if you also see this as a logical way forward here.

        Joey Arhar

        Thanks, I split it into 3 patches

        File third_party/blink/renderer/core/events/pointer_event_factory.h
        Line 248, Patchset 27: HeapDeque<Member<PointerIdAndAttributes>> recently_removed_pointers_;
        Mustaq Ahmed . resolved

        It seems [`HeapVector`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/heap/collection_support/heap_vector.h;drc=5bd71e097f24bdc168e1add9159532f7951bd673;l=175) supports inline capacity, right? Since we are enforcing `kRemovedPointersCapacity` in .cc anyway, please consider adding back the capacity here.

        Joey Arhar

        Ok, I changed it to heapvector in the new code review

        Line 33, Patchset 27: : public GarbageCollected<PointerEventFactory> {
        Mustaq Ahmed . resolved

        Any chance we can split this XL-sized CL into smaller ones? Perhaps "making the PEM/PEF GarbageCollected" is an independent change that could land w/o waiting for any popover discussion here.

        Joey Arhar

        Sure, here's a separate one to make PEM/PEF GC'd: https://chromium-review.googlesource.com/c/chromium/src/+/6966502

        Let me know if you'd like anything else split into separate patches.

        File third_party/blink/renderer/core/input/gesture_manager.cc
        Line 370, Patchset 27: // pointer events weren't fired for this touch, so we need to fake the
        Mason Freed . resolved

        Can you elaborate on when/why that happens?

        Mustaq Ahmed

        I would suggest a comment like this: "The browser didn't send any pointer events for this touch (e.g. because there is no event handlers) ...".

        Joey Arhar

        Done

        File third_party/blink/renderer/core/input/mouse_event_manager.cc
        Robert Flack . unresolved

        What's an example of when this happens? Is this behavior broken?

        Joey Arhar

        I'm going to try removing it to find the case again

        Joey Arhar

        I wasn't able to reproduce this issue, so I replaced this with a CHECK that both are non-null

        Robert Flack

        I suppose an example of this would be if an earlier event listener removes the pointerdown or pointerup target. We maybe need similar behavior to how we track the still attached ancestor if a node is removed, see MouseEventManager handling here: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/input/mouse_event_manager.cc?q=file:mouse_event_manager%5C.cc%20MouseEventManager::HandleRemoveSubtree&ss=chromium%2Fchromium%2Fsrc

        Mustaq Ahmed

        I would suggest that in a separate CL before/after this one to track the removed down/up target. I fear making PEF aware of DOM changes is another big change that should perhaps go separately from this.

        Joey Arhar

        I suppose an example of this would be if an earlier event listener removes the pointerdown or pointerup target

        I added a test which removes the target during pointerdown, called light-dismiss-remove-target.html. What do you think?

        File third_party/blink/renderer/platform/runtime_enabled_features.json5
        Line 2911, Patchset 27: // bugs for touch inputs.
        Mustaq Ahmed . resolved

        Nit: maybe a crbug ref?

        Joey Arhar

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Mustaq Ahmed
        • Robert Flack
        Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
        Gerrit-Attention: Robert Flack <fla...@chromium.org>
        Gerrit-Comment-Date: Thu, 18 Sep 2025 23:48:23 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
        Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Joey Arhar (Gerrit)

        unread,
        Sep 18, 2025, 8:44:43 PM (20 hours ago) Sep 18
        to Mason Freed, Robert Flack, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
        Attention needed from Joey Arhar, Mason Freed, Mustaq Ahmed and Robert Flack

        Joey Arhar voted and added 3 comments

        Votes added by Joey Arhar

        Commit-Queue+1

        3 comments

        File third_party/blink/renderer/core/events/pointer_event_factory.h
        Line 131, Patchset 27: Node* target,
        double client_x,
        double client_y);
        Mason Freed . resolved

        Any reason not to take in a PointerTarget instead of the three parts?

        Joey Arhar

        Done

        File third_party/blink/renderer/core/events/pointer_event_factory.cc
        Line 25, Patchset 20:// recently_removed_pointers_ is kept below the inline capacity of the `Deque`
        Mason Freed . resolved

        Is there a Deque somewhere that still uses this? `recently_removed_pointers_` no longer uses it, anyway...

        Joey Arhar

        We are using this on recently_removed_pointers_ in order to keep the size below 10. So there is a deque which uses it, depending on how you define using it, right?

        Mason Freed

        I just meant that it says "the inline capacity of the Deque" and the Deque doesn't have any inline capacity any longer:

        ```
        HeapDeque<Member<PointerIdAndAttributes>> recently_removed_pointers_;
        ```
        Joey Arhar

        I moved this to a different patch, changed it from a HeapDeque to a HeapVector, and re-added the actual inline capacity

        File third_party/blink/renderer/core/html/html_dialog_element.cc
        Line 342, Patchset 27: const Node& pointer_down_target,
        double pointer_down_client_x,
        double pointer_down_client_y,
        Mason Freed . resolved

        Perhaps here too?

        Joey Arhar

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Joey Arhar
        • Mason Freed
        • Mustaq Ahmed
        • Robert Flack
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
          Gerrit-Change-Number: 6664038
          Gerrit-PatchSet: 30
          Gerrit-Owner: Joey Arhar <jar...@chromium.org>
          Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
          Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
          Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
          Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
          Gerrit-CC: David Bokan <bo...@chromium.org>
          Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
          Gerrit-Attention: Mason Freed <mas...@chromium.org>
          Gerrit-Attention: Joey Arhar <jar...@chromium.org>
          Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
          Gerrit-Attention: Robert Flack <fla...@chromium.org>
          Gerrit-Comment-Date: Fri, 19 Sep 2025 00:44:32 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Robert Flack (Gerrit)

          unread,
          4:04 PM (1 hour ago) 4:04 PM
          to Mason Freed, Mustaq Ahmed, (Julie)Jeongeun Kim, Kevin Babbitt, David Bokan, AyeAye, Chromium LUCI CQ, blink-re...@chromium.org, abigailbk...@google.com, dtseng...@chromium.org, francisjp...@google.com, josiah...@chromium.org, kyungjunle...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, dtapuska+...@chromium.org, kinuko...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org
          Attention needed from Joey Arhar, Mason Freed and Mustaq Ahmed

          Robert Flack added 1 comment

          File third_party/blink/renderer/core/html/html_dialog_element.cc
          Line 357, Patchset 20: FindNearestDialog(pointer_up_target, client_x, client_y);
          Robert Flack . unresolved

          It seems to me that since we use the final position this doesn't handle the drag out case that it is intended to handle. Testing on https://jsbin.com/ralifet/edit?html,css,js,output it seems that drags that start selecting text and end outside the dialog still close it which I thought was not the intended behavior.

          Joey Arhar

          You're right, and I don't think we're storing the x and y coordinates of the pointerdown anywhere. I wonder if that would be even harder to spell out in the spec.

          This makes me want to go back to using pseudo-elements so we can get rid of the x and y coordinates here.

          Do you have any recommendation on which to choose?

          Robert Flack

          I think keeping the pseudoelement targets internally is cleaner.

          Joey Arhar

          I tried going back to pseudo-elements briefly, but found that it was harder with the way this patch has gone now. I am now storing the x and y coordinates along with the pointerdown and pointerup target elements, and I added a test for this case.

          Robert Flack

          What is the complication with pseudo-elements? It seems like a cleaner solution to store pseudo-elements internally but use the originating element where that is web exposed.

          If you use the position you can still have cases where the target is not the same, e.g.
          1. The DOM or styles could change before you are doing your hit test
          2. Taps have their target adjusted towards elements which accept clicks but retain their original coordinates
          3. If the pointer was actually captured to the element itself it would also presumably ignore any pseudo-element targets.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Joey Arhar
          • Mason Freed
          • Mustaq Ahmed
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • 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: I739bf5ffe19062043e233c0bb0f7c96f7d8d31a4
          Gerrit-Change-Number: 6664038
          Gerrit-PatchSet: 32
          Gerrit-Owner: Joey Arhar <jar...@chromium.org>
          Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Mustaq Ahmed <mus...@chromium.org>
          Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
          Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
          Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
          Gerrit-CC: David Bokan <bo...@chromium.org>
          Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
          Gerrit-Attention: Mason Freed <mas...@chromium.org>
          Gerrit-Attention: Joey Arhar <jar...@chromium.org>
          Gerrit-Attention: Mustaq Ahmed <mus...@chromium.org>
          Gerrit-Comment-Date: Fri, 19 Sep 2025 20:04:42 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
          Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages