Issue #2135 - Implement sequential focus navigation for shadow DOM

This covers the following:
Bug 1413834	Implement sequential focus navigation regarding shadow DOM
> Bug 1430020	Let sequential focus navigation in shadow DOM enter iframes
> Bug 1430701	Handle focus navigation on frameless shadow hosts in light DOM
> Bug 1430692	Handle focus navigation on NAC in shadow DOM
> Bug 1453693	Ensure sequential focus navigation works in Shadow DOM and add some tests
> Bug 1466581	Handle sequential focus also in nested shadow DOM
> Bug 1481079	Shadow DOM hosts should be focusable
> Bug 1507101	Use StyleChildrenIterator instead of custom frame tree walking code to handle NAC inside shadow dom
> Bug 1512043	Ensure traverse all nodes owned by the top level shadow host
> Bug 1512457	Fix various cases that focus navigation doesn't work well with frameless shadow host
> Bug 1513141	Really minor nsFocusManager cleanup
> Bug 1519090	Keyboard focus is trapped inside <slot>
> Bug 1528034	Make IsHostOrSlot null-safe
> Bug 1544826	Wrong focus navigation behavior when the root element is a shadow root
>> Bug 1500273	Ensure backward focus navigation works in Shadow DOM
This commit is contained in:
FranklinDM 2023-03-04 02:18:40 +08:00 committed by roytam1
commit 56193120c5
7 changed files with 1712 additions and 98 deletions

View file

@ -6436,9 +6436,7 @@ nsContentUtils::IsFocusedContent(const nsIContent* aContent)
bool
nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent)
{
//XXXsmaug Shadow DOM spec issue!
// We may need to change this to GetComposedDoc().
nsIDocument* doc = aContent->GetUncomposedDoc();
nsIDocument* doc = aContent->GetComposedDoc();
if (!doc) {
return false;
}