It basically boilds down to the fact that I’m unable to QI
“nsIBrowserBoxObject” from the nsIBoxObject.
Sample code:
nsCOMPtr<nsIDOMXULElement> spXULElement = do_QueryInterface(spNode);
nsCOMPtr<nsIBoxObject> spBoxObject;
spXULElement->GetBoxObject(getter_AddRefs(spBoxObject));
// spBoxObject, is valid but QI Fails in FF 4.0 Beta 7
nsCOMPtr<nsIBrowserBoxObject> spBrowserBoxObject =
do_QueryInterface(spBoxObject);
nsCOMPtr<nsIDocShell> spDocShell;
spBrowserBoxObject->GetDocShell(getter_AddRefs(spDocShell));
I also looked at'nsIContainerBoxObject' was unable to QI that as well.
Whats the right way to go about doing this in 4.0 Beta 7 (and forward)
-Jens
The fix was simple, just add
nsCOMPtr<nsIDOMNode> spFirstChild;
spBrowserNode->GetFirstChild( getter_AddRefs(spFirstChild) );
// Proceed as before
nsCOMPtr<nsIDOMXULElement> spXULElement =
do_QueryInterface(spFirstChild);
nsCOMPtr<nsIBoxObject> spBoxObject;