-
Notifications
You must be signed in to change notification settings - Fork 12.8k
window.parent
should be nullable
#58464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@whzx5byb Wouldn't it be better for consistency to make window.top non-nullable? |
Which one is this bug about? |
There are three options. Option 1: Comply with WHATWG by making Option 2: Given that Option 3: Leave it as is, meaning |
Without a stronger argument for any one of those, we'll leave as-is. Thanks! |
What is the reason for creating a situation that contradicts the WHATWG specifications and lacks consistency with the definition of window.top? |
⚙ Compilation target
es2017
⚙ Library
ESNext
Missing / Incorrect Definition
In the whatwg definition,
window.parent
is nullable. whatwg/html#2123The definition of
window.parent
in this repository is not nullable.https://github.com/microsoft/TypeScript/blob/b9c71c3fc39f7cbafa82f8aa6f1d3b8a86e27ede/src/lib/dom.generated.d.ts#L26013-L26020
BTW, the definition of window.top is nullable, which is inconsistent.
https://github.com/microsoft/TypeScript/blob/b9c71c3fc39f7cbafa82f8aa6f1d3b8a86e27ede/src/lib/dom.generated.d.ts#L26069-L26070
Sample Code
Documentation Link
https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-window-object
The text was updated successfully, but these errors were encountered: