Skip to content

Fixes to delegatesFocus - #7079

Merged
domenic merged 2 commits into
mainfrom
delegatesfocus-blur
Nov 1, 2021
Merged

domenic merged 2 commits into
mainfrom
delegatesfocus-blur

Conversation

@domenic

@domenic domenic commented Sep 16, 2021 •

Copy link
Copy Markdown
Member

@domenic domenic added topic: shadow Relates to shadow trees (as defined in DOM) topic: focus Focus, sequential focus navigation, tabindex, autofocus and inert labels Sep 16, 2021
@domenic
domenic requested a review from emilio September 16, 2021 20:54

@emilio emilio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the bit below, it looks good, thank you!

I think this should probably be before the inert check. It seems more consistent with https://html.spec.whatwg.org/#get-the-focusable-area (since an inert shadow host still delegates focus to a potentially non-inert child, afaict).

I also think we might want to move the <area> special-case before the inert case, for consistency as well, though that's another normative change (as unlikely to matter as it is). It'd be nice to put this step after the area special-case, for symmetry with "get the focusable area" (though I don't think it matters because neither <area> not <a> can be shadow hosts).

Comment thread source Resolved
@sefeng211

Copy link
Copy Markdown
Contributor

(Chrome passes the test written)

Comment thread source Resolved
* Make it use the shadow tree instead of the flat tree. Closes #7207.
* Make it work with the unfocusing steps symmetrically to the focusing steps. Closes #7070.
@domenic
domenic force-pushed the delegatesfocus-blur branch from 9c5c4af to 8615199 Compare October 28, 2021 19:35
@domenic domenic changed the title Make unfocusing steps work well with delegatesFocus Fixes to delegatesFocus Oct 28, 2021
@domenic

domenic commented Oct 28, 2021

Copy link
Copy Markdown
Member Author

@emilio, can I get a re-review? I update this PR to also include the flat tree changes.

@emilio emilio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@domenic

domenic commented Oct 28, 2021

Copy link
Copy Markdown
Member Author

OK, now I need a green checkmark, so @annevk? :)

Comment thread source Outdated
Comment on lines +75067 to +75069
<li><p>Return the first <span>focusable area</span> in <span>shadow-including tree
order</span> of who their <span data-x="DOM anchor">DOM anchors</span> are in <var>possible
focus delegates</var>, or null if <var>possible focus delegates</var> is empty.</p></li>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should this be "... tree order whose DOM anchor is in ..."?

@domenic domenic Nov 1, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well tree order needs to apply to DOM anchor... but yeah the current phrasing is weird. Will fix.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the intent of the current phrasing now. It's "Return the first focusable area, in shadow-including tree order of who their DOM anchors are, in possible focus delegates."

This is just too confusing though. I will add an explicit sorting step so as to avoid the very long sentence with too many clauses that step on each other in confusing ways.

@domenic
domenic merged commit 9ba7124 into main Nov 1, 2021
@domenic
domenic deleted the delegatesfocus-blur branch November 1, 2021 15:51
@domenic domenic mentioned this pull request Nov 1, 2021
3 tasks done
@domenic domenic mentioned this pull request Nov 23, 2021
3 tasks done
@domenic domenic mentioned this pull request Aug 9, 2022
3 tasks done
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 17, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Bug: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
domenic added a commit that referenced this pull request Oct 22, 2022
Fixes #8156. Fixes #8157.

See also previous work in #7361, #7284, and #7079.
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 27, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Bug: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 27, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 29, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 31, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 1, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 1, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 3, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 4, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 5, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067796}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 5, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067796}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 5, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067796}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 7, 2022
This reverts commit afeccd1f5b2dd72595abe55bc9ef093f11b495f1.

Reason for revert: dialog-focus-shadow.html is failing on a couple of mac builders:

https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/57992/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/28597/overview

Original change's description:
> Implement new dialog shadow focus behavior
>
> This implements the new dialog initial focus behavior specified in these
> changes:
> whatwg/html#7079
> whatwg/html#7284
> whatwg/html#7361
> whatwg/html#8174
>
> The gist of the changes are:
> 1. Use the DOM tree instead of the flat tree to search for an element to
>    give initial focus.
> 2. Don't traverse into shadow roots when looking for elements to give
>    initial focus unless the shadow root has delegatesFocus.
>
> This will stay experimental until I have also made the other changes for
> dialog initial focus: whatwg/html#8199
> After those changes have been made as well, I will carefully enable the
> flag by default.
>
> Fixed: 383230, 670130, 1292852
> Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
> Reviewed-by: Mason Freed <[email protected]>
> Commit-Queue: Joey Arhar <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1067796}

