Fix stale :focus-within after synchronous focus shifts [chromium/src : main]

1 view
Skip to first unread message

Suyeon Ji (Gerrit)

unread,
Jan 18, 2026, 5:07:29 AMJan 18
to Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Mason Freed and Rune Lillesveen

Suyeon Ji added 1 comment

Patchset-level comments
File-level comment, Patchset 5 (Latest):
Suyeon Ji . resolved

Hi, please take a look. Thank you.

Open in Gerrit

Related details

Attention is currently required from:
  • Mason Freed
  • Rune Lillesveen
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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
Gerrit-Change-Number: 7486091
Gerrit-PatchSet: 5
Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
Gerrit-Comment-Date: Sun, 18 Jan 2026 10:06:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
Jan 19, 2026, 3:03:17 AMJan 19
to Suyeon Ji, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Mason Freed and Suyeon Ji

Rune Lillesveen added 1 comment

Patchset-level comments
Rune Lillesveen . unresolved

I'm not too familiar with how this is supposed to work, in which order, but I do remember having looked into a similar issue which may, or may not, be relevant to think about here:

https://issues.chromium.org/u/1/issues/439339105#comment8

I'll leave it to Mason to review. I can give a second +1 when necessary.

Open in Gerrit

Related details

Attention is currently required from:
  • Mason Freed
  • Suyeon Ji
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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
    Gerrit-Change-Number: 7486091
    Gerrit-PatchSet: 5
    Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
    Gerrit-Attention: Suyeon Ji <zees...@gmail.com>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Mon, 19 Jan 2026 08:02:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Suyeon Ji (Gerrit)

    unread,
    Jan 19, 2026, 7:08:43 PMJan 19
    to Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Mason Freed

    Suyeon Ji voted Commit-Queue+0

    Commit-Queue+0
    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 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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
    Gerrit-Change-Number: 7486091
    Gerrit-PatchSet: 5
    Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Tue, 20 Jan 2026 00:08:09 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Suyeon Ji (Gerrit)

    unread,
    Jan 19, 2026, 8:08:11 PMJan 19
    to Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Mason Freed and Rune Lillesveen

    Suyeon Ji added 1 comment

    Patchset-level comments
    Rune Lillesveen . resolved

    I'm not too familiar with how this is supposed to work, in which order, but I do remember having looked into a similar issue which may, or may not, be relevant to think about here:

    https://issues.chromium.org/u/1/issues/439339105#comment8

    I'll leave it to Mason to review. I can give a second +1 when necessary.

    Suyeon Ji

    Thanks! I'll take a look at that issue.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mason Freed
    • Rune Lillesveen
    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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
      Gerrit-Change-Number: 7486091
      Gerrit-PatchSet: 5
      Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
      Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
      Gerrit-Comment-Date: Tue, 20 Jan 2026 01:07:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      Jan 20, 2026, 4:21:45 PMJan 20
      to Suyeon Ji, Rune Lillesveen, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
      Attention needed from Suyeon Ji

      Mason Freed added 5 comments

      Patchset-level comments
      Mason Freed . resolved

      Thanks for the fix! The code looks correct, but I'm a little worried about performance regressions for changing focus. Are you familiar with the pinpoint system for checking for regressions like this? If not, I can help kick off a test.

      File third_party/blink/renderer/core/dom/document.cc
      Line 5894, Patchset 5 (Latest): if (ancestor && !ancestor->contains(focused_element_)) {
      Mason Freed . unresolved

      This is a parent tree walk (O(tree depth)). This one will get hit every time the focus changes and there's a common ancestor, which is quite common.

      Line 5895, Patchset 5 (Latest): ancestor->SetHasFocusWithinUpToAncestor(
      Mason Freed . unresolved

      This is also a parent tree walk (O(distance to common ancestor)).

      Line 5897, Patchset 5 (Latest): DynamicTo<Element>(FlatTreeTraversal::CommonAncestor(
      Mason Freed . unresolved

      This is also several parent tree walks (O(distance to common ancestor)).

      Line 5920, Patchset 5 (Latest): if (ancestor && !ancestor->contains(focused_element_)) {
      ancestor->SetHasFocusWithinUpToAncestor(
      false,
      DynamicTo<Element>(FlatTreeTraversal::CommonAncestor(
      *ancestor, *focused_element_)),
      /*need_snap_container_search=*/false);
      }
      Mason Freed . unresolved

      ditto here

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Suyeon Ji
      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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
        Gerrit-Change-Number: 7486091
        Gerrit-PatchSet: 5
        Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
        Gerrit-Attention: Suyeon Ji <zees...@gmail.com>
        Gerrit-Comment-Date: Tue, 20 Jan 2026 21:21:35 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Suyeon Ji (Gerrit)

        unread,
        Jan 22, 2026, 9:38:57 AMJan 22
        to Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Mason Freed

        Suyeon Ji added 1 comment

        Patchset-level comments
        Mason Freed . resolved

        Thanks for the fix! The code looks correct, but I'm a little worried about performance regressions for changing focus. Are you familiar with the pinpoint system for checking for regressions like this? If not, I can help kick off a test.

        Suyeon Ji

        Hi, thanks for the feedback!
        I tried to use Pinpoint as you suggested, but unfortunately, I was denied access. Could you help me with running the regression test?
        For the benchmarks, I believe blink_perf.css and blink_perf.events are appropriate. Do I need to run anything else besides 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 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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
        Gerrit-Change-Number: 7486091
        Gerrit-PatchSet: 6
        Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
        Gerrit-Attention: Mason Freed <mas...@chromium.org>
        Gerrit-Comment-Date: Thu, 22 Jan 2026 14:38:47 +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,
        Jan 27, 2026, 12:44:31 PM (12 days ago) Jan 27
        to Suyeon Ji, Rune Lillesveen, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Mason Freed added 1 comment

        Patchset-level comments
        Mason Freed . resolved

        Thanks for the fix! The code looks correct, but I'm a little worried about performance regressions for changing focus. Are you familiar with the pinpoint system for checking for regressions like this? If not, I can help kick off a test.

        Suyeon Ji

        Hi, thanks for the feedback!
        I tried to use Pinpoint as you suggested, but unfortunately, I was denied access. Could you help me with running the regression test?
        For the benchmarks, I believe blink_perf.css and blink_perf.events are appropriate. Do I need to run anything else besides these?

        Attention is currently required from:
        • Suyeon Ji
        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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
        Gerrit-Change-Number: 7486091
        Gerrit-PatchSet: 6
        Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
        Gerrit-Attention: Suyeon Ji <zees...@gmail.com>
        Gerrit-Comment-Date: Tue, 27 Jan 2026 17:44:21 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Suyeon Ji <zees...@gmail.com>
        Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        chromeperf@appspot.gserviceaccount.com (Gerrit)

        unread,
        Jan 27, 2026, 1:41:06 PM (12 days ago) Jan 27
        to Suyeon Ji, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Message from chrom...@appspot.gserviceaccount.com

        📍 Job mac-m4-mini-perf/speedometer3 complete.

        See results at: https://pinpoint-dot-chromeperf.appspot.com/job/16bf8e53710000

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Suyeon Ji
        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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
        Gerrit-Change-Number: 7486091
        Gerrit-PatchSet: 6
        Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
        Gerrit-Attention: Suyeon Ji <zees...@gmail.com>
        Gerrit-Comment-Date: Tue, 27 Jan 2026 18:40:56 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        chromeperf@appspot.gserviceaccount.com (Gerrit)

        unread,
        Jan 27, 2026, 3:11:08 PM (12 days ago) Jan 27
        to Suyeon Ji, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Message from chrom...@appspot.gserviceaccount.com

        😿 Job linux-perf/blink_perf.events failed.

        See results at: https://pinpoint-dot-chromeperf.appspot.com/job/17809826710000

        Gerrit-Comment-Date: Tue, 27 Jan 2026 20:10:53 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        chromeperf@appspot.gserviceaccount.com (Gerrit)

        unread,
        Jan 29, 2026, 7:06:13 PM (10 days ago) Jan 29
        to Suyeon Ji, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Message from chrom...@appspot.gserviceaccount.com

        😿 Job linux-perf/blink_perf.css failed.

        See results at: https://pinpoint-dot-chromeperf.appspot.com/job/12630e4e710000

        Gerrit-Comment-Date: Fri, 30 Jan 2026 00:06:01 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Suyeon Ji (Gerrit)

        unread,
        Jan 30, 2026, 5:36:03 AM (9 days ago) Jan 30
        to chrom...@appspot.gserviceaccount.com, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Mason Freed

        Suyeon Ji added 1 comment

        Patchset-level comments
        Mason Freed . resolved

        Thanks for the fix! The code looks correct, but I'm a little worried about performance regressions for changing focus. Are you familiar with the pinpoint system for checking for regressions like this? If not, I can help kick off a test.

        Suyeon Ji

        Hi, thanks for the feedback!
        I tried to use Pinpoint as you suggested, but unfortunately, I was denied access. Could you help me with running the regression test?
        For the benchmarks, I believe blink_perf.css and blink_perf.events are appropriate. Do I need to run anything else besides these?

        Mason Freed

        Sorry for the delay here! I just kicked off these pinpoints:

        Suyeon Ji

        Hi, thanks for the review. I'm sorry, but the perf test failed.
        It seems that both my test and the baseline failed. Since I can't see the logs, could you please take a look?
        Also, I share your concern about the tree walks, so I'll give it some more thought.

        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 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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
        Gerrit-Change-Number: 7486091
        Gerrit-PatchSet: 6
        Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
        Gerrit-Attention: Mason Freed <mas...@chromium.org>
        Gerrit-Comment-Date: Fri, 30 Jan 2026 10:35:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
        Comment-In-Reply-To: Suyeon Ji <zees...@gmail.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mason Freed (Gerrit)

        unread,
        Jan 30, 2026, 1:35:01 PM (9 days ago) Jan 30
        to Suyeon Ji, chrom...@appspot.gserviceaccount.com, Rune Lillesveen, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Mason Freed added 1 comment

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

        Thanks for the fix! The code looks correct, but I'm a little worried about performance regressions for changing focus. Are you familiar with the pinpoint system for checking for regressions like this? If not, I can help kick off a test.

        Suyeon Ji

        Hi, thanks for the feedback!
        I tried to use Pinpoint as you suggested, but unfortunately, I was denied access. Could you help me with running the regression test?
        For the benchmarks, I believe blink_perf.css and blink_perf.events are appropriate. Do I need to run anything else besides these?

        Mason Freed

        Sorry for the delay here! I just kicked off these pinpoints:

        Suyeon Ji

        Hi, thanks for the review. I'm sorry, but the perf test failed.
        It seems that both my test and the baseline failed. Since I can't see the logs, could you please take a look?
        Also, I share your concern about the tree walks, so I'll give it some more thought.

        Mason Freed

        YEah, sorry about that, I think Pinpoint had some issues over the last few days. I believe they're fixed, so I just kicked off these two:

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Suyeon Ji
        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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
        Gerrit-Change-Number: 7486091
        Gerrit-PatchSet: 6
        Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
        Gerrit-Attention: Suyeon Ji <zees...@gmail.com>
        Gerrit-Comment-Date: Fri, 30 Jan 2026 18:34:51 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        chromeperf@appspot.gserviceaccount.com (Gerrit)

        unread,
        Jan 30, 2026, 7:28:29 PM (9 days ago) Jan 30
        to Suyeon Ji, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Message from chrom...@appspot.gserviceaccount.com

        📍 Job linux-perf/blink_perf.events complete.

        See results at: https://pinpoint-dot-chromeperf.appspot.com/job/10e0ed17710000

        Gerrit-Comment-Date: Sat, 31 Jan 2026 00:28:19 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        chromeperf@appspot.gserviceaccount.com (Gerrit)

        unread,
        Jan 30, 2026, 8:09:59 PM (9 days ago) Jan 30
        to Suyeon Ji, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Message from chrom...@appspot.gserviceaccount.com

        📍 Job linux-perf/blink_perf.events complete.

        See results at: https://pinpoint-dot-chromeperf.appspot.com/job/14bb4c6e710000

        Gerrit-Comment-Date: Sat, 31 Jan 2026 01:09:49 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        chromeperf@appspot.gserviceaccount.com (Gerrit)

        unread,
        Jan 30, 2026, 10:34:42 PM (9 days ago) Jan 30
        to Suyeon Ji, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Message from chrom...@appspot.gserviceaccount.com

        📍 Job linux-perf/blink_perf.events complete.

        See results at: https://pinpoint-dot-chromeperf.appspot.com/job/107221d6710000

        Gerrit-Comment-Date: Sat, 31 Jan 2026 03:34:26 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        chromeperf@appspot.gserviceaccount.com (Gerrit)

        unread,
        Jan 31, 2026, 1:37:18 AM (9 days ago) Jan 31
        to Suyeon Ji, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Message from chrom...@appspot.gserviceaccount.com

        📍 Job linux-perf/blink_perf.events complete.

        See results at: https://pinpoint-dot-chromeperf.appspot.com/job/13f4204a710000

        Gerrit-Comment-Date: Sat, 31 Jan 2026 06:37:06 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Suyeon Ji (Gerrit)

        unread,
        Feb 1, 2026, 9:23:15 AM (7 days ago) Feb 1
        to chrom...@appspot.gserviceaccount.com, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Mason Freed

        Suyeon Ji added 1 comment

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

        Thanks for the fix! The code looks correct, but I'm a little worried about performance regressions for changing focus. Are you familiar with the pinpoint system for checking for regressions like this? If not, I can help kick off a test.

        Suyeon Ji

        Hi, thanks for the feedback!
        I tried to use Pinpoint as you suggested, but unfortunately, I was denied access. Could you help me with running the regression test?
        For the benchmarks, I believe blink_perf.css and blink_perf.events are appropriate. Do I need to run anything else besides these?

        Mason Freed

        Sorry for the delay here! I just kicked off these pinpoints:

        Suyeon Ji

        Hi, thanks for the review. I'm sorry, but the perf test failed.
        It seems that both my test and the baseline failed. Since I can't see the logs, could you please take a look?
        Also, I share your concern about the tree walks, so I'll give it some more thought.

        Mason Freed

        YEah, sorry about that, I think Pinpoint had some issues over the last few days. I believe they're fixed, so I just kicked off these two:

        Suyeon Ji

        Checking the test results, there doesn't seem to be any regression.

        IMHO, this will affect performance much.
        Usually, `focused_element_` is initialized to `nullptr` inside `SetFocusedElement()` ([Line 5894](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/document.cc;l=5894)). In this case, the new code is skipped because it only runs when `focused_element_` is non-null.

        `focused_element_` is non-null only when `SetFocusedElement()` is called recursively, like calling focus() while dispatching blur or focusout events.

        Since this rarely happens, the performance impact is likely small.

        Please let me know what you think. Thank you!

        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 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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
        Gerrit-Change-Number: 7486091
        Gerrit-PatchSet: 6
        Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
        Gerrit-Attention: Mason Freed <mas...@chromium.org>
        Gerrit-Comment-Date: Sun, 01 Feb 2026 14:22:34 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Suyeon Ji (Gerrit)

        unread,
        Feb 1, 2026, 9:32:11 AM (7 days ago) Feb 1
        to chrom...@appspot.gserviceaccount.com, Rune Lillesveen, Mason Freed, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Patchset-level comments
        Suyeon Ji

        *this will not affect performance much.

        Gerrit-Comment-Date: Sun, 01 Feb 2026 14:31:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Mason Freed (Gerrit)

        unread,
        Feb 2, 2026, 2:56:46 PM (6 days ago) Feb 2
        to Suyeon Ji, chrom...@appspot.gserviceaccount.com, Rune Lillesveen, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Suyeon Ji

        Mason Freed voted and added 1 comment

        Votes added by Mason Freed

        Code-Review+1

        1 comment

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

        Ok, let's land it and see what happens. Thanks for the patch!

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Suyeon Ji
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
        Gerrit-Change-Number: 7486091
        Gerrit-PatchSet: 6
        Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
        Gerrit-Attention: Suyeon Ji <zees...@gmail.com>
        Gerrit-Comment-Date: Mon, 02 Feb 2026 19:56:29 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Suyeon Ji (Gerrit)

        unread,
        Feb 2, 2026, 10:58:39 PM (6 days ago) Feb 2
        to Mason Freed, chrom...@appspot.gserviceaccount.com, Rune Lillesveen, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

        Suyeon Ji added 6 comments

        Patchset-level comments
        Suyeon Ji . resolved

        Hi @fut...@chromium.org
        Can I ask you vote for this? Thank you!

        Mason Freed . resolved

        Ok, let's land it and see what happens. Thanks for the patch!

        Suyeon Ji

        Thank you!

        File third_party/blink/renderer/core/dom/document.cc
        Line 5894, Patchset 5: if (ancestor && !ancestor->contains(focused_element_)) {
        Mason Freed . resolved

        This is a parent tree walk (O(tree depth)). This one will get hit every time the focus changes and there's a common ancestor, which is quite common.

        Suyeon Ji

        Done

        Line 5895, Patchset 5: ancestor->SetHasFocusWithinUpToAncestor(
        Mason Freed . resolved

        This is also a parent tree walk (O(distance to common ancestor)).

        Suyeon Ji

        Done

        Line 5897, Patchset 5: DynamicTo<Element>(FlatTreeTraversal::CommonAncestor(
        Mason Freed . resolved

        This is also several parent tree walks (O(distance to common ancestor)).

        Suyeon Ji

        Done

        Line 5920, Patchset 5: if (ancestor && !ancestor->contains(focused_element_)) {

        ancestor->SetHasFocusWithinUpToAncestor(
        false,
        DynamicTo<Element>(FlatTreeTraversal::CommonAncestor(
        *ancestor, *focused_element_)),
        /*need_snap_container_search=*/false);
        }
        Mason Freed . resolved

        ditto here

        Suyeon Ji

        Done

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
          Gerrit-Change-Number: 7486091
          Gerrit-PatchSet: 6
          Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
          Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
          Gerrit-Comment-Date: Tue, 03 Feb 2026 03:58:04 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Rune Lillesveen (Gerrit)

          unread,
          Feb 3, 2026, 3:50:09 AM (5 days ago) Feb 3
          to Suyeon Ji, Rune Lillesveen, Mason Freed, chrom...@appspot.gserviceaccount.com, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Suyeon Ji

          Rune Lillesveen voted and added 1 comment

          Votes added by Rune Lillesveen

          Code-Review+1

          1 comment

          Patchset-level comments
          Rune Lillesveen . resolved

          rslgtm

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Suyeon Ji
          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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
            Gerrit-Change-Number: 7486091
            Gerrit-PatchSet: 6
            Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
            Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
            Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
            Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
            Gerrit-Attention: Suyeon Ji <zees...@gmail.com>
            Gerrit-Comment-Date: Tue, 03 Feb 2026 08:49:48 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Suyeon Ji (Gerrit)

            unread,
            Feb 3, 2026, 4:45:31 AM (5 days ago) Feb 3
            to Rune Lillesveen, Mason Freed, chrom...@appspot.gserviceaccount.com, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

            Suyeon Ji added 1 comment

            Patchset-level comments
            Rune Lillesveen . resolved

            rslgtm

            Suyeon Ji

            thank you!

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
            Gerrit-Change-Number: 7486091
            Gerrit-PatchSet: 6
            Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
            Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
            Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
            Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
            Gerrit-Comment-Date: Tue, 03 Feb 2026 09:45:00 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
            satisfied_requirement
            open
            diffy

            Suyeon Ji (Gerrit)

            unread,
            Feb 3, 2026, 4:45:39 AM (5 days ago) Feb 3
            to Rune Lillesveen, Mason Freed, chrom...@appspot.gserviceaccount.com, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

            Suyeon Ji voted Commit-Queue+2

            Commit-Queue+2
            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
            Gerrit-Change-Number: 7486091
            Gerrit-PatchSet: 6
            Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
            Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
            Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
            Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
            Gerrit-Comment-Date: Tue, 03 Feb 2026 09:45:10 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            Feb 3, 2026, 5:39:33 AM (5 days ago) Feb 3
            to Suyeon Ji, Rune Lillesveen, Mason Freed, chrom...@appspot.gserviceaccount.com, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

            Chromium LUCI CQ submitted the change

            Change information

            Commit message:
            Fix stale :focus-within after synchronous focus shifts

            This patch ensures :focus-within is updated correctly when focus changes
            during focus/blur event dispatch.

            Previously, the common ancestor used to update :focus-within was
            computed before dispatching events. If a handler synchronously moved
            focus, that ancestor could become invalid, leaving elements incorrectly
            matching :focus-within.

            This change detects focus shifts after event dispatch and re-evaluates
            the ancestry, clearing the stale :focus-within state up to the correct
            common ancestor when needed.
            Bug: 457465869
            Change-Id: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
            Reviewed-by: Mason Freed <mas...@chromium.org>
            Commit-Queue: Suyeon Ji <zees...@gmail.com>
            Reviewed-by: Rune Lillesveen <fut...@chromium.org>
            Cr-Commit-Position: refs/heads/main@{#1578673}
            Files:
            • M third_party/blink/renderer/core/dom/document.cc
            • D third_party/blink/web_tests/external/wpt/css/selectors/focus-within-focus-move-expected.txt
            Change size: S
            Delta: 2 files changed, 20 insertions(+), 5 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Rune Lillesveen, +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: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
            Gerrit-Change-Number: 7486091
            Gerrit-PatchSet: 7
            Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
            Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
            Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
            open
            diffy
            satisfied_requirement

            chromeperf@appspot.gserviceaccount.com (Gerrit)

            unread,
            Feb 7, 2026, 12:36:12 AM (yesterday) Feb 7
            to Suyeon Ji, Chromium LUCI CQ, Rune Lillesveen, Mason Freed, AyeAye, chromium...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I08fbc553b7d47dacd0ce9b2b128a3c8187e01ac9
            Gerrit-Change-Number: 7486091
            Gerrit-PatchSet: 7
            Gerrit-Owner: Suyeon Ji <zees...@gmail.com>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
            Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
            Gerrit-Reviewer: Suyeon Ji <zees...@gmail.com>
            Gerrit-Comment-Date: Sat, 07 Feb 2026 05:36:02 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: No
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages