Skip to content

document.documentElement could be null actually #50078

@JounQin

Description

@JounQin

Bug Report

🔎 Search Terms

document.documentElement

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

Playground link with relevant code

💻 Code

document.documentElement // `HTMLElement | null` expected

document.documentElement.remove() // `document.documentElement` is `null` now

🙁 Actual behavior

image

🙂 Expected behavior

readonly documentElement: HTMLElement | null

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions