Measure click events from synthesized middle-clicks [chromium/src : main]

0 views
Skip to first unread message

Mason Freed (Gerrit)

unread,
Mar 6, 2026, 7:51:13 PMMar 6
to Emily Stark, Daniel Cheng, Arthur Sonzogni, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Emily Stark

Mason Freed voted and added 3 comments

Votes added by Mason Freed

Code-Review+1

3 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Mason Freed . unresolved

Looks good! Modulo a few questions

File third_party/blink/renderer/core/html/html_anchor_element.cc
Line 559, Patchset 5 (Latest): event.button() == 1) {
Mason Freed . unresolved

while a bit ugly, I think the proper thing would be

```
event.button() == static_cast<int16_t>(WebPointerProperties::Button::kMiddle);
```

File third_party/blink/web_tests/fast/events/pointerevents/synthesized-middle-click-use-counter.html
Line 6, Patchset 5 (Latest): <a id="link" href="#">Link</a>
Mason Freed . unresolved

Are you interested in other anchor links? E.g.

```
<map id="m">
<area href="" shape="default">
</map>
<img src="" usemap="#map1">
<svg xmlns="http://www.w3.org/2000/svg">
<a href=""><text>link</text></a>
</svg>
```

?

Open in Gerrit

Related details

Attention is currently required from:
  • Emily Stark
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7643f0a38e2d43eab57c49e5a024482ac3fd1393
Gerrit-Change-Number: 7643254
Gerrit-PatchSet: 5
Gerrit-Owner: Emily Stark <est...@chromium.org>
Gerrit-Reviewer: Emily Stark <est...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-Attention: Emily Stark <est...@chromium.org>
Gerrit-Comment-Date: Sat, 07 Mar 2026 00:51:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Emily Stark (Gerrit)

unread,
Mar 7, 2026, 1:19:13 AMMar 7
to Fredrik Söderquist, Dirk Schulze, Stephen Chenney, AyeAye, Mason Freed, Daniel Cheng, Arthur Sonzogni, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, fmalit...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Mason Freed

Emily Stark added 3 comments

Patchset-level comments
File-level comment, Patchset 5:
Mason Freed . resolved

Looks good! Modulo a few questions

Emily Stark

Thanks!

File third_party/blink/renderer/core/html/html_anchor_element.cc
Line 559, Patchset 5: event.button() == 1) {
Mason Freed . resolved

while a bit ugly, I think the proper thing would be

```
event.button() == static_cast<int16_t>(WebPointerProperties::Button::kMiddle);
```

Emily Stark

Done

File third_party/blink/web_tests/fast/events/pointerevents/synthesized-middle-click-use-counter.html
Line 6, Patchset 5: <a id="link" href="#">Link</a>
Mason Freed . resolved

Are you interested in other anchor links? E.g.

```
<map id="m">
<area href="" shape="default">
</map>
<img src="" usemap="#map1">
<svg xmlns="http://www.w3.org/2000/svg">
<a href=""><text>link</text></a>
</svg>
```

?

Emily Stark

Ohh, good catch. I guess I'm interested in any click that leads to one particular navigation path, which these do. I added separate UseCounters (so I can distinguish where the usage is, if any) and tests for these.

Open in Gerrit

Related details

Attention is currently required from:
  • Mason Freed
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7643f0a38e2d43eab57c49e5a024482ac3fd1393
Gerrit-Change-Number: 7643254
Gerrit-PatchSet: 10
Gerrit-Owner: Emily Stark <est...@chromium.org>
Gerrit-Reviewer: Emily Stark <est...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Comment-Date: Sat, 07 Mar 2026 06:19: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,
Mar 10, 2026, 10:17:19 AMMar 10
to Emily Stark, Fredrik Söderquist, Dirk Schulze, Stephen Chenney, AyeAye, Daniel Cheng, Arthur Sonzogni, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, fmalit...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org
Attention needed from Emily Stark

Mason Freed voted and added 2 comments

Votes added by Mason Freed

Code-Review+1

2 comments

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

Looks great!

File third_party/blink/web_tests/fast/events/pointerevents/synthesized-middle-click-use-counter.html
Line 6, Patchset 5: <a id="link" href="#">Link</a>
Mason Freed . resolved

Are you interested in other anchor links? E.g.

```
<map id="m">
<area href="" shape="default">
</map>
<img src="" usemap="#map1">
<svg xmlns="http://www.w3.org/2000/svg">
<a href=""><text>link</text></a>
</svg>
```

?

Emily Stark

Ohh, good catch. I guess I'm interested in any click that leads to one particular navigation path, which these do. I added separate UseCounters (so I can distinguish where the usage is, if any) and tests for these.

Mason Freed

😊

Open in Gerrit

Related details

Attention is currently required from:
  • Emily Stark
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7643f0a38e2d43eab57c49e5a024482ac3fd1393
Gerrit-Change-Number: 7643254
Gerrit-PatchSet: 10
Gerrit-Owner: Emily Stark <est...@chromium.org>
Gerrit-Reviewer: Emily Stark <est...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Arthur Sonzogni <arthurs...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Daniel Cheng <dch...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Emily Stark <est...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Mar 2026 14:17:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
Comment-In-Reply-To: Emily Stark <est...@chromium.org>
satisfied_requirement
open
diffy

Emily Stark (Gerrit)

unread,
Mar 10, 2026, 10:24:35 AMMar 10
to Mason Freed, Fredrik Söderquist, Dirk Schulze, Stephen Chenney, AyeAye, Daniel Cheng, Arthur Sonzogni, Chromium LUCI CQ, Chromium Metrics Reviews, chromium...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, fmalit...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org

Emily Stark voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention set is empty
Gerrit-Comment-Date: Tue, 10 Mar 2026 14:24:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
Mar 10, 2026, 11:16:40 AMMar 10
to Emily Stark, Mason Freed, Fredrik Söderquist, Dirk Schulze, Stephen Chenney, AyeAye, Daniel Cheng, Arthur Sonzogni, Chromium Metrics Reviews, chromium...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, fmalit...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org

Chromium LUCI CQ submitted the change

Change information

Commit message:
Measure click events from synthesized middle-clicks

Chrome will dispatch a synthesized "click" event with {"button": 1} to
an anchor element, but per spec it is unclear whether this should be
allowed. Measure how common this is so that we can hopefully deprecate.
Bug: 40061220,40262435
Change-Id: I7643f0a38e2d43eab57c49e5a024482ac3fd1393
Reviewed-by: Mason Freed <mas...@chromium.org>
Commit-Queue: Emily Stark <est...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1597071}
Files:
  • M third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom
  • M third_party/blink/renderer/core/html/html_anchor_element.cc
  • M third_party/blink/renderer/core/svg/svg_a_element.cc
  • A third_party/blink/web_tests/fast/events/pointerevents/synthesized-middle-click-area-use-counter.html
  • A third_party/blink/web_tests/fast/events/pointerevents/synthesized-middle-click-svg-anchor-use-counter.html
  • A third_party/blink/web_tests/fast/events/pointerevents/synthesized-middle-click-use-counter.html
  • M tools/metrics/histograms/metadata/blink/enums.xml
Change size: M
Delta: 7 files changed, 122 insertions(+), 0 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Mason Freed
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I7643f0a38e2d43eab57c49e5a024482ac3fd1393
Gerrit-Change-Number: 7643254
Gerrit-PatchSet: 11
Gerrit-Owner: Emily Stark <est...@chromium.org>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Emily Stark <est...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Arthur Sonzogni <arthurs...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages