File tree Expand file tree Collapse file tree 1 file changed +22
-29
lines changed
Expand file tree Collapse file tree 1 file changed +22
-29
lines changed Original file line number Diff line number Diff line change @@ -12,63 +12,56 @@ interface EventListenerObject noInterfaceObject=#true {
1212}
1313
1414interface Document {
15- property anchors null able= #false {
16- type HTMLCollectionOf {
17- type HTMLAnchorElement
18- }
15+ // Pre-TS-5.1 hack to make document.location assignable
16+ property location readonly= #false {
17+ // Technically this can be null for a detached iframe.
18+ // But that's an edge case and flipping this also breaks compatibility.
19+ type null able= #false
1920 }
2021
22+ // Similarly body and head are mostly non-null for HTML documents.
23+ // body can frequently be null when executing scripts in head, but flipping
24+ // it also breaks compatibiliity.
2125 property body {
2226 type null able= #false
2327 }
24-
25- property documentElement {
26- type HTMLElement null able= #false
28+ property head {
29+ type null able= #false
2730 }
2831
29- property embeds null able= #false {
32+ // More specific types for HTMLCollection properties
33+ property anchors {
34+ type HTMLCollectionOf {
35+ type HTMLAnchorElement
36+ }
37+ }
38+ property embeds {
3039 type HTMLCollectionOf {
3140 type HTMLEmbedElement
3241 }
3342 }
34-
35- property forms null able= #false {
43+ property forms {
3644 type HTMLCollectionOf {
3745 type HTMLFormElement
3846 }
3947 }
40-
41- property head {
42- type null able= #false
43- }
44-
45- property images null able= #false {
48+ property images {
4649 type HTMLCollectionOf {
4750 type HTMLImageElement
4851 }
4952 }
50-
51- property links null able= #false {
53+ property links {
5254 type HTMLCollectionOf {
5355 type HTMLAnchorElement
5456 type HTMLAreaElement
5557 }
5658 }
57-
58- // Pre-TS-5.1 hack to make document.location assignable
59- property location readonly= #false {
60- // Technically this can be null for a detached iframe.
61- // But that's an edge case and flipping this also breaks compatibility.
62- type null able= #false
63- }
64-
65- property plugins null able= #false {
59+ property plugins {
6660 type HTMLCollectionOf {
6761 type HTMLEmbedElement
6862 }
6963 }
70-
71- property scripts null able= #false {
64+ property scripts {
7265 type HTMLCollectionOf {
7366 type HTMLScriptElement
7467 }
You can’t perform that action at this time.
0 commit comments