- a/LayoutTests/ChangeLog +13 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2010-01-19  Kent Hansen  <kent.hansen@nokia.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Some window properties are not returned by Object.keys and Object.getOwnPropertyNames
6
        https://bugs.webkit.org/show_bug.cgi?id=33603
7
8
        Add test for checking that properties on the Window prototype are proxied by the Window object.
9
10
        * fast/dom/Window/script-tests/window-property-proxying.js: Added.
11
        * fast/dom/Window/window-property-proxying-expected.txt: Added.
12
        * fast/dom/Window/window-property-proxying.html: Added.
13
1
2010-01-19  Xan Lopez  <xlopez@igalia.com>
14
2010-01-19  Xan Lopez  <xlopez@igalia.com>
2
15
3
        svg/custom/use-instanceRoot-event-bubbling.xhtml is flakey
16
        svg/custom/use-instanceRoot-event-bubbling.xhtml is flakey
- a/LayoutTests/fast/dom/Window/script-tests/window-property-proxying.js +24 lines
Line 0 a/LayoutTests/fast/dom/Window/script-tests/window-property-proxying.js_sec1
1
description(
2
"This test checks that properties on the Window prototype are proxied by the Window object."
3
);
4
5
var windowKeys = Object.keys(window);
6
var windowOwnPropertyNames = Object.getOwnPropertyNames(window);
7
8
var protoPropertyNamesSet = {};
9
for (var o = window.__proto__; o; o = o.__proto__) {
10
    var names = Object.getOwnPropertyNames(o);
11
    for (var i = 0; i < names.length; ++i)
12
        protoPropertyNamesSet[names[i]] = true;
13
}
14
15
for (var name in protoPropertyNamesSet) {
16
    shouldBeTrue("window.hasOwnProperty('" + name + "')");
17
    shouldBeEqualToString("typeof Object.getOwnPropertyDescriptor(window, '" + name + "')", "object");
18
    shouldBeTrue("windowOwnPropertyNames.indexOf('" + name + "') != -1");
19
    if (window.propertyIsEnumerable(name))
20
        shouldBeTrue("windowKeys.indexOf('" + name + "') != -1");
21
    shouldBe("window['" + name + "']", "window.__proto__['" + name + "']");
22
}
23
24
var successfullyParsed = true;
- a/LayoutTests/fast/dom/Window/window-property-proxying-expected.txt +234 lines
Line 0 a/LayoutTests/fast/dom/Window/window-property-proxying-expected.txt_sec1
1
This test checks that properties on the Window prototype are proxied by the Window object.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS window.hasOwnProperty('moveBy') is true
7
PASS typeof Object.getOwnPropertyDescriptor(window, 'moveBy') is "object"
8
PASS windowOwnPropertyNames.indexOf('moveBy') != -1 is true
9
PASS windowKeys.indexOf('moveBy') != -1 is true
10
PASS window['moveBy'] is window.__proto__['moveBy']
11
PASS window.hasOwnProperty('find') is true
12
PASS typeof Object.getOwnPropertyDescriptor(window, 'find') is "object"
13
PASS windowOwnPropertyNames.indexOf('find') != -1 is true
14
PASS windowKeys.indexOf('find') != -1 is true
15
PASS window['find'] is window.__proto__['find']
16
PASS window.hasOwnProperty('resizeTo') is true
17
PASS typeof Object.getOwnPropertyDescriptor(window, 'resizeTo') is "object"
18
PASS windowOwnPropertyNames.indexOf('resizeTo') != -1 is true
19
PASS windowKeys.indexOf('resizeTo') != -1 is true
20
PASS window['resizeTo'] is window.__proto__['resizeTo']
21
PASS window.hasOwnProperty('clearTimeout') is true
22
PASS typeof Object.getOwnPropertyDescriptor(window, 'clearTimeout') is "object"
23
PASS windowOwnPropertyNames.indexOf('clearTimeout') != -1 is true
24
PASS windowKeys.indexOf('clearTimeout') != -1 is true
25
PASS window['clearTimeout'] is window.__proto__['clearTimeout']
26
PASS window.hasOwnProperty('btoa') is true
27
PASS typeof Object.getOwnPropertyDescriptor(window, 'btoa') is "object"
28
PASS windowOwnPropertyNames.indexOf('btoa') != -1 is true
29
PASS windowKeys.indexOf('btoa') != -1 is true
30
PASS window['btoa'] is window.__proto__['btoa']
31
PASS window.hasOwnProperty('getComputedStyle') is true
32
PASS typeof Object.getOwnPropertyDescriptor(window, 'getComputedStyle') is "object"
33
PASS windowOwnPropertyNames.indexOf('getComputedStyle') != -1 is true
34
PASS windowKeys.indexOf('getComputedStyle') != -1 is true
35
PASS window['getComputedStyle'] is window.__proto__['getComputedStyle']
36
PASS window.hasOwnProperty('setTimeout') is true
37
PASS typeof Object.getOwnPropertyDescriptor(window, 'setTimeout') is "object"
38
PASS windowOwnPropertyNames.indexOf('setTimeout') != -1 is true
39
PASS windowKeys.indexOf('setTimeout') != -1 is true
40
PASS window['setTimeout'] is window.__proto__['setTimeout']
41
PASS window.hasOwnProperty('scrollBy') is true
42
PASS typeof Object.getOwnPropertyDescriptor(window, 'scrollBy') is "object"
43
PASS windowOwnPropertyNames.indexOf('scrollBy') != -1 is true
44
PASS windowKeys.indexOf('scrollBy') != -1 is true
45
PASS window['scrollBy'] is window.__proto__['scrollBy']
46
PASS window.hasOwnProperty('print') is true
47
PASS typeof Object.getOwnPropertyDescriptor(window, 'print') is "object"
48
PASS windowOwnPropertyNames.indexOf('print') != -1 is true
49
PASS windowKeys.indexOf('print') != -1 is true
50
PASS window['print'] is window.__proto__['print']
51
PASS window.hasOwnProperty('resizeBy') is true
52
PASS typeof Object.getOwnPropertyDescriptor(window, 'resizeBy') is "object"
53
PASS windowOwnPropertyNames.indexOf('resizeBy') != -1 is true
54
PASS windowKeys.indexOf('resizeBy') != -1 is true
55
PASS window['resizeBy'] is window.__proto__['resizeBy']
56
PASS window.hasOwnProperty('atob') is true
57
PASS typeof Object.getOwnPropertyDescriptor(window, 'atob') is "object"
58
PASS windowOwnPropertyNames.indexOf('atob') != -1 is true
59
PASS windowKeys.indexOf('atob') != -1 is true
60
PASS window['atob'] is window.__proto__['atob']
61
PASS window.hasOwnProperty('openDatabase') is true
62
PASS typeof Object.getOwnPropertyDescriptor(window, 'openDatabase') is "object"
63
PASS windowOwnPropertyNames.indexOf('openDatabase') != -1 is true
64
PASS windowKeys.indexOf('openDatabase') != -1 is true
65
PASS window['openDatabase'] is window.__proto__['openDatabase']
66
PASS window.hasOwnProperty('moveTo') is true
67
PASS typeof Object.getOwnPropertyDescriptor(window, 'moveTo') is "object"
68
PASS windowOwnPropertyNames.indexOf('moveTo') != -1 is true
69
PASS windowKeys.indexOf('moveTo') != -1 is true
70
PASS window['moveTo'] is window.__proto__['moveTo']
71
PASS window.hasOwnProperty('scroll') is true
72
PASS typeof Object.getOwnPropertyDescriptor(window, 'scroll') is "object"
73
PASS windowOwnPropertyNames.indexOf('scroll') != -1 is true
74
PASS windowKeys.indexOf('scroll') != -1 is true
75
PASS window['scroll'] is window.__proto__['scroll']
76
PASS window.hasOwnProperty('confirm') is true
77
PASS typeof Object.getOwnPropertyDescriptor(window, 'confirm') is "object"
78
PASS windowOwnPropertyNames.indexOf('confirm') != -1 is true
79
PASS windowKeys.indexOf('confirm') != -1 is true
80
PASS window['confirm'] is window.__proto__['confirm']
81
PASS window.hasOwnProperty('getMatchedCSSRules') is true
82
PASS typeof Object.getOwnPropertyDescriptor(window, 'getMatchedCSSRules') is "object"
83
PASS windowOwnPropertyNames.indexOf('getMatchedCSSRules') != -1 is true
84
PASS windowKeys.indexOf('getMatchedCSSRules') != -1 is true
85
PASS window['getMatchedCSSRules'] is window.__proto__['getMatchedCSSRules']
86
PASS window.hasOwnProperty('showModalDialog') is true
87
PASS typeof Object.getOwnPropertyDescriptor(window, 'showModalDialog') is "object"
88
PASS windowOwnPropertyNames.indexOf('showModalDialog') != -1 is true
89
FAIL window['showModalDialog'] should be function showModalDialog() {
90
    [native code]
91
} (of type function). Was undefined (of type undefined).
92
PASS window.hasOwnProperty('close') is true
93
PASS typeof Object.getOwnPropertyDescriptor(window, 'close') is "object"
94
PASS windowOwnPropertyNames.indexOf('close') != -1 is true
95
PASS windowKeys.indexOf('close') != -1 is true
96
PASS window['close'] is window.__proto__['close']
97
PASS window.hasOwnProperty('clearInterval') is true
98
PASS typeof Object.getOwnPropertyDescriptor(window, 'clearInterval') is "object"
99
PASS windowOwnPropertyNames.indexOf('clearInterval') != -1 is true
100
PASS windowKeys.indexOf('clearInterval') != -1 is true
101
PASS window['clearInterval'] is window.__proto__['clearInterval']
102
PASS window.hasOwnProperty('webkitConvertPointFromNodeToPage') is true
103
PASS typeof Object.getOwnPropertyDescriptor(window, 'webkitConvertPointFromNodeToPage') is "object"
104
PASS windowOwnPropertyNames.indexOf('webkitConvertPointFromNodeToPage') != -1 is true
105
PASS windowKeys.indexOf('webkitConvertPointFromNodeToPage') != -1 is true
106
PASS window['webkitConvertPointFromNodeToPage'] is window.__proto__['webkitConvertPointFromNodeToPage']
107
PASS window.hasOwnProperty('open') is true
108
PASS typeof Object.getOwnPropertyDescriptor(window, 'open') is "object"
109
PASS windowOwnPropertyNames.indexOf('open') != -1 is true
110
PASS windowKeys.indexOf('open') != -1 is true
111
PASS window['open'] is window.__proto__['open']
112
PASS window.hasOwnProperty('prompt') is true
113
PASS typeof Object.getOwnPropertyDescriptor(window, 'prompt') is "object"
114
PASS windowOwnPropertyNames.indexOf('prompt') != -1 is true
115
PASS windowKeys.indexOf('prompt') != -1 is true
116
PASS window['prompt'] is window.__proto__['prompt']
117
PASS window.hasOwnProperty('focus') is true
118
PASS typeof Object.getOwnPropertyDescriptor(window, 'focus') is "object"
119
PASS windowOwnPropertyNames.indexOf('focus') != -1 is true
120
PASS windowKeys.indexOf('focus') != -1 is true
121
PASS window['focus'] is window.__proto__['focus']
122
PASS window.hasOwnProperty('blur') is true
123
PASS typeof Object.getOwnPropertyDescriptor(window, 'blur') is "object"
124
PASS windowOwnPropertyNames.indexOf('blur') != -1 is true
125
PASS windowKeys.indexOf('blur') != -1 is true
126
PASS window['blur'] is window.__proto__['blur']
127
PASS window.hasOwnProperty('scrollTo') is true
128
PASS typeof Object.getOwnPropertyDescriptor(window, 'scrollTo') is "object"
129
PASS windowOwnPropertyNames.indexOf('scrollTo') != -1 is true
130
PASS windowKeys.indexOf('scrollTo') != -1 is true
131
PASS window['scrollTo'] is window.__proto__['scrollTo']
132
PASS window.hasOwnProperty('removeEventListener') is true
133
PASS typeof Object.getOwnPropertyDescriptor(window, 'removeEventListener') is "object"
134
PASS windowOwnPropertyNames.indexOf('removeEventListener') != -1 is true
135
PASS windowKeys.indexOf('removeEventListener') != -1 is true
136
PASS window['removeEventListener'] is window.__proto__['removeEventListener']
137
PASS window.hasOwnProperty('postMessage') is true
138
PASS typeof Object.getOwnPropertyDescriptor(window, 'postMessage') is "object"
139
PASS windowOwnPropertyNames.indexOf('postMessage') != -1 is true
140
PASS windowKeys.indexOf('postMessage') != -1 is true
141
PASS window['postMessage'] is window.__proto__['postMessage']
142
PASS window.hasOwnProperty('setInterval') is true
143
PASS typeof Object.getOwnPropertyDescriptor(window, 'setInterval') is "object"
144
PASS windowOwnPropertyNames.indexOf('setInterval') != -1 is true
145
PASS windowKeys.indexOf('setInterval') != -1 is true
146
PASS window['setInterval'] is window.__proto__['setInterval']
147
PASS window.hasOwnProperty('getSelection') is true
148
PASS typeof Object.getOwnPropertyDescriptor(window, 'getSelection') is "object"
149
PASS windowOwnPropertyNames.indexOf('getSelection') != -1 is true
150
PASS windowKeys.indexOf('getSelection') != -1 is true
151
PASS window['getSelection'] is window.__proto__['getSelection']
152
PASS window.hasOwnProperty('alert') is true
153
PASS typeof Object.getOwnPropertyDescriptor(window, 'alert') is "object"
154
PASS windowOwnPropertyNames.indexOf('alert') != -1 is true
155
PASS windowKeys.indexOf('alert') != -1 is true
156
PASS window['alert'] is window.__proto__['alert']
157
PASS window.hasOwnProperty('stop') is true
158
PASS typeof Object.getOwnPropertyDescriptor(window, 'stop') is "object"
159
PASS windowOwnPropertyNames.indexOf('stop') != -1 is true
160
PASS windowKeys.indexOf('stop') != -1 is true
161
PASS window['stop'] is window.__proto__['stop']
162
PASS window.hasOwnProperty('webkitConvertPointFromPageToNode') is true
163
PASS typeof Object.getOwnPropertyDescriptor(window, 'webkitConvertPointFromPageToNode') is "object"
164
PASS windowOwnPropertyNames.indexOf('webkitConvertPointFromPageToNode') != -1 is true
165
PASS windowKeys.indexOf('webkitConvertPointFromPageToNode') != -1 is true
166
PASS window['webkitConvertPointFromPageToNode'] is window.__proto__['webkitConvertPointFromPageToNode']
167
PASS window.hasOwnProperty('addEventListener') is true
168
PASS typeof Object.getOwnPropertyDescriptor(window, 'addEventListener') is "object"
169
PASS windowOwnPropertyNames.indexOf('addEventListener') != -1 is true
170
PASS windowKeys.indexOf('addEventListener') != -1 is true
171
PASS window['addEventListener'] is window.__proto__['addEventListener']
172
PASS window.hasOwnProperty('dispatchEvent') is true
173
PASS typeof Object.getOwnPropertyDescriptor(window, 'dispatchEvent') is "object"
174
PASS windowOwnPropertyNames.indexOf('dispatchEvent') != -1 is true
175
PASS windowKeys.indexOf('dispatchEvent') != -1 is true
176
PASS window['dispatchEvent'] is window.__proto__['dispatchEvent']
177
PASS window.hasOwnProperty('captureEvents') is true
178
PASS typeof Object.getOwnPropertyDescriptor(window, 'captureEvents') is "object"
179
PASS windowOwnPropertyNames.indexOf('captureEvents') != -1 is true
180
PASS windowKeys.indexOf('captureEvents') != -1 is true
181
PASS window['captureEvents'] is window.__proto__['captureEvents']
182
PASS window.hasOwnProperty('releaseEvents') is true
183
PASS typeof Object.getOwnPropertyDescriptor(window, 'releaseEvents') is "object"
184
PASS windowOwnPropertyNames.indexOf('releaseEvents') != -1 is true
185
PASS windowKeys.indexOf('releaseEvents') != -1 is true
186
PASS window['releaseEvents'] is window.__proto__['releaseEvents']
187
PASS window.hasOwnProperty('toString') is true
188
PASS typeof Object.getOwnPropertyDescriptor(window, 'toString') is "object"
189
PASS windowOwnPropertyNames.indexOf('toString') != -1 is true
190
PASS window['toString'] is window.__proto__['toString']
191
PASS window.hasOwnProperty('toLocaleString') is true
192
PASS typeof Object.getOwnPropertyDescriptor(window, 'toLocaleString') is "object"
193
PASS windowOwnPropertyNames.indexOf('toLocaleString') != -1 is true
194
PASS window['toLocaleString'] is window.__proto__['toLocaleString']
195
PASS window.hasOwnProperty('valueOf') is true
196
PASS typeof Object.getOwnPropertyDescriptor(window, 'valueOf') is "object"
197
PASS windowOwnPropertyNames.indexOf('valueOf') != -1 is true
198
PASS window['valueOf'] is window.__proto__['valueOf']
199
PASS window.hasOwnProperty('hasOwnProperty') is true
200
PASS typeof Object.getOwnPropertyDescriptor(window, 'hasOwnProperty') is "object"
201
PASS windowOwnPropertyNames.indexOf('hasOwnProperty') != -1 is true
202
PASS window['hasOwnProperty'] is window.__proto__['hasOwnProperty']
203
PASS window.hasOwnProperty('propertyIsEnumerable') is true
204
PASS typeof Object.getOwnPropertyDescriptor(window, 'propertyIsEnumerable') is "object"
205
PASS windowOwnPropertyNames.indexOf('propertyIsEnumerable') != -1 is true
206
PASS window['propertyIsEnumerable'] is window.__proto__['propertyIsEnumerable']
207
PASS window.hasOwnProperty('isPrototypeOf') is true
208
PASS typeof Object.getOwnPropertyDescriptor(window, 'isPrototypeOf') is "object"
209
PASS windowOwnPropertyNames.indexOf('isPrototypeOf') != -1 is true
210
PASS window['isPrototypeOf'] is window.__proto__['isPrototypeOf']
211
PASS window.hasOwnProperty('__defineGetter__') is true
212
PASS typeof Object.getOwnPropertyDescriptor(window, '__defineGetter__') is "object"
213
PASS windowOwnPropertyNames.indexOf('__defineGetter__') != -1 is true
214
PASS window['__defineGetter__'] is window.__proto__['__defineGetter__']
215
PASS window.hasOwnProperty('__defineSetter__') is true
216
PASS typeof Object.getOwnPropertyDescriptor(window, '__defineSetter__') is "object"
217
PASS windowOwnPropertyNames.indexOf('__defineSetter__') != -1 is true
218
PASS window['__defineSetter__'] is window.__proto__['__defineSetter__']
219
PASS window.hasOwnProperty('__lookupGetter__') is true
220
PASS typeof Object.getOwnPropertyDescriptor(window, '__lookupGetter__') is "object"
221
PASS windowOwnPropertyNames.indexOf('__lookupGetter__') != -1 is true
222
PASS window['__lookupGetter__'] is window.__proto__['__lookupGetter__']
223
PASS window.hasOwnProperty('__lookupSetter__') is true
224
PASS typeof Object.getOwnPropertyDescriptor(window, '__lookupSetter__') is "object"
225
PASS windowOwnPropertyNames.indexOf('__lookupSetter__') != -1 is true
226
PASS window['__lookupSetter__'] is window.__proto__['__lookupSetter__']
227
PASS window.hasOwnProperty('constructor') is true
228
PASS typeof Object.getOwnPropertyDescriptor(window, 'constructor') is "object"
229
PASS windowOwnPropertyNames.indexOf('constructor') != -1 is true
230
PASS window['constructor'] is window.__proto__['constructor']
231
PASS successfullyParsed is true
232
233
TEST COMPLETE
234
- a/LayoutTests/fast/dom/Window/window-property-proxying.html +13 lines
Line 0 a/LayoutTests/fast/dom/Window/window-property-proxying.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
5
<script src="../../js/resources/js-test-pre.js"></script>
6
</head>
7
<body>
8
<p id="description"></p>
9
<div id="console"></div>
10
<script src="script-tests/window-property-proxying.js"></script>
11
<script src="../../js/resources/js-test-post.js"></script>
12
</body>
13
</html>
- a/WebCore/ChangeLog +15 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2010-01-19  Kent Hansen  <kent.hansen@nokia.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Some window properties are not returned by Object.keys and Object.getOwnPropertyNames
6
        https://bugs.webkit.org/show_bug.cgi?id=33603
