Skip to content

Commit 76512b3

Browse files
Orta Theroxsaschanaz
andauthored
Removes the nullable attribute from window.parent (#1089)
* Remvoes the nullable attribute from parent * Adds a comment about why it's not null * Expand copy * Update inputfiles/comments.json Co-authored-by: Kagami Sascha Rosylight <[email protected]> * Fix baselines Co-authored-by: Kagami Sascha Rosylight <[email protected]>
1 parent cb20745 commit 76512b3

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

baselines/dom.generated.d.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17230,7 +17230,12 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
1723017230
readonly pageXOffset: number;
1723117231
/** @deprecated This is a legacy alias of `scrollY`. */
1723217232
readonly pageYOffset: number;
17233-
readonly parent: WindowProxy | null;
17233+
/**
17234+
* Refers to either the parent WindowProxy, or itself.
17235+
*
17236+
* It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent.
17237+
*/
17238+
readonly parent: WindowProxy;
1723417239
/**
1723517240
* Returns true if the personal bar is visible; otherwise, returns false.
1723617241
*/
@@ -18294,7 +18299,12 @@ declare var outerWidth: number;
1829418299
declare var pageXOffset: number;
1829518300
/** @deprecated This is a legacy alias of `scrollY`. */
1829618301
declare var pageYOffset: number;
18297-
declare var parent: WindowProxy | null;
18302+
/**
18303+
* Refers to either the parent WindowProxy, or itself.
18304+
*
18305+
* It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent.
18306+
*/
18307+
declare var parent: WindowProxy;
1829818308
/**
1829918309
* Returns true if the personal bar is visible; otherwise, returns false.
1830018310
*/

inputfiles/comments.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,6 +1796,15 @@
17961796
}
17971797
}
17981798
}
1799+
},
1800+
"Window": {
1801+
"properties": {
1802+
"property": {
1803+
"parent": {
1804+
"comment" : "/**\n * Refers to either the parent WindowProxy, or itself.\n *\n * It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent.\n */"
1805+
}
1806+
}
1807+
}
17991808
}
18001809
}
18011810
}

inputfiles/overridingTypes.jsonc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@
500500
},
501501
"window": {
502502
"overrideType": "Window & typeof globalThis"
503+
},
504+
"parent": {
505+
"nullable": false
503506
}
504507
}
505508
},

0 commit comments

Comments
 (0)