Skip to content

Internal ancestor origin objects list creation steps always get a null parentDoc #13066

Description

@zcorpan

What is the issue with the HTML Standard?

The internal ancestor origin objects list creation steps start:

  1. Let output be « ».
  2. Let parentDoc be document's container document.
  3. If parentDoc is null, then return output.

A document's container document goes through its node navigable, which is null until the document is some navigable's active document. Both callers run before that:

So parentDoc is always null and location.ancestorOrigins is always empty.

Maybe the callers could pass in parentDoc: the embedder's node document for the initial about:blank, and navigationParams's navigable's container document otherwise.

(Found by @shannonbooth in #12572 (comment).)

Activity

  1. krasavamarat commented on Oct 23, 2026

    @krasavamarat

    I think there's a bug in the ancestor origin list creation steps.

    The algorithm starts by getting the document's container document, but this is derived from its node navigable, which is null until the document becomes a navigable's active document. Both callers invoke these steps before that happens:

    create a new browsing context invokes them before creating the navigable.
    create and initialize a Document object invokes them before the new document becomes active during navigation.

    As a result, parentDoc is always null, and location.ancestorOrigins is always empty.

    Could we pass parentDoc explicitly to the ancestor origin list creation steps instead? The initial about:blank document could use the embedder's node document, while documents created during navigation could use navigationParams' navigable's container document.

  2. added theissue type on Nov 17, 2026
  3. added
    topic: navigation
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: navigation

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions