xpcom: how to pass nsIDOMHTMLDocument obj from javascript to c++ xpcom

RESOLVED INVALID

Status

()

Core
XPConnect
RESOLVED INVALID
7 years ago
7 years ago

People

(Reporter: xukepeng2009, Unassigned)

Tracking

5 Branch
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
In FF5, with gecko5.0, OS:win7
--------------------------------------------------------------------------------

JavaScript code:

g_FFQpBHO = Components.classes[cid].createInstance();

gFFQpBHO = gFFQpBHO.QueryInterface(Components.interfaces.IFFQpBHO);

g_FFQpBHO.OnFocus(gBrowser.contentDocument);

alert(gBrowser.contentDocument);

g_FFQpBHO.OnFocus(gBrowser.contentDocument);
--------------------------------------------------------------------------------

C++ code interface:

long OnFocus(in nsIDOMHTMLDocument dom);
--------------------------------------------------------------------------------

When run FF5, the alert message shows:

[object XrayWrapper [object HTMLDocument]]

and then an exception message shows: 

[Exception... "Cannot find interface information for parameter arg 0 [IFFQpBHO.OnFocus]" nsresult: "0x80570006
(NS_ERROR_XPC_CANT_GET_PARAM_IFACE_INFO)" location: "JS frame :: chrome://sample/content/public.js :: CreateFFQpBHO :: line 172" data: no]
--------------------------------------------------------------------------------

I don't know what's wrong with this. If passing nsIDOMWindow,it is ok. It failed when passing nsIDOMHTMLDocument. Need help about this, thanks a lot.

Comment 1

7 years ago
I could not reproduce the issue on: Mozilla/5.0 (Windows NT 6.1; rv:7.0a1) Gecko/20110628 Firefox/7.0a1

Can you be more clear on the steps to reproduce? Thanks.

Updated

7 years ago
Severity: blocker → normal

Comment 2

7 years ago
(In reply to xukepeng2009 from comment #0)

> I don't know what's wrong with this. If passing nsIDOMWindow,it is ok. It
> failed when passing nsIDOMHTMLDocument. Need help about this, thanks a lot.

Reporter, do you still see the issue? Can you provide more clear steps to reproduce? Thanks

Updated

7 years ago
Component: DOM: Mozilla Extensions → XPConnect
QA Contact: general → xpconnect

Comment 3

7 years ago
Normally this error message means that your IIDs don't match the Firefox ones. This can happen if you're building your XPTs against the wrong version of the SDK IDL files.

This is very likely due to the IID rev in bug 639849. Closing INVALID, but please reopen if this is not actually the case.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.