mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
document.all('foo') doesn't work (bug 626050, r=brendan).
This commit is contained in:
parent
f00ce6228a
commit
cc7aab8dd2
@ -8928,21 +8928,16 @@ nsHTMLDocumentSH::CallToGetPropMapper(JSContext *cx, uintN argc, jsval *vp)
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// If we are called via document.all(id) instead of document.all.item(i) or
|
||||
// another method, use the document.all callee object as self.
|
||||
JSObject *self;
|
||||
|
||||
if (::JS_TypeOfValue(cx, JS_CALLEE(cx, vp)) == JSTYPE_FUNCTION) {
|
||||
// If the callee is a function, we're called through
|
||||
// document.all.item() or something similar. In such a case, self
|
||||
// is passed as obj.
|
||||
|
||||
if (JSVAL_IS_OBJECT(JS_CALLEE(cx, vp)) &&
|
||||
::JS_GetClass(cx, JSVAL_TO_OBJECT(JS_CALLEE(cx, vp))) == &sHTMLDocumentAllClass) {
|
||||
self = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));
|
||||
} else {
|
||||
self = JS_THIS_OBJECT(cx, vp);
|
||||
if (!self)
|
||||
return JS_FALSE;
|
||||
} else {
|
||||
// In other cases (i.e. document.all("foo")), self is passed as
|
||||
// the callee
|
||||
|
||||
self = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));
|
||||
}
|
||||
|
||||
size_t length;
|
||||
|
Loading…
Reference in New Issue
Block a user