@@ -12,7 +12,7 @@ let createInput = () => createElement("input")
12
12
let createLabelWithText = text => {
13
13
let el = createElement ("label" )
14
14
let textNode = createTextNode (text )
15
- Element .appendChild (el , textNode )
15
+ Element .appendChild (el , ~ child = textNode )
16
16
el
17
17
}
18
18
@@ -25,15 +25,15 @@ Element.setAttribute(usernameInput, "name", "username")
25
25
Element .setAttribute (usernameInput , "value" , "username" )
26
26
27
27
let usernameLabel = createLabelWithText ("Username:" )
28
- Element .appendChild (usernameLabel , usernameInput )
28
+ Element .appendChild (usernameLabel , ~ child = usernameInput )
29
29
30
30
let passwordInput = createInput ()
31
31
Element .setAttribute (passwordInput , "type" , "password" )
32
32
Element .setAttribute (passwordInput , "name" , "password" )
33
33
Element .setAttribute (passwordInput , "value" , "password" )
34
34
35
35
let passwordLabel = createLabelWithText ("Password:" )
36
- Element .appendChild (passwordLabel , passwordInput )
36
+ Element .appendChild (passwordLabel , ~ child = passwordInput )
37
37
38
38
let radioInput1 = createInput ()
39
39
Element .setAttribute (radioInput1 , "type" , "radio" )
@@ -42,7 +42,7 @@ Element.setAttribute(radioInput1, "value", "one")
42
42
Element .setAttribute (radioInput1 , "checked" , "true" )
43
43
44
44
let radioLabel1 = createLabelWithText ("Choice 1:" )
45
- Element .appendChild (radioLabel1 , radioInput1 )
45
+ Element .appendChild (radioLabel1 , ~ child = radioInput1 )
46
46
47
47
let radioInput2 = createInput ()
48
48
Element .setAttribute (radioInput2 , "type" , "radio" )
@@ -51,34 +51,34 @@ Element.setAttribute(radioInput2, "value", "two")
51
51
// Element.setAttribute(radioInput2, "checked", "true");
52
52
53
53
let radioLabel2 = createLabelWithText ("Choice 2:" )
54
- Element .appendChild (radioLabel2 , radioInput2 )
54
+ Element .appendChild (radioLabel2 , ~ child = radioInput2 )
55
55
56
56
let select = createElement ("select" )
57
57
Element .setAttribute (select , "name" , "select" )
58
58
let selectLabel = createLabelWithText ("Select:" )
59
- Element .appendChild (selectLabel , select )
59
+ Element .appendChild (selectLabel , ~ child = select )
60
60
61
61
let usernameContainer = createElement ("div" )
62
62
let passwordContainer = createElement ("div" )
63
63
let radioContainer = createElement ("div" )
64
64
let selectContainer = createElement ("div" )
65
65
66
- Element .appendChild (usernameContainer , usernameLabel )
67
- Element .appendChild (passwordContainer , passwordLabel )
68
- Element .appendChild (radioContainer , radioLabel1 )
69
- Element .appendChild (radioContainer , radioLabel2 )
70
- Element .appendChild (selectContainer , selectLabel )
71
- Element .appendChild (formEl , usernameContainer )
72
- Element .appendChild (formEl , passwordContainer )
73
- Element .appendChild (formEl , radioContainer )
74
- Element .appendChild (formEl , selectContainer )
66
+ Element .appendChild (usernameContainer , ~ child = usernameLabel )
67
+ Element .appendChild (passwordContainer , ~ child = passwordLabel )
68
+ Element .appendChild (radioContainer , ~ child = radioLabel1 )
69
+ Element .appendChild (radioContainer , ~ child = radioLabel2 )
70
+ Element .appendChild (selectContainer , ~ child = selectLabel )
71
+ Element .appendChild (formEl , ~ child = usernameContainer )
72
+ Element .appendChild (formEl , ~ child = passwordContainer )
73
+ Element .appendChild (formEl , ~ child = radioContainer )
74
+ Element .appendChild (formEl , ~ child = selectContainer )
75
75
76
76
let body =
77
77
Document .asHtmlDocument (document )
78
78
-> Belt .Option .flatMap (HtmlDocument .body )
79
79
-> TestHelpers .unsafelyUnwrapOption
80
80
81
- Element .appendChild (body , formEl )
81
+ Element .appendChild (body , ~ child = formEl )
82
82
83
83
let collection = elements (form )
84
84
@@ -151,7 +151,7 @@ HtmlOptionsCollection.setLength(opts, 0)
151
151
152
152
let opt1 = createElement ("option" )
153
153
Element .setAttribute (opt1 , "value" , "1" )
154
- Element .appendChild (opt1 , createTextNode ("opt1" ))
154
+ Element .appendChild (opt1 , ~ child = createTextNode ("opt1" ))
155
155
156
156
HtmlOptionsCollection .add (
157
157
opts ,
@@ -164,7 +164,7 @@ Js.log2("collection length:", HtmlOptionsCollection.length(opts))
164
164
165
165
let opt2 = createElement ("option" )
166
166
Element .setAttribute (opt2 , "value" , "2" )
167
- Element .appendChild (opt2 , createTextNode ("opt2" ))
167
+ Element .appendChild (opt2 , ~ child = createTextNode ("opt2" ))
168
168
169
169
let item = HtmlOptionsCollection .item (opts , 0 )
170
170
jsAssert (Belt .Option .isSome (item ), "HtmlOptionsCollection.item should return an item" )
@@ -189,7 +189,7 @@ jsAssert(HtmlOptionsCollection.selectedIndex(opts) == -1, "HtmlOptionsCollection
189
189
190
190
let opt3 = createElement ("option" )
191
191
Element .setAttribute (opt3 , "value" , "3" )
192
- Element .appendChild (opt3 , createTextNode ("opt3" ))
192
+ Element .appendChild (opt3 , ~ child = createTextNode ("opt3" ))
193
193
194
194
HtmlOptionsCollection .add (
195
195
opts ,
@@ -230,7 +230,7 @@ HtmlSelectElement.setLength(select, 0)
230
230
231
231
let opt1 = createElement ("option" )
232
232
Element .setAttribute (opt1 , "value" , "1" )
233
- Element .appendChild (opt1 , createTextNode ("opt1" ))
233
+ Element .appendChild (opt1 , ~ child = createTextNode ("opt1" ))
234
234
235
235
HtmlSelectElement .add (
236
236
select ,
@@ -243,7 +243,7 @@ Js.log2("collection length:", HtmlSelectElement.length(select))
243
243
244
244
let opt2 = createElement ("option" )
245
245
Element .setAttribute (opt2 , "value" , "2" )
246
- Element .appendChild (opt2 , createTextNode ("opt2" ))
246
+ Element .appendChild (opt2 , ~ child = createTextNode ("opt2" ))
247
247
248
248
let item = HtmlSelectElement .item (select , 0 )
249
249
jsAssert (Belt .Option .isSome (item ), "HtmlSelectElement.item should return an item" )
@@ -268,7 +268,7 @@ jsAssert(HtmlSelectElement.selectedIndex(select) == -1, "HtmlSelectElement.clear
268
268
269
269
let opt3 = createElement ("option" )
270
270
Element .setAttribute (opt3 , "value" , "3" )
271
- Element .appendChild (opt3 , createTextNode ("opt3" ))
271
+ Element .appendChild (opt3 , ~ child = createTextNode ("opt3" ))
272
272
273
273
HtmlSelectElement .add (
274
274
select ,
0 commit comments