summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/old-names-expected.txt
blob: 85302b8196801525701e3e2961208f220df55ab5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129

This tests accessing form elements by name. IE only lets you look up names under the first name the element had and does not respond to name changes. Firefox remembers every name item has been accessed with, but forgets items that have not been accessed. This test has been written to expect the Firefox behavior.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS form.length is 2
PASS form.original is a
PASS form.originalB is b
PASS form.second is undefined
PASS form.third is undefined
PASS form.elements.original is a
PASS form.elements.originalB is b
PASS form.elements.second is undefined
PASS form.elements.third is undefined

change the form item a's name to thisWillBeRemembered

get the variable value through form element
PASS form.thisWillBeRemembered is a

now change the form item a's name to thisWillBeRememberedToo
access it in boolean context

accessed form.thisWillBeRememberedToo

now change the form item a's name to thisWillBeForgotten

get the variable value through collection
PASS form.elements.thisWillBeForgotten is a

now change the form item a's name to thisWillBeForgottenToo, but don't access it afterwards

now change the form item a's name to second

PASS form.length is 2
PASS form.original is a
PASS form.originalB is b
PASS form.second is a
PASS form.third is undefined
PASS form.elements.original is undefined
PASS form.elements.originalB is b
PASS form.elements.second is a
PASS form.elements.third is undefined

now change the form item a's name to third

PASS form.length is 2
PASS form.original is a
PASS form.originalB is b
PASS form.second is a
PASS form.third is a
PASS form.elements.original is undefined
PASS form.elements.originalB is b
PASS form.elements.second is undefined
PASS form.elements.third is a

now change form item b's name to second

PASS form.length is 2
PASS form.original is a
PASS form.originalB is b
PASS form.second is b
PASS form.elements.original is undefined
PASS form.elements.originalB is undefined
PASS form.elements.second is b

now change a form item b's name to third

PASS form.length is 2
PASS form.original is a
PASS form.originalB is b
PASS form.second is b
PASS form.third.length is 2
PASS form.third[0] is a
PASS form.third[1] is b
PASS form.elements.original is undefined
PASS form.elements.originalB is undefined
PASS form.elements.second is undefined
PASS form.elements.third.length is 2
PASS form.elements.third[0] is a
PASS form.elements.third[1] is b

now change a form item b's name to fourth

PASS form.third is a
PASS form.third.length is undefined
PASS form.elements.third is a
PASS form.elements.third.length is undefined

now remove element a

PASS form.length is 1
PASS form.original is undefined.
PASS form.originalB is b
PASS form.second is b
PASS form.third is undefined.
PASS form.fourth is b
PASS form.elements.original is undefined
PASS form.elements.originalB is undefined
PASS form.elements.second is undefined
PASS form.elements.third is undefined
PASS form.elements.fourth is b

check that we no longer remember the past names of a

PASS form.thisWillBeForgotten is undefined
PASS form.thisWillBeForgottenToo is undefined
PASS form.thisWillBeRemembered is undefined.
PASS form.thisWillBeRememberedToo is undefined.

Ensures elements are removed from the past names map of a form element once they are no longer associated with the form element.
PASS form1['foo'] is input3
PASS form2.appendChild(form1.firstChild); form1['foo'] is undefined.
PASS form2['foo'] is input3
PASS form2.removeChild(input3); form2['foo'] is undefined.
PASS form1.appendChild(input3); form1['foo'] is input3
PASS input3.setAttribute('form', 'form1'); form1.removeChild(input3); input3.appendChild(form1); form1['foo'] is undefined.
PASS form1['foo'] is not input3

Don't add the element from the past names map if we've found elements of the given name.
PASS form4['foo'] is form4.childNodes[0]
PASS form4['bar'][0] is form4.childNodes[1]
PASS form4['bar'][1] is form4.childNodes[2]
PASS form4.childNodes[0].name = 'bar'; form4.childNodes[1].name = form4.childNodes[2].name = 'foo'; form4['foo'].length is 2
PASS successfullyParsed is true

TEST COMPLETE