Change-Id: I010be9a77fd8c289edb8c028355182d0fe7dec39
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 7, 2022
This reverts commit afeccd1.

Reason for revert: dialog-focus-shadow.html is failing on a couple of mac builders:

https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/57992/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/28597/overview

Original change's description:
> Implement new dialog shadow focus behavior
>
> This implements the new dialog initial focus behavior specified in these
> changes:
> whatwg/html#7079
> whatwg/html#7284
> whatwg/html#7361
> whatwg/html#8174
>
> The gist of the changes are:
> 1. Use the DOM tree instead of the flat tree to search for an element to
>    give initial focus.
> 2. Don't traverse into shadow roots when looking for elements to give
>    initial focus unless the shadow root has delegatesFocus.
>
> This will stay experimental until I have also made the other changes for
> dialog initial focus: whatwg/html#8199
> After those changes have been made as well, I will carefully enable the
> flag by default.
>
> Fixed: 383230, 670130, 1292852
> Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
> Reviewed-by: Mason Freed <[email protected]>
> Commit-Queue: Joey Arhar <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1067796}

Change-Id: I010be9a77fd8c289edb8c028355182d0fe7dec39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4005547
Commit-Queue: Tim Sergeant <[email protected]>
Commit-Queue: Rubber Stamper <[email protected]>
Auto-Submit: Tim Sergeant <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Owners-Override: Tim Sergeant <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067950}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 7, 2022
This reverts commit afeccd1f5b2dd72595abe55bc9ef093f11b495f1.

Reason for revert: dialog-focus-shadow.html is failing on a couple of mac builders:

https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/57992/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/28597/overview

Original change's description:
> Implement new dialog shadow focus behavior
>
> This implements the new dialog initial focus behavior specified in these
> changes:
> whatwg/html#7079
> whatwg/html#7284
> whatwg/html#7361
> whatwg/html#8174
>
> The gist of the changes are:
> 1. Use the DOM tree instead of the flat tree to search for an element to
>    give initial focus.
> 2. Don't traverse into shadow roots when looking for elements to give
>    initial focus unless the shadow root has delegatesFocus.
>
> This will stay experimental until I have also made the other changes for
> dialog initial focus: whatwg/html#8199
> After those changes have been made as well, I will carefully enable the
> flag by default.
>
> Fixed: 383230, 670130, 1292852
> Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
> Reviewed-by: Mason Freed <[email protected]>
> Commit-Queue: Joey Arhar <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1067796}

Change-Id: I010be9a77fd8c289edb8c028355182d0fe7dec39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4005547
Commit-Queue: Tim Sergeant <[email protected]>
Commit-Queue: Rubber Stamper <[email protected]>
Auto-Submit: Tim Sergeant <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Owners-Override: Tim Sergeant <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067950}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 7, 2022
This reverts commit afeccd1f5b2dd72595abe55bc9ef093f11b495f1.

Reason for revert: dialog-focus-shadow.html is failing on a couple of mac builders:

https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/57992/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/28597/overview

Original change's description:
> Implement new dialog shadow focus behavior
>
> This implements the new dialog initial focus behavior specified in these
> changes:
> whatwg/html#7079
> whatwg/html#7284
> whatwg/html#7361
> whatwg/html#8174
>
> The gist of the changes are:
> 1. Use the DOM tree instead of the flat tree to search for an element to
>    give initial focus.
> 2. Don't traverse into shadow roots when looking for elements to give
>    initial focus unless the shadow root has delegatesFocus.
>
> This will stay experimental until I have also made the other changes for
> dialog initial focus: whatwg/html#8199
> After those changes have been made as well, I will carefully enable the
> flag by default.
>
> Fixed: 383230, 670130, 1292852
> Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
> Reviewed-by: Mason Freed <[email protected]>
> Commit-Queue: Joey Arhar <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1067796}

Change-Id: I010be9a77fd8c289edb8c028355182d0fe7dec39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4005547
Commit-Queue: Tim Sergeant <[email protected]>
Commit-Queue: Rubber Stamper <[email protected]>
Auto-Submit: Tim Sergeant <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Owners-Override: Tim Sergeant <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067950}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 7, 2022
This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: If024ab0f22716c55b439e44b2298e39897ee844e
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 12, 2022
…or, a=testonly