7
8
        Since JSDOMWindow::getOwnPropertyDescriptor() looks in the prototype object,
9
        JSDOMWindow::getOwnPropertyNames() should include the prototype's properties.
10
11
        Test: fast/dom/Window/window-property-proxying.html
12
13
        * bindings/js/JSDOMWindowCustom.cpp:
14
        (WebCore::JSDOMWindow::getOwnPropertyNames):
15
1
2010-01-19  Geoffrey Garen  <ggaren@apple.com>
16
2010-01-19  Geoffrey Garen  <ggaren@apple.com>
2
17
3
        Reviewed by Oliver Hunt.
18
        Reviewed by Oliver Hunt.
- a/WebCore/bindings/js/JSDOMWindowCustom.cpp +6 lines
Lines 432-437 void JSDOMWindow::getOwnPropertyNames(ExecState* exec, PropertyNameArray& proper a/WebCore/bindings/js/JSDOMWindowCustom.cpp_sec1
432
    // Only allow the window to enumerated by frames in the same origin.
432
    // Only allow the window to enumerated by frames in the same origin.
433
    if (!allowsAccessFrom(exec))
433
    if (!allowsAccessFrom(exec))
434
        return;
434
        return;
435
436
    // Add prototype properties to match the logic of getOwnPropertyDescriptor().
437
    JSValue proto = prototype();
438
    if (proto.isObject())
439
        asObject(proto)->getPropertyNames(exec, propertyNames, mode);
440
435
    Base::getOwnPropertyNames(exec, propertyNames, mode);
441
    Base::getOwnPropertyNames(exec, propertyNames, mode);
436
}
442
}
437
443

Return to Bug 33603