[PEPC] Disable focusing via script [chromium/src : main]

0 views
Skip to first unread message

Blink W3C Test Autoroller (Gerrit)

unread,
Apr 17, 2024, 4:02:45 PMApr 17
to Andy Paicu, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org

Message from Blink W3C Test Autoroller

Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/45766.

When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
Gerrit-Change-Number: 5463501
Gerrit-PatchSet: 1
Gerrit-Owner: Andy Paicu <andy...@chromium.org>
Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Apr 2024 20:02:33 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Andy Paicu (Gerrit)

unread,
Apr 18, 2024, 9:34:53 AMApr 18
to Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
Attention needed from Thomas Nguyen

Andy Paicu added 1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Andy Paicu . resolved

Hi Thomas, PTAL

Open in Gerrit

Related details

Attention is currently required from:
  • Thomas Nguyen
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
Gerrit-Change-Number: 5463501
Gerrit-PatchSet: 2
Gerrit-Owner: Andy Paicu <andy...@chromium.org>
Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
Gerrit-Comment-Date: Thu, 18 Apr 2024 13:34:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Thomas Nguyen (Gerrit)

unread,
Apr 18, 2024, 9:39:57 AMApr 18
to Andy Paicu, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
Attention needed from Andy Paicu

Thomas Nguyen added 1 comment

File third_party/blink/renderer/core/html/html_permission_element.cc
Line 335, Patchset 2 (Latest): if (params.focus_trigger == FocusTrigger::kScript) {
return;
}
Thomas Nguyen . unresolved

A bit overlap as I am also looking at this, but thanks for the CL.

From what I saw, the `kScript` is called even not for focus() from JS, for example focus restoring. What will be expect in this case, we might need to verify it?

Open in Gerrit

Related details

