mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix for bug 820657 (Implement the NamedGetter functionality on HTMLDocument) - hook up document.all in the HTMLDocument NamedGetter. r=bz.
--HG-- extra : rebase_source : 07e96b798b87bc18b3f63d845c4023a7593d9f6b
This commit is contained in:
parent
ca9babdeb5
commit
3b995f1de7
@ -106,6 +106,7 @@
|
||||
#include "mozilla/dom/HTMLBodyElement.h"
|
||||
#include "nsCharsetSource.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
@ -2361,6 +2362,10 @@ nsHTMLDocument::NamedGetter(JSContext* cx, const nsAString& aName, bool& aFound,
|
||||
nsISupports* supp = ResolveName(aName, &cache);
|
||||
if (!supp) {
|
||||
aFound = false;
|
||||
if (GetCompatibilityMode() == eCompatibility_NavQuirks &&
|
||||
aName.EqualsLiteral("all")) {
|
||||
rv = nsHTMLDocumentSH::TryResolveAll(cx, this, GetWrapper());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -7190,6 +7190,17 @@ ResolveAll(JSContext* cx, nsIDocument* doc, JSObject* obj)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLDocumentSH::TryResolveAll(JSContext* cx, nsHTMLDocument* doc,
|
||||
JSObject* obj)
|
||||
{
|
||||
if (sDisableDocumentAllSupport) {
|
||||
return NS_OK;
|
||||
}
|
||||
JSAutoCompartment ac(cx, obj);
|
||||
return ResolveAll(cx, doc, obj);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocumentSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
JSObject *obj, jsid id, uint32_t flags,
|
||||
@ -7226,12 +7237,10 @@ nsHTMLDocumentSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
if (id == sAll_id && !sDisableDocumentAllSupport &&
|
||||
!ObjectIsNativeWrapper(cx, obj)) {
|
||||
nsIDocument *doc = static_cast<nsIDocument*>(wrapper->Native());
|
||||
|
||||
if (doc->GetCompatibilityMode() == eCompatibility_NavQuirks) {
|
||||
return ResolveAll(cx, doc, obj);
|
||||
if (doc->GetCompatibilityMode() != eCompatibility_NavQuirks) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return ResolveAll(cx, doc, obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -690,6 +690,9 @@ public:
|
||||
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
JSObject *obj, jsid id, jsval *vp, bool *_retval);
|
||||
|
||||
static nsresult TryResolveAll(JSContext* cx, nsHTMLDocument* doc,
|
||||
JSObject* obj);
|
||||
|
||||
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
|
||||
{
|
||||
return new nsHTMLDocumentSH(aData);
|
||||
|
Loading…
Reference in New Issue
Block a user