Automatic update from web-platform-tests
Implement new dialog shadow focus behavior

This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067796}

--

wpt-commits: e1d2b674fbcc1ca01eccb624fdd758c38f3407a7
wpt-pr: 36498
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 12, 2022
…s behavior", a=testonly

Automatic update from web-platform-tests
Revert "Implement new dialog shadow focus behavior"

This reverts commit afeccd1f5b2dd72595abe55bc9ef093f11b495f1.

Reason for revert: dialog-focus-shadow.html is failing on a couple of mac builders:

https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/57992/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/28597/overview

Original change's description:
> Implement new dialog shadow focus behavior
>
> This implements the new dialog initial focus behavior specified in these
> changes:
> whatwg/html#7079
> whatwg/html#7284
> whatwg/html#7361
> whatwg/html#8174
>
> The gist of the changes are:
> 1. Use the DOM tree instead of the flat tree to search for an element to
>    give initial focus.
> 2. Don't traverse into shadow roots when looking for elements to give
>    initial focus unless the shadow root has delegatesFocus.
>
> This will stay experimental until I have also made the other changes for
> dialog initial focus: whatwg/html#8199
> After those changes have been made as well, I will carefully enable the
> flag by default.
>
> Fixed: 383230, 670130, 1292852
> Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
> Reviewed-by: Mason Freed <[email protected]>
> Commit-Queue: Joey Arhar <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1067796}

Change-Id: I010be9a77fd8c289edb8c028355182d0fe7dec39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4005547
Commit-Queue: Tim Sergeant <[email protected]>
Commit-Queue: Rubber Stamper <[email protected]>
Auto-Submit: Tim Sergeant <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Owners-Override: Tim Sergeant <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067950}

--

wpt-commits: 011077556f5634fe685c613564c3325e77387462
wpt-pr: 36838
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Nov 14, 2022
…or, a=testonly

Automatic update from web-platform-tests
Implement new dialog shadow focus behavior

This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067796}

--

wpt-commits: e1d2b674fbcc1ca01eccb624fdd758c38f3407a7
wpt-pr: 36498
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Nov 14, 2022
…s behavior", a=testonly

Automatic update from web-platform-tests
Revert "Implement new dialog shadow focus behavior"

This reverts commit afeccd1f5b2dd72595abe55bc9ef093f11b495f1.

Reason for revert: dialog-focus-shadow.html is failing on a couple of mac builders:

https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/57992/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/28597/overview

Original change's description:
> Implement new dialog shadow focus behavior
>
> This implements the new dialog initial focus behavior specified in these
> changes:
> whatwg/html#7079
> whatwg/html#7284
> whatwg/html#7361
> whatwg/html#8174
>
> The gist of the changes are:
> 1. Use the DOM tree instead of the flat tree to search for an element to
>    give initial focus.
> 2. Don't traverse into shadow roots when looking for elements to give
>    initial focus unless the shadow root has delegatesFocus.
>
> This will stay experimental until I have also made the other changes for
> dialog initial focus: whatwg/html#8199
> After those changes have been made as well, I will carefully enable the
> flag by default.
>
> Fixed: 383230, 670130, 1292852
> Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
> Reviewed-by: Mason Freed <[email protected]>
> Commit-Queue: Joey Arhar <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1067796}

Change-Id: I010be9a77fd8c289edb8c028355182d0fe7dec39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4005547
Commit-Queue: Tim Sergeant <[email protected]>
Commit-Queue: Rubber Stamper <[email protected]>
Auto-Submit: Tim Sergeant <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Owners-Override: Tim Sergeant <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067950}

--