Attention is currently required from:
  • Andy Paicu
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
    Gerrit-Change-Number: 5463501
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Andy Paicu <andy...@chromium.org>
    Gerrit-Comment-Date: Thu, 18 Apr 2024 13:39:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andy Paicu (Gerrit)

    unread,
    Apr 18, 2024, 10:15:16 AMApr 18
    to Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
    Attention needed from Thomas Nguyen

    Andy Paicu added 1 comment

    File third_party/blink/renderer/core/html/html_permission_element.cc
    Line 335, Patchset 2 (Latest): if (params.focus_trigger == FocusTrigger::kScript) {
    return;
    }
    Thomas Nguyen . unresolved

    A bit overlap as I am also looking at this, but thanks for the CL.

    From what I saw, the `kScript` is called even not for focus() from JS, for example focus restoring. What will be expect in this case, we might need to verify it?

    Andy Paicu

    Thanks for bringing this to my attention, I had a look through usages:
    [1] `Element::focusForBindings` this is for the `focus()` function so we for sure want to avoid that.
    [2] `WebElement::SelectText` this seems to be for focusing text controls that have had their entire contents selected. Should be irrelevant to us.
    [3] `TextControlElement::select()` seems to complement the one above
    [4], [5] `HTMLDialogElement::close`, `HTMLElement::HidePopoverInternal` this is related to modal elements being closed and restoring focus to whatever was focused before they opened. If the permission element was focused before the dialog/popup opened, there is a good chance that the user has forgotten already about it and any enter/space key presses are probably unintentional. I think in this case ignoring the focus event is the correct thing to do.

    [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/element.cc
    [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/exported/web_element.cc;l=189
    [3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/forms/text_control_element.cc;l=277
    [4] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_dialog_element.cc;l=187
    [5] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_element.cc;l=1861

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Thomas Nguyen
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
    Gerrit-Change-Number: 5463501
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
    Gerrit-Comment-Date: Thu, 18 Apr 2024 14:15:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Thomas Nguyen <tun...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Thomas Nguyen (Gerrit)

    unread,
    Apr 19, 2024, 8:38:51 AMApr 19
    to Andy Paicu, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
    Attention needed from Andy Paicu

    Thomas Nguyen added 1 comment

    File third_party/blink/renderer/core/html/html_permission_element.cc
    Line 335, Patchset 2 (Latest): if (params.focus_trigger == FocusTrigger::kScript) {
    return;
    }
    Thomas Nguyen . unresolved

    A bit overlap as I am also looking at this, but thanks for the CL.

    From what I saw, the `kScript` is called even not for focus() from JS, for example focus restoring. What will be expect in this case, we might need to verify it?

    Andy Paicu

    Thanks for bringing this to my attention, I had a look through usages:
    [1] `Element::focusForBindings` this is for the `focus()` function so we for sure want to avoid that.
    [2] `WebElement::SelectText` this seems to be for focusing text controls that have had their entire contents selected. Should be irrelevant to us.
    [3] `TextControlElement::select()` seems to complement the one above
    [4], [5] `HTMLDialogElement::close`, `HTMLElement::HidePopoverInternal` this is related to modal elements being closed and restoring focus to whatever was focused before they opened. If the permission element was focused before the dialog/popup opened, there is a good chance that the user has forgotten already about it and any enter/space key presses are probably unintentional. I think in this case ignoring the focus event is the correct thing to do.

    [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/element.cc
    [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/exported/web_element.cc;l=189
    [3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/forms/text_control_element.cc;l=277
    [4] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_dialog_element.cc;l=187
    [5] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_element.cc;l=1861

    Thomas Nguyen

    Thank you. And I think, it would be narrowed down to use mojom::blink::FocusType::kScript instead of FocusTrigger::kScript.
    FocusTrigger::kScript is set by default and there would be more callees that we are note aware of.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andy Paicu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
    Gerrit-Change-Number: 5463501
    Gerrit-PatchSet: 2
    Gerrit-Owner: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Andy Paicu <andy...@chromium.org>
    Gerrit-Comment-Date: Fri, 19 Apr 2024 12:38:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
    Comment-In-Reply-To: Thomas Nguyen <tun...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Andy Paicu (Gerrit)

    unread,
    Apr 23, 2024, 8:31:10 AMApr 23
    to Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
    Attention needed from Thomas Nguyen

    Andy Paicu added 1 comment

    File third_party/blink/renderer/core/html/html_permission_element.cc
    Line 335, Patchset 2: if (params.focus_trigger == FocusTrigger::kScript) {
    return;
    }
    Thomas Nguyen . resolved

    A bit overlap as I am also looking at this, but thanks for the CL.

    From what I saw, the `kScript` is called even not for focus() from JS, for example focus restoring. What will be expect in this case, we might need to verify it?

    Andy Paicu

    Thanks for bringing this to my attention, I had a look through usages:
    [1] `Element::focusForBindings` this is for the `focus()` function so we for sure want to avoid that.
    [2] `WebElement::SelectText` this seems to be for focusing text controls that have had their entire contents selected. Should be irrelevant to us.
    [3] `TextControlElement::select()` seems to complement the one above
    [4], [5] `HTMLDialogElement::close`, `HTMLElement::HidePopoverInternal` this is related to modal elements being closed and restoring focus to whatever was focused before they opened. If the permission element was focused before the dialog/popup opened, there is a good chance that the user has forgotten already about it and any enter/space key presses are probably unintentional. I think in this case ignoring the focus event is the correct thing to do.

    [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/element.cc
    [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/exported/web_element.cc;l=189
    [3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/forms/text_control_element.cc;l=277
    [4] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_dialog_element.cc;l=187
    [5] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_element.cc;l=1861

    Thomas Nguyen

    Thank you. And I think, it would be narrowed down to use mojom::blink::FocusType::kScript instead of FocusTrigger::kScript.
    FocusTrigger::kScript is set by default and there would be more callees that we are note aware of.

    Andy Paicu

    Ah, I see what you mean now, yes you are right. Done.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Thomas Nguyen
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
    Gerrit-Change-Number: 5463501
    Gerrit-PatchSet: 3
    Gerrit-Owner: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
    Gerrit-Comment-Date: Tue, 23 Apr 2024 12:30:57 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Thomas Nguyen (Gerrit)

    unread,
    Apr 26, 2024, 6:52:37 AMApr 26
    to Andy Paicu, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
    Attention needed from Andy Paicu

    Thomas Nguyen voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andy Paicu
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I1fe10d3315120f03accfc99b518bef971ecd2947
    Gerrit-Change-Number: 5463501
    Gerrit-PatchSet: 5
    Gerrit-Owner: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Andy Paicu <andy...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Apr 2024 10:52:27 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Andy Paicu (Gerrit)

    unread,
    Apr 26, 2024, 7:01:31 AMApr 26
    to Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
    Attention needed from Mason Freed

    Andy Paicu added 1 comment

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Andy Paicu . resolved

    Hi Mason, PTAL html_permission_element.*

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mason Freed
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I1fe10d3315120f03accfc99b518bef971ecd2947
    Gerrit-Change-Number: 5463501
    Gerrit-PatchSet: 5
    Gerrit-Owner: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Apr 2024 11:01:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    open
    diffy

    Andy Paicu (Gerrit)

    unread,
    Apr 26, 2024, 7:02:02 AMApr 26
    to Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
    Attention needed from Mason Freed

    Andy Paicu voted Auto-Submit+1

    Auto-Submit+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Mason Freed
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement 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: I1fe10d3315120f03accfc99b518bef971ecd2947
    Gerrit-Change-Number: 5463501
    Gerrit-PatchSet: 6
    Gerrit-Owner: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Fri, 26 Apr 2024 11:01:49 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Apr 29, 2024, 3:26:59 PMApr 29
    to Andy Paicu, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
    Attention needed from Andy Paicu

    Mason Freed added 4 comments

    Commit Message
    Line 9, Patchset 6 (Latest):The PEPC element should not be able to focused via the `focus()`
    function since it can be abused for obtaining unintentional clicks by
    focusing the element at unexpected times.
    Mason Freed . unresolved

    So this is quite unique/odd behavior that I don't believe has a precedent. I'm worried about accessibility and other things getting broken. Is there a discussion somewhere about this behavior?

    File chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc
    Line 392, Patchset 6 (Latest): console.log(event.target.id);
    Mason Freed . unresolved

    Probably don't want a console.log in here?

    Line 404, Patchset 6 (Latest): // The exact number of "tab" presses needed to pass through all elements
    Mason Freed . unresolved

    Why is that? You have `tabindex=0` on the important ones, so I would think the sequential focus behavior would be the same.

    File third_party/blink/renderer/core/html/html_permission_element.cc
    Line 355, Patchset 6 (Latest): if (params.type == mojom::blink::FocusType::kScript) {
    return;
    }
    Mason Freed . unresolved

    So you don't want to do this, since it'll break accessibility. (The a11y code will think the element is focusable, and it won't be.)

    You should instead override `Element::IsFocusable()` appropriately.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Andy Paicu
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 6
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Comment-Date: Mon, 29 Apr 2024 19:26:48 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      Apr 30, 2024, 5:07:47 AMApr 30
      to Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Mason Freed

      Andy Paicu added 4 comments

      Commit Message
      Line 9, Patchset 6 (Latest):The PEPC element should not be able to focused via the `focus()`
      function since it can be abused for obtaining unintentional clicks by
      focusing the element at unexpected times.
      Mason Freed . unresolved

      So this is quite unique/odd behavior that I don't believe has a precedent. I'm worried about accessibility and other things getting broken. Is there a discussion somewhere about this behavior?

      Andy Paicu

      The desire is to prevent programmatic focus on the permission element as it could easily be used by bad developers to obtain unintended activations (by getting the user to hit enter/space when the developers has sneakily focused the permission element). So we want to prevent APIs like `focus()` (I believe right now the only APIs to do this are `focus()` and `blur()`).

      The reasoning is similar to why we don't want to allow developers to use `click()` and we filter out those events.

      File chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc
      Mason Freed . resolved

      Probably don't want a console.log in here?

      Andy Paicu

      Oops.

      Line 404, Patchset 6 (Latest): // The exact number of "tab" presses needed to pass through all elements
      Mason Freed . resolved

      Why is that? You have `tabindex=0` on the important ones, so I would think the sequential focus behavior would be the same.

      Andy Paicu

      The variations seem to be on how many tabs it takes to actually reach the web contents elements, as it will first tab through the browser UI elements. I can re-work

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 355, Patchset 6 (Latest): if (params.type == mojom::blink::FocusType::kScript) {
      return;
      }
      Mason Freed . unresolved

      So you don't want to do this, since it'll break accessibility. (The a11y code will think the element is focusable, and it won't be.)

      You should instead override `Element::IsFocusable()` appropriately.

      Andy Paicu

      `Element::IsFocusable()` doesn't seem to provide the information we need as the `UpdateBehavior` enum doesn't have a value that maps to "focus events coming from a script". I don't know how I would override `Element::IsFocusable()` so that it keeps the same behavior.

      I'm confused why this would negatively impact A11y. The focus type enum specifically mentions accessibility events will be `kNone` and we're only filtering out `kScript`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mason Freed
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 6
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Tue, 30 Apr 2024 09:07:32 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      Apr 30, 2024, 5:12:56 AMApr 30
      to Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Mason Freed

      Andy Paicu added 1 comment

      File chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc
      Line 404, Patchset 6 (Latest): // The exact number of "tab" presses needed to pass through all elements
      Mason Freed . resolved

      Why is that? You have `tabindex=0` on the important ones, so I would think the sequential focus behavior would be the same.

      Andy Paicu

      The variations seem to be on how many tabs it takes to actually reach the web contents elements, as it will first tab through the browser UI elements. I can re-work

      Andy Paicu

      Somehow my previous comments got cut out:

      I can re-work it to something like:

      • tab until the first element gets focus
      • tab 4 more times
      • check all elements had focus

      if you think this approach is too shoddy.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Mason Freed
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 6
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Tue, 30 Apr 2024 09:12:41 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      Apr 30, 2024, 1:56:48 PMApr 30
      to Andy Paicu, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal and Andy Paicu

      Mason Freed added 5 comments

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

      +aleventhal - please see the question below

      Commit Message
      Line 9, Patchset 6:The PEPC element should not be able to focused via the `focus()`

      function since it can be abused for obtaining unintentional clicks by
      focusing the element at unexpected times.
      Mason Freed . resolved

      So this is quite unique/odd behavior that I don't believe has a precedent. I'm worried about accessibility and other things getting broken. Is there a discussion somewhere about this behavior?

      Andy Paicu

      The desire is to prevent programmatic focus on the permission element as it could easily be used by bad developers to obtain unintended activations (by getting the user to hit enter/space when the developers has sneakily focused the permission element). So we want to prevent APIs like `focus()` (I believe right now the only APIs to do this are `focus()` and `blur()`).

      The reasoning is similar to why we don't want to allow developers to use `click()` and we filter out those events.

      Mason Freed

      This will all be interesting to get into standards. But I understand the desire here at least.

      File third_party/blink/renderer/core/html/html_permission_element.h
      Line 52, Patchset 7 (Latest): void Focus(const FocusParams& params) override;
      Mason Freed . unresolved

      One thing I do think is absolutely required is to override `SupportsFocus()` here to be `true`, since you are explicitly allowing the element to be focused. Right?

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 355, Patchset 6: if (params.type == mojom::blink::FocusType::kScript) {
      return;
      }
      Mason Freed . unresolved

      So you don't want to do this, since it'll break accessibility. (The a11y code will think the element is focusable, and it won't be.)

      You should instead override `Element::IsFocusable()` appropriately.

      Andy Paicu

      `Element::IsFocusable()` doesn't seem to provide the information we need as the `UpdateBehavior` enum doesn't have a value that maps to "focus events coming from a script". I don't know how I would override `Element::IsFocusable()` so that it keeps the same behavior.

      I'm confused why this would negatively impact A11y. The focus type enum specifically mentions accessibility events will be `kNone` and we're only filtering out `kScript`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Mason Freed

      Right - `IsFocusable()` is a property of the node, so it can't change depending on "how" the node tries to become focused. I suppose this might work?

      +aleventhal to comment on potential issues around not allowing script focus. Perhaps there aren't any issues!

      File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
      Line 15, Patchset 7 (Latest): let el = document.getElementById("id1");
      el.focus();
      assert_not_equals(document.activeElement, el,
      "Permission element should not be focused");
      Mason Freed . unresolved

      Perhaps add a test that uses `test_driver`'s `pointerDown()` to manually click the element and make sure it *does* get focus in that case?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Andy Paicu
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 7
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@google.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Comment-Date: Tue, 30 Apr 2024 17:56:35 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 6, 2024, 11:09:18 AMMay 6
      to Aaron Leventhal, Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal and Mason Freed

      Andy Paicu voted and added 2 comments

      Votes added by Andy Paicu

      Auto-Submit+0
      Commit-Queue+1

      2 comments

      File third_party/blink/renderer/core/html/html_permission_element.h
      Line 52, Patchset 7: void Focus(const FocusParams& params) override;
      Mason Freed . resolved

      One thing I do think is absolutely required is to override `SupportsFocus()` here to be `true`, since you are explicitly allowing the element to be focused. Right?

      Andy Paicu

      Done

      File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
      Line 15, Patchset 7: let el = document.getElementById("id1");

      el.focus();
      assert_not_equals(document.activeElement, el,
      "Permission element should not be focused");
      Mason Freed . resolved

      Perhaps add a test that uses `test_driver`'s `pointerDown()` to manually click the element and make sure it *does* get focus in that case?

      Andy Paicu

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Mason Freed
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 8
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 15:09:06 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 6, 2024, 12:00:30 PMMay 6
      to Andy Paicu, Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu and Mason Freed

      Aaron Leventhal added 1 comment

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 355, Patchset 6: if (params.type == mojom::blink::FocusType::kScript) {
      return;
      }
      Mason Freed . unresolved

      So you don't want to do this, since it'll break accessibility. (The a11y code will think the element is focusable, and it won't be.)

      You should instead override `Element::IsFocusable()` appropriately.

      Andy Paicu

      `Element::IsFocusable()` doesn't seem to provide the information we need as the `UpdateBehavior` enum doesn't have a value that maps to "focus events coming from a script". I don't know how I would override `Element::IsFocusable()` so that it keeps the same behavior.

      I'm confused why this would negatively impact A11y. The focus type enum specifically mentions accessibility events will be `kNone` and we're only filtering out `kScript`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Mason Freed

      Right - `IsFocusable()` is a property of the node, so it can't change depending on "how" the node tries to become focused. I suppose this might work?

      +aleventhal to comment on potential issues around not allowing script focus. Perhaps there aren't any issues!

      Aaron Leventhal

      Can you tab to the element?
      If so, I would think screen reader users will need to be able to navigate to the element in their virtual buffer, and set focus to it.
      If that's true, it needs to support the focusable state.

      Either way, we should have a content_browsertest for this element that asserts the correct focusable state, and correct behavior if the Action::kFocus action is used on it. Probably would go into content/browser/accessibility/accessibility_action_browsertest.cc.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andy Paicu
      • Mason Freed
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 8
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 16:00:14 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      May 6, 2024, 1:39:32 PMMay 6
      to Andy Paicu, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal and Andy Paicu

      Mason Freed added 1 comment

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 355, Patchset 6: if (params.type == mojom::blink::FocusType::kScript) {
      return;
      }
      Mason Freed . unresolved

      So you don't want to do this, since it'll break accessibility. (The a11y code will think the element is focusable, and it won't be.)

      You should instead override `Element::IsFocusable()` appropriately.

      Andy Paicu

      `Element::IsFocusable()` doesn't seem to provide the information we need as the `UpdateBehavior` enum doesn't have a value that maps to "focus events coming from a script". I don't know how I would override `Element::IsFocusable()` so that it keeps the same behavior.

      I'm confused why this would negatively impact A11y. The focus type enum specifically mentions accessibility events will be `kNone` and we're only filtering out `kScript`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Mason Freed

      Right - `IsFocusable()` is a property of the node, so it can't change depending on "how" the node tries to become focused. I suppose this might work?

      +aleventhal to comment on potential issues around not allowing script focus. Perhaps there aren't any issues!

      Aaron Leventhal

      Can you tab to the element?
      If so, I would think screen reader users will need to be able to navigate to the element in their virtual buffer, and set focus to it.
      If that's true, it needs to support the focusable state.

      Either way, we should have a content_browsertest for this element that asserts the correct focusable state, and correct behavior if the Action::kFocus action is used on it. Probably would go into content/browser/accessibility/accessibility_action_browsertest.cc.

      Mason Freed

      Aaron, when an AT using a virtual buffer this way tries to focus an element, what value of `mojom::blink::FocusType` does it use? I don't see one that is like `kAccessibility`, so I'm concerned that perhaps those calls use `kScript` which will get blocked here.

      I presume this is why you're asking for an a11y test for this behavior, so perhaps that'll answer my question.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Andy Paicu
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 8
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 17:39:18 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
      Comment-In-Reply-To: Aaron Leventhal <aleve...@chromium.org>
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 6, 2024, 2:28:37 PMMay 6
      to Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal, Mason Freed and Thomas Nguyen

      Andy Paicu added 1 comment

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 355, Patchset 6: if (params.type == mojom::blink::FocusType::kScript) {
      return;
      }
      Mason Freed . unresolved

      So you don't want to do this, since it'll break accessibility. (The a11y code will think the element is focusable, and it won't be.)

      You should instead override `Element::IsFocusable()` appropriately.

      Andy Paicu

      `Element::IsFocusable()` doesn't seem to provide the information we need as the `UpdateBehavior` enum doesn't have a value that maps to "focus events coming from a script". I don't know how I would override `Element::IsFocusable()` so that it keeps the same behavior.

      I'm confused why this would negatively impact A11y. The focus type enum specifically mentions accessibility events will be `kNone` and we're only filtering out `kScript`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Mason Freed

      Right - `IsFocusable()` is a property of the node, so it can't change depending on "how" the node tries to become focused. I suppose this might work?

      +aleventhal to comment on potential issues around not allowing script focus. Perhaps there aren't any issues!

      Aaron Leventhal

      Can you tab to the element?
      If so, I would think screen reader users will need to be able to navigate to the element in their virtual buffer, and set focus to it.
      If that's true, it needs to support the focusable state.

      Either way, we should have a content_browsertest for this element that asserts the correct focusable state, and correct behavior if the Action::kFocus action is used on it. Probably would go into content/browser/accessibility/accessibility_action_browsertest.cc.

      Mason Freed

      Aaron, when an AT using a virtual buffer this way tries to focus an element, what value of `mojom::blink::FocusType` does it use? I don't see one that is like `kAccessibility`, so I'm concerned that perhaps those calls use `kScript` which will get blocked here.

      I presume this is why you're asking for an a11y test for this behavior, so perhaps that'll answer my question.

      Andy Paicu

      As per the comment in [1], this shouldn't apply to accessibility events. I've added a test and `SupportsFocus` implementation. It's also brought to attention the fact that the permission element doesn't have its default role set to "button" so it seemed fitting to do it here. PTAL.

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Mason Freed
      • Thomas Nguyen
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 8
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 18:28:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      Comment-In-Reply-To: Aaron Leventhal <aleve...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 6, 2024, 2:28:54 PMMay 6
      to Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal, Mason Freed and Thomas Nguyen

      Andy Paicu voted Commit-Queue+1

      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Mason Freed
      • Thomas Nguyen
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 9
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 18:28:44 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      May 6, 2024, 2:48:28 PMMay 6
      to Andy Paicu, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal, Andy Paicu and Thomas Nguyen

      Mason Freed added 8 comments

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

      Ok, given the comments and additional tests, I'm ok with this change. Just some nits and bug fixes now. Thanks!

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1514, Patchset 9 (Latest): invalid_pepc->AccessibilityPerformAction(action_data);
      valid_pepc->AccessibilityPerformAction(action_data);
      Mason Freed . unresolved

      Even if `invalid_pepc` was focusable, this test would pass, since you focus them both right after each other. I think you would need to add more `ASSERT`s between these two calls to make sure.

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 351, Patchset 9 (Latest): return !permission_descriptors_.empty();
      Mason Freed . unresolved

      Comment would be nice here also: "The permission element is only focusable if it has a valid type" or something similar.

      Line 355, Patchset 6: if (params.type == mojom::blink::FocusType::kScript) {
      return;
      }
      Mason Freed . unresolved

      So you don't want to do this, since it'll break accessibility. (The a11y code will think the element is focusable, and it won't be.)

      You should instead override `Element::IsFocusable()` appropriately.

      Andy Paicu

      `Element::IsFocusable()` doesn't seem to provide the information we need as the `UpdateBehavior` enum doesn't have a value that maps to "focus events coming from a script". I don't know how I would override `Element::IsFocusable()` so that it keeps the same behavior.

      I'm confused why this would negatively impact A11y. The focus type enum specifically mentions accessibility events will be `kNone` and we're only filtering out `kScript`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Mason Freed

      Right - `IsFocusable()` is a property of the node, so it can't change depending on "how" the node tries to become focused. I suppose this might work?

      +aleventhal to comment on potential issues around not allowing script focus. Perhaps there aren't any issues!

      Aaron Leventhal

      Can you tab to the element?
      If so, I would think screen reader users will need to be able to navigate to the element in their virtual buffer, and set focus to it.
      If that's true, it needs to support the focusable state.

      Either way, we should have a content_browsertest for this element that asserts the correct focusable state, and correct behavior if the Action::kFocus action is used on it. Probably would go into content/browser/accessibility/accessibility_action_browsertest.cc.

      Mason Freed

      Aaron, when an AT using a virtual buffer this way tries to focus an element, what value of `mojom::blink::FocusType` does it use? I don't see one that is like `kAccessibility`, so I'm concerned that perhaps those calls use `kScript` which will get blocked here.

      I presume this is why you're asking for an a11y test for this behavior, so perhaps that'll answer my question.

      Andy Paicu

      As per the comment in [1], this shouldn't apply to accessibility events. I've added a test and `SupportsFocus` implementation. It's also brought to attention the fact that the permission element doesn't have its default role set to "button" so it seemed fitting to do it here. PTAL.

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Mason Freed

      Ok, thanks for the additional context. I think it's worth adding a comment above this line explaining what this does, and that a11y is not affected.

      File third_party/blink/renderer/modules/accessibility/ax_node_object.cc
      Line 1916, Patchset 9 (Latest): return ax::mojom::blink::Role::kButton;
      Mason Freed . resolved

      Yes, nice, thanks!

      File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
      Line 12, Patchset 9 (Latest):<permission tabindex="0" id="id1" type="geolocation">
      Mason Freed . unresolved

      Perhaps also add a case for `type=invalid`?

      Line 29, Patchset 9 (Latest): test_driver.set_test_context(window.top);
      Mason Freed . unresolved

      I'm not sure this is needed...?

      Line 36, Patchset 9 (Latest): assert_equals(document.activeElement, el,
      Mason Freed . unresolved

      This is clicking on the `<span>`. I think you might want to click on the `<permission>` element?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Andy Paicu
      • Thomas Nguyen
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 18:48:15 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 6, 2024, 3:38:47 PMMay 6
      to Andy Paicu, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

      Aaron Leventhal added 3 comments

      Patchset-level comments
      Aaron Leventhal . resolved

      Thanks for the a11y changes so far. I'm fine with what we have here, although I do have a question about the accessible name for these elements. You can either do the following in a new CL or in here:

      We should have a DumpAccessibilityTreeTest. It should have a corresponding pair of files:
      content/test/data/accessibility/html/permission.html
      content/test/data/accessibility/html/permission-expected-blink.txt
      There's a readme in content/test/data/accessibility
      The name of the test would be something like:
      All/DumpAccessibilityTreeTest.AccessibilityPermission/blink
      You can copy an example from the AccessibilityDiv test

      Here's the file it goes into:
      https://source.chromium.org/chromium/chromium/src/+/main:content/browser/accessibility/dump_accessibility_tree_browsertest.cc

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9 (Latest): <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . unresolved

      Is there a default accessible name for these?
      It would be very unusual if we expected the author to use ARIA for it.

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 355, Patchset 6: if (params.type == mojom::blink::FocusType::kScript) {
      return;
      }
      Mason Freed . unresolved

      So you don't want to do this, since it'll break accessibility. (The a11y code will think the element is focusable, and it won't be.)

      You should instead override `Element::IsFocusable()` appropriately.

      Andy Paicu

      `Element::IsFocusable()` doesn't seem to provide the information we need as the `UpdateBehavior` enum doesn't have a value that maps to "focus events coming from a script". I don't know how I would override `Element::IsFocusable()` so that it keeps the same behavior.

      I'm confused why this would negatively impact A11y. The focus type enum specifically mentions accessibility events will be `kNone` and we're only filtering out `kScript`: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Mason Freed

      Right - `IsFocusable()` is a property of the node, so it can't change depending on "how" the node tries to become focused. I suppose this might work?

      +aleventhal to comment on potential issues around not allowing script focus. Perhaps there aren't any issues!

      Aaron Leventhal

      Can you tab to the element?
      If so, I would think screen reader users will need to be able to navigate to the element in their virtual buffer, and set focus to it.
      If that's true, it needs to support the focusable state.

      Either way, we should have a content_browsertest for this element that asserts the correct focusable state, and correct behavior if the Action::kFocus action is used on it. Probably would go into content/browser/accessibility/accessibility_action_browsertest.cc.

      Mason Freed

      Aaron, when an AT using a virtual buffer this way tries to focus an element, what value of `mojom::blink::FocusType` does it use? I don't see one that is like `kAccessibility`, so I'm concerned that perhaps those calls use `kScript` which will get blocked here.

      I presume this is why you're asking for an a11y test for this behavior, so perhaps that'll answer my question.

      Andy Paicu

      As per the comment in [1], this shouldn't apply to accessibility events. I've added a test and `SupportsFocus` implementation. It's also brought to attention the fact that the permission element doesn't have its default role set to "button" so it seemed fitting to do it here. PTAL.

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/public/mojom/input/focus_type.mojom;l=7

      Mason Freed

      Ok, thanks for the additional context. I think it's worth adding a comment above this line explaining what this does, and that a11y is not affected.

      Aaron Leventhal

      Andy/Mason, can you take a look at AXNodeObject::OnNativeFocusAction() and make sure everything looks right? That's the function where we handle the incoming focus request from an AT.

      https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/accessibility/ax_node_object.cc;l=5900

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andy Paicu
      • Mason Freed
      • Thomas Nguyen
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 19:38:26 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 6, 2024, 4:31:38 PMMay 6
      to Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal, Mason Freed and Thomas Nguyen

      Andy Paicu added 8 comments

      Patchset-level comments
      Aaron Leventhal . resolved

      Thanks for the a11y changes so far. I'm fine with what we have here, although I do have a question about the accessible name for these elements. You can either do the following in a new CL or in here:

      We should have a DumpAccessibilityTreeTest. It should have a corresponding pair of files:
      content/test/data/accessibility/html/permission.html
      content/test/data/accessibility/html/permission-expected-blink.txt
      There's a readme in content/test/data/accessibility
      The name of the test would be something like:
      All/DumpAccessibilityTreeTest.AccessibilityPermission/blink
      You can copy an example from the AccessibilityDiv test

      Here's the file it goes into:
      https://source.chromium.org/chromium/chromium/src/+/main:content/browser/accessibility/dump_accessibility_tree_browsertest.cc

      Andy Paicu

      Ack, will do in a follow-up.

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9: <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . unresolved

      Is there a default accessible name for these?
      It would be very unusual if we expected the author to use ARIA for it.

      Andy Paicu

      They do not have a default accessible name, can you give me an example of how this works for other elements (if possible, "button" since that is the closest to the permission element)? What should I implement/override and what is usually the convention when it comes to default accessible names?

      Line 1514, Patchset 9: invalid_pepc->AccessibilityPerformAction(action_data);
      valid_pepc->AccessibilityPerformAction(action_data);
      Mason Freed . unresolved

      Even if `invalid_pepc` was focusable, this test would pass, since you focus them both right after each other. I think you would need to add more `ASSERT`s between these two calls to make sure.

      Andy Paicu

      I tested this with `HtmlPermissionElement::SupportsFocus` hardcoded to `return true` and the test failed because the waiter immediately returned after the first focus event for the invalid element. So the test does not currently pass if both elements are actually focusable.

      I agree that it's not the best but I don't really see how to improve it. There aren't any productive `ASSERT`s to put in between the 2 calls, because the focus event requires an async step in order to take effect. Before making the `WaitForNotification` call there won't be time for any element to become focused, so there's no point in checking the focus state. And there is no real way to wait for the focus event to *not* do anything on the `invalid_pepc` element, other than the somewhat brittle wait-for-a-fixed-amount-of-time approach.

      I'm happy to add any checks you suggest but I think that any such checks will be useless before a `WaitForNotification` call and they will pass regardless of the focus behavior of the `permission` element.

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 351, Patchset 9: return !permission_descriptors_.empty();
      Mason Freed . resolved

      Comment would be nice here also: "The permission element is only focusable if it has a valid type" or something similar.

      Andy Paicu

      Done

      Andy Paicu

      Comment added.

      The code seems to work as expected to me. It sets a `FocusTrigger` but not a `FocusType` so it will use the `FocusType::kNone` type which therefore passes the `HTMLPermissionElement::Focus` check (and `kNone` is the correct value according to the comment above).

      File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
      Line 12, Patchset 9:<permission tabindex="0" id="id1" type="geolocation">
      Mason Freed . resolved

      Perhaps also add a case for `type=invalid`?

      Andy Paicu

      Done

      Line 29, Patchset 9: test_driver.set_test_context(window.top);
      Mason Freed . resolved

      I'm not sure this is needed...?

      Andy Paicu

      Done

      Line 36, Patchset 9: assert_equals(document.activeElement, el,
      Mason Freed . resolved

      This is clicking on the `<span>`. I think you might want to click on the `<permission>` element?

      Andy Paicu

      `el` got re-initialized to element with id="id1" on line 28. For clarity I've moved this part a bit up.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Mason Freed
      • Thomas Nguyen
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 10
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 20:31:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 6, 2024, 5:24:14 PMMay 6
      to Andy Paicu, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

      Aaron Leventhal added 1 comment

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9: <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . unresolved

      Is there a default accessible name for these?
      It would be very unusual if we expected the author to use ARIA for it.

      Andy Paicu

      They do not have a default accessible name, can you give me an example of how this works for other elements (if possible, "button" since that is the closest to the permission element)? What should I implement/override and what is usually the convention when it comes to default accessible names?

      Aaron Leventhal

      An accessible name is a localized label, kind of like alt text if you had an image button. Imagine you cannot see the screen, but tab to the button. It would not be enough to hear "button". You would need to know what kind of button it is. An example might be "Camera permissions". You can also add a description field that provides more information, such as "Press to change whether this website has permission to use your camera.".

      A <button> does not need this, because it gets the name from the contents inside, such as <button>Feed the cat</button>.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andy Paicu
      • Mason Freed
      • Thomas Nguyen
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 21:24:02 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 6, 2024, 5:26:58 PMMay 6
      to Andy Paicu, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Mason Freed, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

      Aaron Leventhal added 1 comment

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9: <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . unresolved

      Is there a default accessible name for these?
      It would be very unusual if we expected the author to use ARIA for it.

      Andy Paicu

      They do not have a default accessible name, can you give me an example of how this works for other elements (if possible, "button" since that is the closest to the permission element)? What should I implement/override and what is usually the convention when it comes to default accessible names?

      Aaron Leventhal

      An accessible name is a localized label, kind of like alt text if you had an image button. Imagine you cannot see the screen, but tab to the button. It would not be enough to hear "button". You would need to know what kind of button it is. An example might be "Camera permissions". You can also add a description field that provides more information, such as "Press to change whether this website has permission to use your camera.".

      A <button> does not need this, because it gets the name from the contents inside, such as <button>Feed the cat</button>.

      Aaron Leventhal

      I imagine this feature will need to go through an a11y review -- put something you think is reasonable for the name/description for now.

      Gerrit-Comment-Date: Mon, 06 May 2024 21:26:48 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Mason Freed (Gerrit)

      unread,
      May 6, 2024, 7:00:51 PMMay 6
      to Andy Paicu, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal, Andy Paicu and Thomas Nguyen

      Mason Freed voted and added 6 comments

      Votes added by Mason Freed

      Code-Review+1

      6 comments

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

      More nits, but this LGTM.

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1514, Patchset 9: invalid_pepc->AccessibilityPerformAction(action_data);
      valid_pepc->AccessibilityPerformAction(action_data);
      Mason Freed . unresolved

      Even if `invalid_pepc` was focusable, this test would pass, since you focus them both right after each other. I think you would need to add more `ASSERT`s between these two calls to make sure.

      Andy Paicu

      I tested this with `HtmlPermissionElement::SupportsFocus` hardcoded to `return true` and the test failed because the waiter immediately returned after the first focus event for the invalid element. So the test does not currently pass if both elements are actually focusable.

      I agree that it's not the best but I don't really see how to improve it. There aren't any productive `ASSERT`s to put in between the 2 calls, because the focus event requires an async step in order to take effect. Before making the `WaitForNotification` call there won't be time for any element to become focused, so there's no point in checking the focus state. And there is no real way to wait for the focus event to *not* do anything on the `invalid_pepc` element, other than the somewhat brittle wait-for-a-fixed-amount-of-time approach.

      I'm happy to add any checks you suggest but I think that any such checks will be useless before a `WaitForNotification` call and they will pass regardless of the focus behavior of the `permission` element.

      Mason Freed

      I'm glad the test fails without the code change - thanks for verifying.

      Wouldn't this do it then?

      ```
      invalid_pepc->AccessibilityPerformAction(action_data);
      ASSERT_FALSE(waiter.WaitForNotification());
      ASSERT_FALSE(invalid_pepc->IsFocused());
      valid_pepc->AccessibilityPerformAction(action_data);
      ```

      I.e. make sure no notifications are returned after one spin of the run loop, and then verify that the element isn't focused. I think your point is that a single spin of the run loop might not be enough to catch the invalid element being focused, but at least you check one spin.

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Mason Freed

      Thanks! LGTM.

      File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
      Line 35, Patchset 10 (Latest): el = document.getElementById("id2");
      Mason Freed . unresolved

      nit: sorry that I missed the reassignment of `el` in the old patchset. But a suggestion to make this more readable and avoid some boilerplate:

      ```
      <permission tabindex="0" id="valid_permission_element" type="geolocation">
      <span tabindex="0" id="focusable_span">This is some text</span>
      <permission tabindex="0" id="invalid_permission_element" type="invalid">
      ```

      and then in code, you don't even need the `getElementById()` calls at all, since that's provided by the browser. You can just use the ids directly in code:

      ```
      focusable_span.focus();
      assert_equals(document.activeElement, focusable_span,
      "Other element should be focused");
      ```
      Line 42, Patchset 10 (Latest): assert_not_equals(document.activeElement, el,
      Mason Freed . unresolved

      So I'm guessing the behavior is that the `<body>` element is focused here, right? I think it'd be better to explicitly check the expectation, e.g. `assert_equals(document.activeElement, document.body);`.

      Line 51, Patchset 10 (Latest): assert_not_equals(document.activeElement, el,
      Mason Freed . unresolved

      ditto

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Andy Paicu
      • Thomas Nguyen
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 10
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Mon, 06 May 2024 23:00:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 7, 2024, 4:27:14 AMMay 7
      to Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal and Thomas Nguyen

      Andy Paicu added 5 comments

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1514, Patchset 9: invalid_pepc->AccessibilityPerformAction(action_data);
      valid_pepc->AccessibilityPerformAction(action_data);
      Mason Freed . resolved

      Even if `invalid_pepc` was focusable, this test would pass, since you focus them both right after each other. I think you would need to add more `ASSERT`s between these two calls to make sure.

      Andy Paicu

      I tested this with `HtmlPermissionElement::SupportsFocus` hardcoded to `return true` and the test failed because the waiter immediately returned after the first focus event for the invalid element. So the test does not currently pass if both elements are actually focusable.

      I agree that it's not the best but I don't really see how to improve it. There aren't any productive `ASSERT`s to put in between the 2 calls, because the focus event requires an async step in order to take effect. Before making the `WaitForNotification` call there won't be time for any element to become focused, so there's no point in checking the focus state. And there is no real way to wait for the focus event to *not* do anything on the `invalid_pepc` element, other than the somewhat brittle wait-for-a-fixed-amount-of-time approach.

      I'm happy to add any checks you suggest but I think that any such checks will be useless before a `WaitForNotification` call and they will pass regardless of the focus behavior of the `permission` element.

      Mason Freed

      I'm glad the test fails without the code change - thanks for verifying.

      Wouldn't this do it then?

      ```
      invalid_pepc->AccessibilityPerformAction(action_data);
      ASSERT_FALSE(waiter.WaitForNotification());
      ASSERT_FALSE(invalid_pepc->IsFocused());
      valid_pepc->AccessibilityPerformAction(action_data);
      ```

      I.e. make sure no notifications are returned after one spin of the run loop, and then verify that the element isn't focused. I think your point is that a single spin of the run loop might not be enough to catch the invalid element being focused, but at least you check one spin.

      Andy Paicu

      `WaitForNotification` will block until a notification is received (or the test times out). So that doesn't work. I've used `WaitForNotificationWithTimeout` instead to limit the time it needs to wait but this will increase the run-time of this test significantly every time.

      File third_party/blink/renderer/core/html/html_permission_element.cc
      Line 355, Patchset 6: if (params.type == mojom::blink::FocusType::kScript) {
      return;
      }
      Mason Freed . resolved
      Andy Paicu

      Done

      File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
      Line 35, Patchset 10: el = document.getElementById("id2");
      Mason Freed . resolved

      nit: sorry that I missed the reassignment of `el` in the old patchset. But a suggestion to make this more readable and avoid some boilerplate:

      ```
      <permission tabindex="0" id="valid_permission_element" type="geolocation">
      <span tabindex="0" id="focusable_span">This is some text</span>
      <permission tabindex="0" id="invalid_permission_element" type="invalid">
      ```

      and then in code, you don't even need the `getElementById()` calls at all, since that's provided by the browser. You can just use the ids directly in code:

      ```
      focusable_span.focus();
      assert_equals(document.activeElement, focusable_span,
      "Other element should be focused");
      ```
      Andy Paicu

      Excellent suggestion, thank you.

      Line 42, Patchset 10: assert_not_equals(document.activeElement, el,
      Mason Freed . resolved

      So I'm guessing the behavior is that the `<body>` element is focused here, right? I think it'd be better to explicitly check the expectation, e.g. `assert_equals(document.activeElement, document.body);`.

      Andy Paicu

      Done

      Line 51, Patchset 10: assert_not_equals(document.activeElement, el,
      Mason Freed . resolved

      ditto

      Andy Paicu

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Thomas Nguyen
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 11
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Tue, 07 May 2024 08:27:01 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 7, 2024, 4:39:22 AMMay 7
      to Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal and Thomas Nguyen

      Andy Paicu added 1 comment

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9: <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . unresolved

      Is there a default accessible name for these?
      It would be very unusual if we expected the author to use ARIA for it.

      Andy Paicu

      They do not have a default accessible name, can you give me an example of how this works for other elements (if possible, "button" since that is the closest to the permission element)? What should I implement/override and what is usually the convention when it comes to default accessible names?

      Aaron Leventhal

      An accessible name is a localized label, kind of like alt text if you had an image button. Imagine you cannot see the screen, but tab to the button. It would not be enough to hear "button". You would need to know what kind of button it is. An example might be "Camera permissions". You can also add a description field that provides more information, such as "Press to change whether this website has permission to use your camera.".

      A <button> does not need this, because it gets the name from the contents inside, such as <button>Feed the cat</button>.

      Aaron Leventhal

      I imagine this feature will need to go through an a11y review -- put something you think is reasonable for the name/description for now.

      Andy Paicu

      Ah I see, the <permission> element has an internal span with text which is hard-set by the renderer [1]. So on focus the screen reader reads the text which is the action the button will trigger. Example text depending on permission status and type: "Use Camera" or "Share location". This is what is read out when the user focuses the permission element.

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_permission_element.cc;l=756;drc=64d81c6bd0aa2132c451b8a0e861e56d1ce3a221;bpv=1;bpt=1

      Gerrit-Comment-Date: Tue, 07 May 2024 08:39:09 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
      Comment-In-Reply-To: Aaron Leventhal <aleve...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 7, 2024, 11:13:27 AMMay 7
      to Andy Paicu, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu and Thomas Nguyen

      Aaron Leventhal added 1 comment

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9: <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . unresolved

      Is there a default accessible name for these?
      It would be very unusual if we expected the author to use ARIA for it.

      Andy Paicu

      They do not have a default accessible name, can you give me an example of how this works for other elements (if possible, "button" since that is the closest to the permission element)? What should I implement/override and what is usually the convention when it comes to default accessible names?

      Aaron Leventhal

      An accessible name is a localized label, kind of like alt text if you had an image button. Imagine you cannot see the screen, but tab to the button. It would not be enough to hear "button". You would need to know what kind of button it is. An example might be "Camera permissions". You can also add a description field that provides more information, such as "Press to change whether this website has permission to use your camera.".

      A <button> does not need this, because it gets the name from the contents inside, such as <button>Feed the cat</button>.

      Aaron Leventhal

      I imagine this feature will need to go through an a11y review -- put something you think is reasonable for the name/description for now.

      Andy Paicu

      Ah I see, the <permission> element has an internal span with text which is hard-set by the renderer [1]. So on focus the screen reader reads the text which is the action the button will trigger. Example text depending on permission status and type: "Use Camera" or "Share location". This is what is read out when the user focuses the permission element.

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_permission_element.cc;l=756;drc=64d81c6bd0aa2132c451b8a0e861e56d1ce3a221;bpv=1;bpt=1

      Aaron Leventhal

      Does that show up as the accessible name of the button? A dump tree test is easy to do. Feel free to ping me if you want any hints.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andy Paicu
      • Thomas Nguyen
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Tue, 07 May 2024 15:13:14 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 7, 2024, 3:37:13 PMMay 7
      to Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal, Mason Freed and Thomas Nguyen

      Andy Paicu added 1 comment

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9: <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . unresolved

      Is there a default accessible name for these?
      It would be very unusual if we expected the author to use ARIA for it.

      Andy Paicu

      They do not have a default accessible name, can you give me an example of how this works for other elements (if possible, "button" since that is the closest to the permission element)? What should I implement/override and what is usually the convention when it comes to default accessible names?

      Aaron Leventhal

      An accessible name is a localized label, kind of like alt text if you had an image button. Imagine you cannot see the screen, but tab to the button. It would not be enough to hear "button". You would need to know what kind of button it is. An example might be "Camera permissions". You can also add a description field that provides more information, such as "Press to change whether this website has permission to use your camera.".

      A <button> does not need this, because it gets the name from the contents inside, such as <button>Feed the cat</button>.

      Aaron Leventhal

      I imagine this feature will need to go through an a11y review -- put something you think is reasonable for the name/description for now.

      Andy Paicu

      Ah I see, the <permission> element has an internal span with text which is hard-set by the renderer [1]. So on focus the screen reader reads the text which is the action the button will trigger. Example text depending on permission status and type: "Use Camera" or "Share location". This is what is read out when the user focuses the permission element.

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_permission_element.cc;l=756;drc=64d81c6bd0aa2132c451b8a0e861e56d1ce3a221;bpv=1;bpt=1

      Aaron Leventhal

      Does that show up as the accessible name of the button? A dump tree test is easy to do. Feel free to ping me if you want any hints.

      Andy Paicu

      I've added the dump tree test, though it's not clear to me what should show up, and whether this answers the question or not. PTAL?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Mason Freed
      • Thomas Nguyen
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 12
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Tue, 07 May 2024 19:37:00 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 7, 2024, 6:08:30 PMMay 7
      to Andy Paicu, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

      Aaron Leventhal added 1 comment

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9: <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . unresolved

      Is there a default accessible name for these?
      It would be very unusual if we expected the author to use ARIA for it.

      Andy Paicu

      They do not have a default accessible name, can you give me an example of how this works for other elements (if possible, "button" since that is the closest to the permission element)? What should I implement/override and what is usually the convention when it comes to default accessible names?

      Aaron Leventhal

      An accessible name is a localized label, kind of like alt text if you had an image button. Imagine you cannot see the screen, but tab to the button. It would not be enough to hear "button". You would need to know what kind of button it is. An example might be "Camera permissions". You can also add a description field that provides more information, such as "Press to change whether this website has permission to use your camera.".

      A <button> does not need this, because it gets the name from the contents inside, such as <button>Feed the cat</button>.

      Aaron Leventhal

      I imagine this feature will need to go through an a11y review -- put something you think is reasonable for the name/description for now.

      Andy Paicu

      Ah I see, the <permission> element has an internal span with text which is hard-set by the renderer [1]. So on focus the screen reader reads the text which is the action the button will trigger. Example text depending on permission status and type: "Use Camera" or "Share location". This is what is read out when the user focuses the permission element.

      [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_permission_element.cc;l=756;drc=64d81c6bd0aa2132c451b8a0e861e56d1ce3a221;bpv=1;bpt=1

      Aaron Leventhal

      Does that show up as the accessible name of the button? A dump tree test is easy to do. Feel free to ping me if you want any hints.

      Andy Paicu

      I've added the dump tree test, though it's not clear to me what should show up, and whether this answers the question or not. PTAL?

      Aaron Leventhal

      For the dump tree test, you need to add two more files:

      1. HTMK source with a bunch of examples of permission elements in a minimal html file:
      content/test/data/accessibility/html/permission.html
      2. The expectations. At first, just create an empty text file:
      content/test/data/accessibility/html/permission-expected-blink.txt

      Locally, you will run the content_browsertest called All/DumpAccessibilityEventsTest.AccessibilityPermission/blink
      and there will be a section with expected results -- paste that into the permission-expected-blink.txt.

      Finally upload them to your change and I'll take a look

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andy Paicu
      • Mason Freed
      • Thomas Nguyen
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Tue, 07 May 2024 22:08:19 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 8, 2024, 3:14:16 AMMay 8
      to Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal, Mason Freed and Thomas Nguyen

      Andy Paicu added 1 comment

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Andy Paicu

      Oops, I somehow did not include the new files into the upload. PTAL now.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Mason Freed
      • Thomas Nguyen
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 13
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Wed, 08 May 2024 07:14:07 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 8, 2024, 7:31:10 AMMay 8
      to Andy Paicu, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

      Aaron Leventhal added 1 comment

      File content/test/data/accessibility/html/permission-expected-blink.txt
      Line 3, Patchset 13 (Latest):++++genericContainer
      Aaron Leventhal . unresolved

      The button is missing from this output. That probably means it was marked ignored by AXNodeObject::ComputeAccessibilityIsIgnored().

      It should have been included because if this line in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/accessibility/ax_node_object.cc;l=753

      ```
      // All focusable elements except the <body> and <html> are included.
      if (!IsA<HTMLBodyElement>(node) && CanSetFocusAttribute())
      return kIncludeObject;
      ```
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andy Paicu
      • Mason Freed
      • Thomas Nguyen
      Gerrit-Attention: Andy Paicu <andy...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Wed, 08 May 2024 11:30:55 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 8, 2024, 7:32:38 AMMay 8
      to Andy Paicu, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

      Aaron Leventhal added 1 comment

      File content/test/data/accessibility/html/permission.html
      Line 3, Patchset 13 (Latest):<permission type="camera">
      Aaron Leventhal . unresolved

      May as well put all the different permission types in this test.

      Gerrit-Comment-Date: Wed, 08 May 2024 11:32:24 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Andy Paicu (Gerrit)

      unread,
      May 8, 2024, 10:46:03 AMMay 8
      to Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Aaron Leventhal, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Aaron Leventhal, Mason Freed and Thomas Nguyen

      Andy Paicu added 3 comments

      File content/browser/accessibility/accessibility_action_browsertest.cc
      Line 1496, Patchset 9: <permission type="invalid" aria-label="invalid-pepc">
      Aaron Leventhal . resolved
      Andy Paicu

      Done

      File content/test/data/accessibility/html/permission-expected-blink.txt
      Line 3, Patchset 13:++++genericContainer
      Aaron Leventhal . resolved

      The button is missing from this output. That probably means it was marked ignored by AXNodeObject::ComputeAccessibilityIsIgnored().

      It should have been included because if this line in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/accessibility/ax_node_object.cc;l=753

      ```
      // All focusable elements except the <body> and <html> are included.
      if (!IsA<HTMLBodyElement>(node) && CanSetFocusAttribute())
      return kIncludeObject;
      ```
      Andy Paicu

      D'oh... I just forgot to enable the feature in this test.

      File content/test/data/accessibility/html/permission.html
      Line 3, Patchset 13:<permission type="camera">
      Aaron Leventhal . resolved

      May as well put all the different permission types in this test.

      Andy Paicu

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      • Mason Freed
      • Thomas Nguyen
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
      Gerrit-Change-Number: 5463501
      Gerrit-PatchSet: 14
      Gerrit-Owner: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
      Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
      Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
      Gerrit-Comment-Date: Wed, 08 May 2024 14:45:50 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      May 8, 2024, 11:51:28 AMMay 8
      to Andy Paicu, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
      Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

      Aaron Leventhal added 2 comments

      Patchset-level comments
      File-level comment, Patchset 14 (Latest):
      Aaron Leventhal . resolved

      +1 with one request.

      File content/test/data/accessibility/html/permission-expected-blink.txt
      Line 3, Patchset 14 (Latest):++++genericContainer
      Aaron Leventhal . unresolved

      This looks good. However, let's put this at the top so that we can ensure these are focusable. You'll have to update the expectations after.
      <!--
      @BLINK-ALLOW:focusable*
      -->

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Andy Paicu
      • Mason Freed
      • Thomas Nguyen
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
        Gerrit-Change-Number: 5463501
        Gerrit-PatchSet: 14
        Gerrit-Owner: Andy Paicu <andy...@chromium.org>
        Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
        Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
        Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
        Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
        Gerrit-Attention: Andy Paicu <andy...@chromium.org>
        Gerrit-Attention: Mason Freed <mas...@chromium.org>
        Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
        Gerrit-Comment-Date: Wed, 08 May 2024 15:51:14 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Aaron Leventhal (Gerrit)

        unread,
        May 8, 2024, 11:51:34 AMMay 8
        to Andy Paicu, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
        Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

        Aaron Leventhal voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Andy Paicu
        • Mason Freed
        • Thomas Nguyen
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Review
        Gerrit-Comment-Date: Wed, 08 May 2024 15:51:20 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Aaron Leventhal (Gerrit)

        unread,
        May 8, 2024, 12:00:40 PMMay 8
        to Andy Paicu, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
        Attention needed from Andy Paicu, Mason Freed and Thomas Nguyen

        Aaron Leventhal added 1 comment

        File content/test/data/accessibility/html/permission-expected-blink.txt
        Line 3, Patchset 14 (Latest):++++genericContainer
        Aaron Leventhal . unresolved

        This looks good. However, let's put this at the top so that we can ensure these are focusable. You'll have to update the expectations after.
        <!--
        @BLINK-ALLOW:focusable*
        -->

        Aaron Leventhal

        (Note: it goes at the top of the .html).

        Gerrit-Comment-Date: Wed, 08 May 2024 16:00:22 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Aaron Leventhal <aleve...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Andy Paicu (Gerrit)

        unread,
        May 8, 2024, 2:47:26 PMMay 8
        to Aaron Leventhal, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
        Attention needed from Mason Freed and Thomas Nguyen

        Andy Paicu added 2 comments

        Patchset-level comments
        File-level comment, Patchset 15 (Latest):
        Andy Paicu . resolved

        Thank you Aaron for helping me with the a11y part of it.

        Mason, Thomas PTAL (the +1s got lost).

        File content/test/data/accessibility/html/permission-expected-blink.txt
        Line 3, Patchset 14:++++genericContainer
        Aaron Leventhal . resolved

        This looks good. However, let's put this at the top so that we can ensure these are focusable. You'll have to update the expectations after.
        <!--
        @BLINK-ALLOW:focusable*
        -->

        Aaron Leventhal

        (Note: it goes at the top of the .html).

        Andy Paicu

        Done. Assuming I'm not reading it incorrectly the element is focusable as expected.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Mason Freed
        • Thomas Nguyen
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I1fe10d3315120f03accfc99b518bef971ecd2947
        Gerrit-Change-Number: 5463501
        Gerrit-PatchSet: 15
        Gerrit-Owner: Andy Paicu <andy...@chromium.org>
        Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
        Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
        Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
        Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
        Gerrit-Attention: Mason Freed <mas...@chromium.org>
        Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
        Gerrit-Comment-Date: Wed, 08 May 2024 18:47:12 +0000
        satisfied_requirement
        open
        diffy

        Mason Freed (Gerrit)

        unread,
        May 8, 2024, 6:44:55 PMMay 8
        to Andy Paicu, Aaron Leventhal, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Thomas Nguyen, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
        Attention needed from Andy Paicu and Thomas Nguyen

        Mason Freed voted and added 2 comments

        Votes added by Mason Freed

        Code-Review+1

        2 comments

        File content/browser/accessibility/accessibility_action_browsertest.cc
        Line 1514, Patchset 9: invalid_pepc->AccessibilityPerformAction(action_data);
        valid_pepc->AccessibilityPerformAction(action_data);
        Mason Freed . resolved

        Even if `invalid_pepc` was focusable, this test would pass, since you focus them both right after each other. I think you would need to add more `ASSERT`s between these two calls to make sure.

        Andy Paicu

        I tested this with `HtmlPermissionElement::SupportsFocus` hardcoded to `return true` and the test failed because the waiter immediately returned after the first focus event for the invalid element. So the test does not currently pass if both elements are actually focusable.

        I agree that it's not the best but I don't really see how to improve it. There aren't any productive `ASSERT`s to put in between the 2 calls, because the focus event requires an async step in order to take effect. Before making the `WaitForNotification` call there won't be time for any element to become focused, so there's no point in checking the focus state. And there is no real way to wait for the focus event to *not* do anything on the `invalid_pepc` element, other than the somewhat brittle wait-for-a-fixed-amount-of-time approach.

        I'm happy to add any checks you suggest but I think that any such checks will be useless before a `WaitForNotification` call and they will pass regardless of the focus behavior of the `permission` element.

        Mason Freed

        I'm glad the test fails without the code change - thanks for verifying.

        Wouldn't this do it then?

        ```
        invalid_pepc->AccessibilityPerformAction(action_data);
        ASSERT_FALSE(waiter.WaitForNotification());
        ASSERT_FALSE(invalid_pepc->IsFocused());
        valid_pepc->AccessibilityPerformAction(action_data);
        ```

        I.e. make sure no notifications are returned after one spin of the run loop, and then verify that the element isn't focused. I think your point is that a single spin of the run loop might not be enough to catch the invalid element being focused, but at least you check one spin.

        Andy Paicu

        `WaitForNotification` will block until a notification is received (or the test times out). So that doesn't work. I've used `WaitForNotificationWithTimeout` instead to limit the time it needs to wait but this will increase the run-time of this test significantly every time.

        Mason Freed

        Thanks for adding this with the timeout.

        File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
        Line 39, Patchset 15 (Latest): assert_not_equals(document.activeElement, invalid_permission_element,
        Mason Freed . unresolved

        Can't this one also be `assert_equals(..,body)`?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Andy Paicu
        • Thomas Nguyen
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • 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: I1fe10d3315120f03accfc99b518bef971ecd2947
          Gerrit-Change-Number: 5463501
          Gerrit-PatchSet: 15
          Gerrit-Owner: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
          Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
          Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
          Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
          Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
          Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
          Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
          Gerrit-Attention: Andy Paicu <andy...@chromium.org>
          Gerrit-Attention: Thomas Nguyen <tun...@chromium.org>
          Gerrit-Comment-Date: Wed, 08 May 2024 22:44:42 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
          Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Thomas Nguyen (Gerrit)

          unread,
          May 9, 2024, 4:35:28 AMMay 9
          to Andy Paicu, Mason Freed, Aaron Leventhal, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org
          Attention needed from Andy Paicu

          Thomas Nguyen voted Code-Review+1

          Code-Review+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Andy Paicu
          Gerrit-Comment-Date: Thu, 09 May 2024 08:35:12 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Andy Paicu (Gerrit)

          unread,
          May 9, 2024, 5:15:32 AMMay 9
          to Thomas Nguyen, Mason Freed, Aaron Leventhal, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org

          Andy Paicu voted and added 2 comments

          Votes added by Andy Paicu

          Commit-Queue+2

          2 comments

          Patchset-level comments
          File-level comment, Patchset 16 (Latest):
          Andy Paicu . resolved

          Thank you all

          File third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
          Line 39, Patchset 15: assert_not_equals(document.activeElement, invalid_permission_element,
          Mason Freed . resolved

          Can't this one also be `assert_equals(..,body)`?

          Andy Paicu

          Good catch, missed this one.

          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement 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: I1fe10d3315120f03accfc99b518bef971ecd2947
          Gerrit-Change-Number: 5463501
          Gerrit-PatchSet: 16
          Gerrit-Owner: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
          Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
          Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
          Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
          Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
          Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
          Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
          Gerrit-Comment-Date: Thu, 09 May 2024 09:15:15 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
          satisfied_requirement
          open
          diffy

          Andy Paicu (Gerrit)

          unread,
          May 9, 2024, 7:14:15 AMMay 9
          to Thomas Nguyen, Mason Freed, Aaron Leventhal, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Blink W3C Test Autoroller, Chromium LUCI CQ, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org

          Andy Paicu voted Commit-Queue+2

          Commit-Queue+2
          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement 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: I1fe10d3315120f03accfc99b518bef971ecd2947
          Gerrit-Change-Number: 5463501
          Gerrit-PatchSet: 18
          Gerrit-Owner: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
          Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
          Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
          Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
          Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
          Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
          Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
          Gerrit-Comment-Date: Thu, 09 May 2024 11:14:03 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          May 9, 2024, 8:07:17 AMMay 9
          to Andy Paicu, Thomas Nguyen, Mason Freed, Aaron Leventhal, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, Akihiro Ota, AyeAye, Blink W3C Test Autoroller, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org

          Chromium LUCI CQ submitted the change with unreviewed changes

          Unreviewed changes

          15 is the latest approved patch-set.
          The change was submitted with unreviewed changes in the following files:

          ```
          The name of the file: third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
          Insertions: 1, Deletions: 1.

          The diff is too large to show. Please review the diff.
          ```
          ```
          The name of the file: chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc
          Insertions: 139, Deletions: 15.

          The diff is too large to show. Please review the diff.
          ```

          Change information

          Commit message:
          [PEPC] Disable focusing via script

          The PEPC element should not be able to focused via the `focus()`
          function since it can be abused for obtaining unintentional clicks by
          focusing the element at unexpected times.
          Change-Id: I1fe10d3315120f03accfc99b518bef971ecd2947
          Fixed: 335834885
          Reviewed-by: Mason Freed <mas...@chromium.org>
          Reviewed-by: Aaron Leventhal <aleve...@chromium.org>
          Commit-Queue: Andy Paicu <andy...@chromium.org>
          Reviewed-by: Thomas Nguyen <tun...@chromium.org>
          Cr-Commit-Position: refs/heads/main@{#1298585}
          Files:
          • M chrome/browser/ui/views/permissions/embedded_permission_prompt_interactive_uitest.cc
          • M chrome/test/data/permissions/permission_element.html
          • M content/browser/accessibility/accessibility_action_browsertest.cc
          • M content/browser/accessibility/dump_accessibility_tree_browsertest.cc
          • M content/test/content_test_bundle_data.filelist
          • A content/test/data/accessibility/html/permission-expected-blink.txt
          • A content/test/data/accessibility/html/permission.html
          • M third_party/blink/renderer/core/html/html_permission_element.cc
          • M third_party/blink/renderer/core/html/html_permission_element.h
          • M third_party/blink/renderer/modules/accessibility/ax_node_object.cc
          • A third_party/blink/web_tests/external/wpt/html/semantics/permission-element/no-focus.tentative.html
          Change size: M
          Delta: 11 files changed, 208 insertions(+), 5 deletions(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Aaron Leventhal, +1 by Mason Freed, +1 by Thomas Nguyen
          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: I1fe10d3315120f03accfc99b518bef971ecd2947
          Gerrit-Change-Number: 5463501
          Gerrit-PatchSet: 19
          Gerrit-Owner: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
          Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
          Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
          Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
          Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
          open
          diffy
          satisfied_requirement

          Blink W3C Test Autoroller (Gerrit)

          unread,
          May 9, 2024, 8:37:42 AMMay 9
          to Andy Paicu, Chromium LUCI CQ, Thomas Nguyen, Mason Freed, Aaron Leventhal, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org

          Message from Blink W3C Test Autoroller

          The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/45766

          Open in Gerrit

          Related details

          Attention set is empty
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement 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: I1fe10d3315120f03accfc99b518bef971ecd2947
          Gerrit-Change-Number: 5463501
          Gerrit-PatchSet: 19
          Gerrit-Owner: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Aaron Leventhal <aleve...@chromium.org>
          Gerrit-Reviewer: Andy Paicu <andy...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Thomas Nguyen <tun...@chromium.org>
          Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
          Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
          Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
          Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
          Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
          Gerrit-Comment-Date: Thu, 09 May 2024 12:37:31 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: No
          satisfied_requirement
          open
          diffy

          Aaron Leventhal (Gerrit)

          unread,
          May 9, 2024, 11:07:37 AMMay 9
          to Andy Paicu, Chromium LUCI CQ, Thomas Nguyen, Mason Freed, Nektarios Paisios, Kevin Babbitt, (Julie)Jeongeun Kim, AyeAye, Blink W3C Test Autoroller, chromium...@chromium.org, nektar...@chromium.org, josiah...@chromium.org, aleventhal...@chromium.org, dtseng...@chromium.org, blink-rev...@chromium.org, kyungjunle...@google.com, hirokisa...@chromium.org, yuzo+...@chromium.org, abigailbk...@google.com, francisjp...@google.com, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blundell+...@chromium.org

          Aaron Leventhal added 1 comment

          File content/test/data/accessibility/html/permission-expected-blink.txt
          Line 3, Patchset 14:++++genericContainer
          Aaron Leventhal . resolved

          This looks good. However, let's put this at the top so that we can ensure these are focusable. You'll have to update the expectations after.
          <!--
          @BLINK-ALLOW:focusable*
          -->

          Aaron Leventhal

          (Note: it goes at the top of the .html).

          Andy Paicu

          Done. Assuming I'm not reading it incorrectly the element is focusable as expected.

          Aaron Leventhal

          Looks great!

          I'll be interested to see what comes up with the button is activated. Were you asked to go through any kind of a11y review process? Maybe I reviewed an early version of the plans, it sounds familiar.

          As I understand it, this will be a very good thing for low vision users who are zoomed in, because the UI for activating the permission won't be far away from the page feature/activity that needed it. But we should do a great job on the UI for all the disability types. LMK if we need to hook you up with our a11y analyst team for a review whenever you're ready.

          Gerrit-Comment-Date: Thu, 09 May 2024 15:07:22 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Andy Paicu <andy...@chromium.org>
          Comment-In-Reply-To: Aaron Leventhal <aleve...@chromium.org>
          satisfied_requirement
          open
          diffy
          Reply all
          Reply to author
          Forward
          0 new messages