diff --git a/source b/source index 4d8cb26a588..fe6b3262e10 100644 --- a/source +++ b/source @@ -76857,51 +76857,59 @@ partial interface
{Return null.
The focus delegate for a focus target, given an optional string
- focus trigger (default "other
"), is given by the following
+
The focus delegate for a focusTarget, given an optional string
+ focusTrigger (default "other
"), is given by the following
steps:
Let autofocus delegate be the autofocus delegate for focus - target given focus trigger.
If autofocus delegate is not null, then return autofocus - delegate.
If focus target is a shadow host and its If focusTarget is a shadow host and its shadow root's delegates focus is false,
then return null.
Let parent be focus target.
Let whereToLook be focusTarget.
If whereToLook is a shadow host, then set whereToLook + to whereToLook's shadow + root.
Let autofocusDelegate be the autofocus delegate for + whereToLook given focusTrigger.
If parent is a shadow host, then set parent to - parent's shadow root.
If autofocusDelegate is not null, then return + autofocusDelegate.
For each child of parent's children:
+For each descendant of + whereToLook's descendants, in tree + order:
If descendant is a focusable area, then return + descendant.
Let focusable area be child, if child is a - focusable area; otherwise let focusable area be the result of getting the focusable area for child given - focus trigger.
+Let focusableArea be the result of getting the focusable area for descendant given + focusTrigger.
This step can end up recursing, i.e., the get the focusable area - steps might return the focus delegate of child.
+ steps might return the focus delegate of descendant.If focusable area is not null, then return focusable - area.
If focusableArea is not null, then return focusableArea.
It's important that we are not looking at the shadow-including descendants here, but instead only + at the descendants. Shadow + hosts are instead handled by the recursive case mentioned above.
Return null.
The above algorithm essentially returns the first suitable focusable - area where the path between its DOM anchor and focus target + area where the path between its DOM anchor and focusTarget delegates focus at any shadow tree boundaries.
The autofocus delegate for a focus target given a focus