wpt-commits: 011077556f5634fe685c613564c3325e77387462
wpt-pr: 36838
Rinkubot pushed a commit to Rinkubot/Webkit that referenced this pull request Sep 3, 2025
    Update delegatesFocus to match recent spec changes
    https://bugs.webkit.org/show_bug.cgi?id=232564

    Reviewed by Darin Adler.

    Implemented the new behavior of focusDelegates and added the support for autofocus focus delegation.
    Also fixed a bug that an element with autofocus content attribute inside a shadow tree gets focus.

    See whatwg/html#7079

    * LayoutTests/fast/shadow-dom/autofocus-in-shadow-tree-autofocus-host-expected.txt: Added.
    * LayoutTests/fast/shadow-dom/autofocus-in-shadow-tree-autofocus-host.html: Added.
    * LayoutTests/fast/shadow-dom/autofocus-in-shadow-tree-expected.txt: Added.
    * LayoutTests/fast/shadow-dom/autofocus-in-shadow-tree.html: Added.
    * LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-020.html: Merge the test fix
    posted in web-platform-tests/wpt#35257.
    * LayoutTests/imported/w3c/web-platform-tests/shadow-dom/focus/focus-autofocus-expected.txt: Rebaselined.
    * LayoutTests/imported/w3c/web-platform-tests/shadow-dom/focus/focus-method-delegatesFocus-expected.txt: Ditto.

    * Source/WebCore/dom/Element.cpp:
    (WebCore::shouldAutofocus): Fixed the bug that this wasn't ignoring elements inside shadow trees.
    Autofocus attribute yields autofocus candidates if the relevant element is **inserted** into a document,
    not connected to it. See https://html.spec.whatwg.org/multipage/interaction.html#the-autofocus-attribute

    (WebCore::autoFocusDelegate): Added. This implements autofocus delegation mechanism for shadow root/host.

    (WebCore::focusDelegateFromShadowHost): Renamed from findFirstProgramaticallyFocusableElementInComposedTree
    and made it recursively traverse shadow trees instead of the composed/flat tree.

    (WebCore::Element::focus):

    Canonical link: https://commits.webkit.org/252901@main

Canonical link: https://commits.webkit.org/252432.292@safari-7614-branch
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…or, a=testonly

Automatic update from web-platform-tests
Implement new dialog shadow focus behavior

This implements the new dialog initial focus behavior specified in these
changes:
whatwg/html#7079
whatwg/html#7284
whatwg/html#7361
whatwg/html#8174

The gist of the changes are:
1. Use the DOM tree instead of the flat tree to search for an element to
   give initial focus.
2. Don't traverse into shadow roots when looking for elements to give
   initial focus unless the shadow root has delegatesFocus.

This will stay experimental until I have also made the other changes for
dialog initial focus: whatwg/html#8199
After those changes have been made as well, I will carefully enable the
flag by default.

Fixed: 383230, 670130, 1292852
Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Joey Arhar <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067796}

--

wpt-commits: e1d2b674fbcc1ca01eccb624fdd758c38f3407a7
wpt-pr: 36498
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…s behavior", a=testonly

Automatic update from web-platform-tests
Revert "Implement new dialog shadow focus behavior"

This reverts commit afeccd1f5b2dd72595abe55bc9ef093f11b495f1.

Reason for revert: dialog-focus-shadow.html is failing on a couple of mac builders:

https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.13%20Tests/57992/overview
https://ci.chromium.org/ui/p/chromium/builders/ci/Mac10.14%20Tests/28597/overview

Original change's description:
> Implement new dialog shadow focus behavior
>
> This implements the new dialog initial focus behavior specified in these
> changes:
> whatwg/html#7079
> whatwg/html#7284
> whatwg/html#7361
> whatwg/html#8174
>
> The gist of the changes are:
> 1. Use the DOM tree instead of the flat tree to search for an element to
>    give initial focus.
> 2. Don't traverse into shadow roots when looking for elements to give
>    initial focus unless the shadow root has delegatesFocus.
>
> This will stay experimental until I have also made the other changes for
> dialog initial focus: whatwg/html#8199
> After those changes have been made as well, I will carefully enable the
> flag by default.
>
> Fixed: 383230, 670130, 1292852
> Change-Id: I13995197f1942aa356cab0f3b41a0e226d1d170d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961528
> Reviewed-by: Mason Freed <[email protected]>
> Commit-Queue: Joey Arhar <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#1067796}

Change-Id: I010be9a77fd8c289edb8c028355182d0fe7dec39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4005547
Commit-Queue: Tim Sergeant <[email protected]>
Commit-Queue: Rubber Stamper <[email protected]>
Auto-Submit: Tim Sergeant <[email protected]>
Bot-Commit: Rubber Stamper <[email protected]>
Owners-Override: Tim Sergeant <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1067950}

--

wpt-commits: 011077556f5634fe685c613564c3325e77387462
wpt-pr: 36838
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: focus Focus, sequential focus navigation, tabindex, autofocus and inert topic: shadow Relates to shadow trees (as defined in DOM)

Development

Successfully merging this pull request may close these issues.

Should delegatesFocus use the flat tree? Unfocusing steps should account for delegatesFocus somehow

5 participants