Skip to content

Commit a94c6cb

Browse files
authored
moving documentElement to dom, reordering properties
1 parent c19fbbf commit a94c6cb

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

inputfiles/patches/dom.kdl

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,63 +12,56 @@ interface EventListenerObject noInterfaceObject=#true {
1212
}
1313

1414
interface Document {
15-
property anchors nullable=#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 nullable=#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 nullable=#false
2327
}
24-
25-
property documentElement {
26-
type HTMLElement nullable=#false
28+
property head {
29+
type nullable=#false
2730
}
2831

29-
property embeds nullable=#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 nullable=#false {
43+
property forms {
3644
type HTMLCollectionOf {
3745
type HTMLFormElement
3846
}
3947
}
40-
41-
property head {
42-
type nullable=#false
43-
}
44-
45-
property images nullable=#false {
48+
property images {
4649
type HTMLCollectionOf {
4750
type HTMLImageElement
4851
}
4952
}
50-
51-
property links nullable=#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 nullable=#false
63-
}
64-
65-
property plugins nullable=#false {
59+
property plugins {
6660
type HTMLCollectionOf {
6761
type HTMLEmbedElement
6862
}
6963
}
70-
71-
property scripts nullable=#false {
64+
property scripts {
7265
type HTMLCollectionOf {
7366
type HTMLScriptElement
7467
}

0 commit comments

Comments
 (0)