Skip to content

Missing null check in potentially-reset-the-focus #12469

@ltenmoz

Description

@ltenmoz

What is the issue with the HTML Standard?

Steps 11 and 12 of potentially reset the focus given a NavigateEvent event are currently

  1. If focusTarget is null, then set focusTarget to document's document element.
  2. Run the focusing steps for focusTarget, with document's viewport as the fallback target.

However it is possible for the document element to be null, and the focusing steps don't accept null.
Perhaps step 11 can say instead "set focusTarget to document's viewport"? (I think it would have essentially the same effect, since getting the focusable area for the document element returns the viewport anyways)

Related Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=2040190

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions