Trigger mouse events for mouse hover over inactive page [chromium/src : main]

0 views
Skip to first unread message

Gaston Rodriguez (Gerrit)

unread,
Feb 4, 2026, 12:08:43 PM (3 days ago) Feb 4
to John An, David Bokan, AyeAye, Olga Gerchikov, Claire Chambers, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, kinuko...@chromium.org, blink-rev...@chromium.org, jmedle...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, gavinp...@chromium.org, loading...@chromium.org
Attention needed from Claire Chambers, John An and Olga Gerchikov

Gaston Rodriguez added 6 comments

Commit Message
Line 11, Patchset 5 (Latest):mouse hovering over an inactive page that experiences scroll. This
Gaston Rodriguez . unresolved

```suggestion
mouse hovering over an inactive page that experiences scrolling. This
```
I think.

Line 13, Patchset 5 (Latest):the page is inactive. This affects anchor element interaction tracking
so this change also ensures pointer hover is only tracked for active
pages.
Gaston Rodriguez . unresolved

Could you clarify how the anchor element is affected, and why the changes to it were needed?

File third_party/blink/renderer/core/input/event_handler_test.cc
Line 3591, Patchset 5 (Latest):TEST_F(EventHandlerSimTest, GestureTapHoverState) {
ResizeView(gfx::Size(800, 600));

if (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()) {
// RecomputeMouseHoverState() bails early if we are not focused.
GetPage().SetFocused(true);
}
Gaston Rodriguez . unresolved

Would it be worth it to parametrize this test (and the others with a similar check) so that they enable or disable the feature, and test that the hovers are sent properly when the focus is false?
Something like:

```suggestion
TEST_P(EventHandlerSimTestBoolParam, GestureTapHoverState) {
ScopedSyntheticMouseHoverOverInactivePageForTest feature_flag_name(GetParam());
ResizeView(gfx::Size(800, 600));
  // Having the synthetic hover feature flag enabled makes it so that we don't need the page to be focused to receive synthetic hover events. If the feature is disabled, we need the flag to avoid an early exit.
GetPage().SetFocused(!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()); // or SetFocused(!GetParam())
```

This way we have more test coverage.

File third_party/blink/renderer/core/loader/anchor_element_interaction_tracker.cc
Line 18, Patchset 5 (Latest):#include "third_party/blink/public/platform/web_runtime_features.h"
Gaston Rodriguez . unresolved

Could this be why you were having trouble with the runtime feature flag? This is the `#includes` you should be using:
`#include "third_party/blink/renderer/platform/runtime_enabled_features.h"`
Same for all other instances of this `#includes`.

Line 388, Patchset 5 (Latest): Page* page = GetDocument()->GetFrame()->GetPage();
if (event_type == event_type_names::kPointerover &&
(!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled() ||
(page && page->GetFocusController().IsActive()))) {
Gaston Rodriguez . unresolved
```suggestion

if (event_type == event_type_names::kPointerover) {
if (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled() ||
(Page* page = GetDocument()->GetFrame()->GetPage(); page && page->GetFocusController().IsActive())) {
```

Just a suggestion, feel free to ignore if you think it's uglier.

Line 391, Patchset 5 (Latest): (page && page->GetFocusController().IsActive()))) {
Gaston Rodriguez . unresolved

Here you're adding a new scenario where you're skipping this if. Previously, if the `== khover` passed then this was true, but now even if `kHover == true` but the feature is enabled and the page is not active then the message will not be sent. I'm not very clear why this was needed, could you add a comment? I'll also ask for clarification on the cl's description.

Open in Gerrit

Related details

Attention is currently required from:
  • Claire Chambers
  • John An
  • Olga Gerchikov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9f14f43b74ea16e21ec13644edfe7d4f20f23b1a
Gerrit-Change-Number: 7534848
Gerrit-PatchSet: 5
Gerrit-Owner: John An <jo...@microsoft.com>
Gerrit-Reviewer: Claire Chambers <clcha...@microsoft.com>
Gerrit-Reviewer: Gaston Rodriguez <gas...@microsoft.com>
Gerrit-Reviewer: John An <jo...@microsoft.com>
Gerrit-Reviewer: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-Attention: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: John An <jo...@microsoft.com>
Gerrit-Attention: Claire Chambers <clcha...@microsoft.com>
Gerrit-Comment-Date: Wed, 04 Feb 2026 17:08:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Claire Chambers (Gerrit)

unread,
Feb 5, 2026, 2:37:14 PM (2 days ago) Feb 5
to John An, David Bokan, AyeAye, Olga Gerchikov, Gaston Rodriguez, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, kinuko...@chromium.org, blink-rev...@chromium.org, jmedle...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, gavinp...@chromium.org, loading...@chromium.org
Attention needed from John An and Olga Gerchikov

Claire Chambers added 2 comments

File third_party/blink/renderer/core/input/event_handler_test.cc
Line 3591, Patchset 5 (Latest):TEST_F(EventHandlerSimTest, GestureTapHoverState) {
ResizeView(gfx::Size(800, 600));

if (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()) {
// RecomputeMouseHoverState() bails early if we are not focused.
GetPage().SetFocused(true);
}
Gaston Rodriguez . unresolved

Would it be worth it to parametrize this test (and the others with a similar check) so that they enable or disable the feature, and test that the hovers are sent properly when the focus is false?
Something like:

```suggestion
TEST_P(EventHandlerSimTestBoolParam, GestureTapHoverState) {
ScopedSyntheticMouseHoverOverInactivePageForTest feature_flag_name(GetParam());
ResizeView(gfx::Size(800, 600));
  // Having the synthetic hover feature flag enabled makes it so that we don't need the page to be focused to receive synthetic hover events. If the feature is disabled, we need the flag to avoid an early exit.
GetPage().SetFocused(!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()); // or SetFocused(!GetParam())
```

This way we have more test coverage.

Claire Chambers

+1 on this. If you have a test with feature-dependent expectations it should be tested with feature on and off, so that changing the feature state doesn't suddenly cause breaks.

File third_party/blink/renderer/core/input/mouse_event_manager_test.cc
Line 54, Patchset 5 (Latest): // RecomputeMouseHoverState() bails early if we are not focused.
Claire Chambers . unresolved

Can this happen in the full browser? If so, does your change alter the behavior of focus events?

Open in Gerrit

Related details

Attention is currently required from:
  • John An
  • Olga Gerchikov
Gerrit-Comment-Date: Thu, 05 Feb 2026 19:37:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Gaston Rodriguez <gas...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Claire Chambers (Gerrit)

unread,
Feb 5, 2026, 2:47:34 PM (2 days ago) Feb 5
to John An, David Bokan, AyeAye, Olga Gerchikov, Gaston Rodriguez, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, kinuko...@chromium.org, blink-rev...@chromium.org, jmedle...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, gavinp...@chromium.org, loading...@chromium.org
Attention needed from John An and Olga Gerchikov

Claire Chambers added 1 comment

File third_party/blink/renderer/core/input/mouse_event_manager_test.cc
Line 54, Patchset 5 (Latest): // RecomputeMouseHoverState() bails early if we are not focused.
Claire Chambers . resolved

Can this happen in the full browser? If so, does your change alter the behavior of focus events?

Claire Chambers

Closing per offline discussion.

Gerrit-Comment-Date: Thu, 05 Feb 2026 19:47:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Claire Chambers <clcha...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Claire Chambers (Gerrit)

unread,
Feb 5, 2026, 2:54:14 PM (2 days ago) Feb 5
to John An, David Bokan, AyeAye, Olga Gerchikov, Gaston Rodriguez, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, kinuko...@chromium.org, blink-rev...@chromium.org, jmedle...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, gavinp...@chromium.org, loading...@chromium.org
Attention needed from John An and Olga Gerchikov

Claire Chambers added 1 comment

File third_party/blink/renderer/core/loader/anchor_element_interaction_tracker.cc
Line 391, Patchset 5 (Latest): (page && page->GetFocusController().IsActive()))) {
Gaston Rodriguez . unresolved

Here you're adding a new scenario where you're skipping this if. Previously, if the `== khover` passed then this was true, but now even if `kHover == true` but the feature is enabled and the page is not active then the message will not be sent. I'm not very clear why this was needed, could you add a comment? I'll also ask for clarification on the cl's description.

Claire Chambers

Now that I understand this better - I think this should be a CRBug. It's fairly low-pri, basically as I understand it, the scenario here is preload heuristics don't/won't work if the user is mousing over and scrolling over an out-of-focus web page. This is not a functional issue, and it's not a regression (didn't work before this CL, still won't work after), so it shouldn't block this CL, but it's worth tracking so that the OWNERS of this feature may fix at some point.

Gerrit-Comment-Date: Thu, 05 Feb 2026 19:54:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Gaston Rodriguez <gas...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Claire Chambers (Gerrit)

unread,
Feb 5, 2026, 2:58:01 PM (2 days ago) Feb 5
to John An, David Bokan, AyeAye, Olga Gerchikov, Gaston Rodriguez, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, kinuko...@chromium.org, blink-rev...@chromium.org, jmedle...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, gavinp...@chromium.org, loading...@chromium.org
Attention needed from John An and Olga Gerchikov

Claire Chambers added 1 comment

File third_party/blink/renderer/core/input/mouse_event_manager_test.cc
Line 53, Patchset 5 (Latest): if (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()) {

// RecomputeMouseHoverState() bails early if we are not focused.
Claire Chambers . unresolved

This is a bit awkward and hard to understand if you don't have this crrev up. I would change this comment to outline that the need for focus was experimentally fixed, link to the CRBug, and explain that this check only exists as a fallback in case this fix needs to be turned off.

Gerrit-Comment-Date: Thu, 05 Feb 2026 19:57:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

John An (Gerrit)

unread,
12:55 AM (22 hours ago) 12:55 AM
to David Bokan, AyeAye, Olga Gerchikov, Gaston Rodriguez, Claire Chambers, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, kinuko...@chromium.org, blink-rev...@chromium.org, jmedle...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, gavinp...@chromium.org, loading...@chromium.org
Attention needed from Claire Chambers, Gaston Rodriguez and Olga Gerchikov

John An added 7 comments

Commit Message
Line 11, Patchset 5:mouse hovering over an inactive page that experiences scroll. This
Gaston Rodriguez . resolved

```suggestion
mouse hovering over an inactive page that experiences scrolling. This
```
I think.

John An

Done

Line 13, Patchset 5:the page is inactive. This affects anchor element interaction tracking

so this change also ensures pointer hover is only tracked for active
pages.
Gaston Rodriguez . resolved

Could you clarify how the anchor element is affected, and why the changes to it were needed?

John An

Done

File third_party/blink/renderer/core/input/event_handler_test.cc
Line 3591, Patchset 5:TEST_F(EventHandlerSimTest, GestureTapHoverState) {
ResizeView(gfx::Size(800, 600));

if (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()) {
// RecomputeMouseHoverState() bails early if we are not focused.
GetPage().SetFocused(true);
}
Gaston Rodriguez . resolved

Would it be worth it to parametrize this test (and the others with a similar check) so that they enable or disable the feature, and test that the hovers are sent properly when the focus is false?
Something like:

```suggestion
TEST_P(EventHandlerSimTestBoolParam, GestureTapHoverState) {
ScopedSyntheticMouseHoverOverInactivePageForTest feature_flag_name(GetParam());
ResizeView(gfx::Size(800, 600));
  // Having the synthetic hover feature flag enabled makes it so that we don't need the page to be focused to receive synthetic hover events. If the feature is disabled, we need the flag to avoid an early exit.
GetPage().SetFocused(!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()); // or SetFocused(!GetParam())
```

This way we have more test coverage.

Claire Chambers

+1 on this. If you have a test with feature-dependent expectations it should be tested with feature on and off, so that changing the feature state doesn't suddenly cause breaks.

John An

To me this is all calling out the fact that there is no explicit test for the new behavior. Mouse hover should fire for both active and inactive pages. I will add that and let that be the unit test signal instead of parameterizing every test that uses this feature flag.

File third_party/blink/renderer/core/input/mouse_event_manager_test.cc
Line 53, Patchset 5: if (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()) {

// RecomputeMouseHoverState() bails early if we are not focused.
Claire Chambers . resolved

This is a bit awkward and hard to understand if you don't have this crrev up. I would change this comment to outline that the need for focus was experimentally fixed, link to the CRBug, and explain that this check only exists as a fallback in case this fix needs to be turned off.

John An

Done

File third_party/blink/renderer/core/loader/anchor_element_interaction_tracker.cc
Line 18, Patchset 5:#include "third_party/blink/public/platform/web_runtime_features.h"
Gaston Rodriguez . resolved

Could this be why you were having trouble with the runtime feature flag? This is the `#includes` you should be using:
`#include "third_party/blink/renderer/platform/runtime_enabled_features.h"`
Same for all other instances of this `#includes`.

John An

Ahh that's gotta be it. Thanks

Line 388, Patchset 5: Page* page = GetDocument()->GetFrame()->GetPage();

if (event_type == event_type_names::kPointerover &&
(!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled() ||
(page && page->GetFocusController().IsActive()))) {
Gaston Rodriguez . resolved
```suggestion

if (event_type == event_type_names::kPointerover) {
if (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled() ||
(Page* page = GetDocument()->GetFrame()->GetPage(); page && page->GetFocusController().IsActive())) {
```

Just a suggestion, feel free to ignore if you think it's uglier.

John An

I thought about that approach but 1. I like having the conditions joined w && and 2. I think initializing page in the conditional is too ugly

Line 391, Patchset 5: (page && page->GetFocusController().IsActive()))) {
Gaston Rodriguez . resolved

Here you're adding a new scenario where you're skipping this if. Previously, if the `== khover` passed then this was true, but now even if `kHover == true` but the feature is enabled and the page is not active then the message will not be sent. I'm not very clear why this was needed, could you add a comment? I'll also ask for clarification on the cl's description.

Claire Chambers

Now that I understand this better - I think this should be a CRBug. It's fairly low-pri, basically as I understand it, the scenario here is preload heuristics don't/won't work if the user is mousing over and scrolling over an out-of-focus web page. This is not a functional issue, and it's not a regression (didn't work before this CL, still won't work after), so it shouldn't block this CL, but it's worth tracking so that the OWNERS of this feature may fix at some point.

John An

Described this in the CL description and in a new comment. Claire, I'm not convinced this is a bug. It may be the case that we only want to track interactions for anchor elements on an active page. I'd be curious to know what the owners think.

Open in Gerrit

Related details

Attention is currently required from:
  • Claire Chambers
  • Gaston Rodriguez
  • Olga Gerchikov
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: I9f14f43b74ea16e21ec13644edfe7d4f20f23b1a
    Gerrit-Change-Number: 7534848
    Gerrit-PatchSet: 8
    Gerrit-Owner: John An <jo...@microsoft.com>
    Gerrit-Reviewer: Claire Chambers <clcha...@microsoft.com>
    Gerrit-Reviewer: Gaston Rodriguez <gas...@microsoft.com>
    Gerrit-Reviewer: John An <jo...@microsoft.com>
    Gerrit-Reviewer: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-Attention: Gaston Rodriguez <gas...@microsoft.com>
    Gerrit-Attention: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Claire Chambers <clcha...@microsoft.com>
    Gerrit-Comment-Date: Sat, 07 Feb 2026 05:54:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Gaston Rodriguez <gas...@microsoft.com>
    Comment-In-Reply-To: Claire Chambers <clcha...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Claire Chambers (Gerrit)

    unread,
    3:40 PM (7 hours ago) 3:40 PM
    to John An, David Bokan, AyeAye, Olga Gerchikov, Gaston Rodriguez, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, kinuko...@chromium.org, blink-rev...@chromium.org, jmedle...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, gavinp...@chromium.org, loading...@chromium.org
    Attention needed from Gaston Rodriguez, John An and Olga Gerchikov

    Claire Chambers added 6 comments

    File third_party/blink/renderer/core/input/event_handler_test.cc
    Line 3591, Patchset 5:TEST_F(EventHandlerSimTest, GestureTapHoverState) {
    ResizeView(gfx::Size(800, 600));

    if (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()) {
    // RecomputeMouseHoverState() bails early if we are not focused.
    GetPage().SetFocused(true);
    }
    Gaston Rodriguez . resolved

    Would it be worth it to parametrize this test (and the others with a similar check) so that they enable or disable the feature, and test that the hovers are sent properly when the focus is false?
    Something like:

    ```suggestion
    TEST_P(EventHandlerSimTestBoolParam, GestureTapHoverState) {
    ScopedSyntheticMouseHoverOverInactivePageForTest feature_flag_name(GetParam());
    ResizeView(gfx::Size(800, 600));
      // Having the synthetic hover feature flag enabled makes it so that we don't need the page to be focused to receive synthetic hover events. If the feature is disabled, we need the flag to avoid an early exit.
    GetPage().SetFocused(!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled()); // or SetFocused(!GetParam())
    ```

    This way we have more test coverage.

    Claire Chambers

    +1 on this. If you have a test with feature-dependent expectations it should be tested with feature on and off, so that changing the feature state doesn't suddenly cause breaks.

    John An

    To me this is all calling out the fact that there is no explicit test for the new behavior. Mouse hover should fire for both active and inactive pages. I will add that and let that be the unit test signal instead of parameterizing every test that uses this feature flag.

    Claire Chambers

    Based on offline discussion and thinking it over, I reverse my +1. I think @jo...@microsoft.com is right and that a parameterized suite adds tech debt but doesn't guard against regression.

    File third_party/blink/renderer/core/input/mouse_event_manager.cc
    Line 395, Patchset 8 (Latest): if (!frame_->GetPage() ||
    (!RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled() &&
    !frame_->GetPage()->GetFocusController().IsActive())) {
    return;
    }
    Claire Chambers . unresolved

    nit: triple negative is hard to understand. Here's a more readable version using De Morgan's law. Feel free to disregard.

    ```suggestion
    const bool page_available_for_hover = frame_->GetPage() &&
    (RuntimeEnabledFeatures::SyntheticMouseHoverOverInactivePageEnabled() ||
    frame_->GetPage()->GetFocusController().IsActive())
      if (!page_available_for_hover) {
    return;
    }
    ```
    File third_party/blink/renderer/core/input/mouse_event_manager_test.cc
    Line 111, Patchset 8 (Latest):
    INSTANTIATE_TEST_SUITE_P(All, MouseEventManagerHoverTest, ::testing::Bool());
    Claire Chambers . unresolved

    The more I think about this, the more I think maybe I/we were wrong to harang you about this. I think I saw all those feature-conditional behaviors and went 'whoa!' and jumped to documenting / cleaning it up. I apologize for creating unnecessary work and hope you'll forgive my excessive conscientiousness.

    You could probably remove this. If this change turns out to have major ramifications, we disable with experiment platforms (ecs in edge, finch for cr). For backdrop-filter work for example, we never wrote tests for a killswitch-off.

    Worst case CL is setting this to `status: experimental` in code. Tests will still pass. This 'feature' will have to exist in some form because it's the CSS spec, and if it's creates a problem, it just means the problem needs to be fixed, rather than the 'feature' being abandoned wholesale. In this case *all* your feature-specific conditionals in test code could be removed, leaving only your production code intact.

    If other reviewers disagree, or you do, just be sure to add a comment so this can be cleaned up later, as you did for the other files :)


    ```suggestion
    // See crbug.com/385474535. We maintain coverage for both behaviors in
    // case this experimental fix needs to be disabled. This will be un-
    // -parameterized in a future CL.
    INSTANTIATE_TEST_SUITE_P(All, MouseEventManagerHoverTest, ::testing::Bool());
    ```

    Line 145, Patchset 8 (Latest): EXPECT_EQ("rgb(255, 0, 0)", hover_color.SerializeAsCSSColor());
    Claire Chambers . unresolved
    ```suggestion
    // With the page focused, :hover pseudo-class should match when the
    // pointer is over the element.
    EXPECT_EQ("rgb(255, 0, 0)", hover_color.SerializeAsCSSColor());
    ```
    Line 169, Patchset 8 (Latest): EXPECT_EQ(GetParam() ? "rgb(255, 0, 0)" : "rgb(128, 128, 128)",
    hover_color.SerializeAsCSSColor());
    Claire Chambers . unresolved
    ```suggestion
    // Same behavior is expected even when the page is not focused, Per
    // W3C UI Events, § 3.4.5.6 “mouseenter”
    EXPECT_EQ(GetParam() ? "rgb(255, 0, 0)" : "rgb(128, 128, 128)",
    hover_color.SerializeAsCSSColor());
    ```
    File third_party/blink/renderer/core/loader/anchor_element_interaction_tracker.cc
    Line 391, Patchset 5: (page && page->GetFocusController().IsActive()))) {
    Gaston Rodriguez . unresolved

    Here you're adding a new scenario where you're skipping this if. Previously, if the `== khover` passed then this was true, but now even if `kHover == true` but the feature is enabled and the page is not active then the message will not be sent. I'm not very clear why this was needed, could you add a comment? I'll also ask for clarification on the cl's description.

    Claire Chambers

    Now that I understand this better - I think this should be a CRBug. It's fairly low-pri, basically as I understand it, the scenario here is preload heuristics don't/won't work if the user is mousing over and scrolling over an out-of-focus web page. This is not a functional issue, and it's not a regression (didn't work before this CL, still won't work after), so it shouldn't block this CL, but it's worth tracking so that the OWNERS of this feature may fix at some point.

    John An

    Described this in the CL description and in a new comment. Claire, I'm not convinced this is a bug. It may be the case that we only want to track interactions for anchor elements on an active page. I'd be curious to know what the owners think.

    Claire Chambers

    If you do not file CRBug, please add to review someone who actively works on the feature/area, not just an OWNERS (chromium OWNERS is intentionally broad). Neither of us know the answer, which is why it's important the question itself isn't lost.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Gaston Rodriguez
    • John An
    • Olga Gerchikov
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I9f14f43b74ea16e21ec13644edfe7d4f20f23b1a
      Gerrit-Change-Number: 7534848
      Gerrit-PatchSet: 8
      Gerrit-Owner: John An <jo...@microsoft.com>
      Gerrit-Reviewer: Claire Chambers <clcha...@microsoft.com>
      Gerrit-Reviewer: Gaston Rodriguez <gas...@microsoft.com>
      Gerrit-Reviewer: John An <jo...@microsoft.com>
      Gerrit-Reviewer: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-CC: David Bokan <bo...@chromium.org>
      Gerrit-CC: Nate Chapin <jap...@chromium.org>
      Gerrit-Attention: Gaston Rodriguez <gas...@microsoft.com>
      Gerrit-Attention: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-Attention: John An <jo...@microsoft.com>
      Gerrit-Comment-Date: Sat, 07 Feb 2026 20:40:29 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Gaston Rodriguez <gas...@microsoft.com>
      Comment-In-Reply-To: John An <jo...@microsoft.com>
      Comment-In-Reply-To: Claire Chambers <clcha...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Claire Chambers (Gerrit)

      unread,
      8:39 PM (2 hours ago) 8:39 PM
      to John An, David Bokan, AyeAye, Olga Gerchikov, Gaston Rodriguez, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, kinuko...@chromium.org, blink-rev...@chromium.org, jmedle...@chromium.org, blink-...@chromium.org, dtapuska+...@chromium.org, gavinp...@chromium.org, loading...@chromium.org
      Attention needed from Gaston Rodriguez, John An and Olga Gerchikov

      Claire Chambers added 1 comment

      File third_party/blink/renderer/core/loader/anchor_element_interaction_tracker.cc
      Line 391, Patchset 5: (page && page->GetFocusController().IsActive()))) {
      Gaston Rodriguez . unresolved

      Here you're adding a new scenario where you're skipping this if. Previously, if the `== khover` passed then this was true, but now even if `kHover == true` but the feature is enabled and the page is not active then the message will not be sent. I'm not very clear why this was needed, could you add a comment? I'll also ask for clarification on the cl's description.

      Claire Chambers

      Now that I understand this better - I think this should be a CRBug. It's fairly low-pri, basically as I understand it, the scenario here is preload heuristics don't/won't work if the user is mousing over and scrolling over an out-of-focus web page. This is not a functional issue, and it's not a regression (didn't work before this CL, still won't work after), so it shouldn't block this CL, but it's worth tracking so that the OWNERS of this feature may fix at some point.

      John An

      Described this in the CL description and in a new comment. Claire, I'm not convinced this is a bug. It may be the case that we only want to track interactions for anchor elements on an active page. I'd be curious to know what the owners think.

      Claire Chambers

      If you do not file CRBug, please add to review someone who actively works on the feature/area, not just an OWNERS (chromium OWNERS is intentionally broad). Neither of us know the answer, which is why it's important the question itself isn't lost.

      Claire Chambers

      Thinking about it more, I'm not sure how it couldn't be a bug.

      I can test the anchor element interaction tracker right now and I get hits when the page isn't focused, using regular mouse hover (ie, non scrolls). Your change would regress this. The spec (https://html.spec.whatwg.org/multipage/speculative-loading.html#speculative-loading) is silent on the issue of focus, there's nothing indicating it shouldn't behave this way. Intuitively, it's not clear to me why tabbing out of my browser and hovering over things should have different prefetch, but that's just an opinion.

      The reason why 4 unit tests break in this file isn't because all nonfocused pointerover events are unexpected, but rather because the GSE at the end of `DispatchPointerDownAndVerticalScroll` causes a single extra pointerover from your code that the tests do not expect. This to me seems more like a test expectation issue. Filtering ALL non-focused pointerover events is taking a sledgehammer to the problem.

      wpt_internal/speculation-rules/prefetch/no-vary-search/prefetch-single-non-immediate-with-hint.https.html also fails with your change to the anchor interaction tracker.

      My opinion:

       - Fix the expectations (complicated), or..
      - Add a scoped feature flag to disable your feature in the offending tests, then file an associated CRBug, or..
      - Ask the people currently working on this feature to weigh in. I would recommend looking at this document: https://docs.google.com/document/d/1YPbtUPfZIDElzBZNx8IQMzRFvy8oauLG_i1XIr6jgTs/edit?tab=t.0#heading=h.ndgyftleqzya for collaborators, as they are all involved in the active improvement of this area and could likely answer any questions.
      Gerrit-Comment-Date: Sun, 08 Feb 2026 01:38:52 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Gaston Rodriguez <gas...@microsoft.com>
      Comment-In-Reply-To: Claire Chambers <clcha...@microsoft.com>
      Comment-In-Reply-To: John An <jo...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages