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;
|
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;
|
JSObject *self;
|
||||||
|
if (JSVAL_IS_OBJECT(JS_CALLEE(cx, vp)) &&
|
||||||
if (::JS_TypeOfValue(cx, JS_CALLEE(cx, vp)) == JSTYPE_FUNCTION) {
|
::JS_GetClass(cx, JSVAL_TO_OBJECT(JS_CALLEE(cx, vp))) == &sHTMLDocumentAllClass) {
|
||||||
// If the callee is a function, we're called through
|
self = JSVAL_TO_OBJECT(JS_CALLEE(cx, vp));
|
||||||
// document.all.item() or something similar. In such a case, self
|
} else {
|
||||||
// is passed as obj.
|
|
||||||
|
|
||||||
self = JS_THIS_OBJECT(cx, vp);
|
self = JS_THIS_OBJECT(cx, vp);
|
||||||
if (!self)
|
if (!self)
|
||||||
return JS_FALSE;
|
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;
|
size_t length;
|
||||||
|
Loading…
Reference in New Issue
Block a user