Commit 77bb544c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added get_body implementation.

parent d7f881f7
...@@ -204,8 +204,47 @@ static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCo ...@@ -204,8 +204,47 @@ static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCo
static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p) static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p)
{ {
FIXME("(%p)->(%p)\n", iface, p); HTMLDocument *This = HTMLDOC_THIS(iface);
return E_NOTIMPL; nsIDOMDocument *nsdoc;
nsIDOMHTMLDocument *nshtmldoc;
nsIDOMHTMLElement *nsbody = NULL;
HTMLDOMNode *node;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
*p = NULL;
if(!This->nscontainer)
return S_OK;
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
if(NS_FAILED(nsres)) {
ERR("GetDocument failed: %08lx\n", nsres);
return S_OK;
}
if(NS_FAILED(nsres) || !nsdoc)
return S_OK;
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
nsIDOMDocument_Release(nsdoc);
nsres = nsIDOMHTMLDocument_GetBody(nshtmldoc, &nsbody);
nsIDOMHTMLDocument_Release(nshtmldoc);
if(NS_FAILED(nsres) || !nsbody) {
TRACE("Could not get body: %08lx\n", nsres);
return S_OK;
}
node = get_node(This, (nsIDOMNode*)nsbody);
nsIDOMHTMLElement_Release(nsbody);
IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
TRACE("*p = %p\n", *p);
return S_OK;
} }
static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p) static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)
......
...@@ -107,6 +107,7 @@ typedef nsISupports nsIDOMProcessingInstruction; ...@@ -107,6 +107,7 @@ typedef nsISupports nsIDOMProcessingInstruction;
typedef nsISupports nsIDOMEntityReference; typedef nsISupports nsIDOMEntityReference;
typedef nsISupports nsIDOMHTMLFormElement; typedef nsISupports nsIDOMHTMLFormElement;
typedef nsISupports nsIDOMHTMLOptionsCollection; typedef nsISupports nsIDOMHTMLOptionsCollection;
typedef nsISupports nsIDOMHTMLCollection;
[ [
object, object,
...@@ -475,6 +476,33 @@ interface nsIDOMDocument : nsIDOMNode ...@@ -475,6 +476,33 @@ interface nsIDOMDocument : nsIDOMNode
[ [
object, object,
uuid(a6cf9084-15b3-11d2-932e-00805f8add32)
]
interface nsIDOMHTMLDocument : nsIDOMDocument
{
nsresult GetTitle(nsAString *aTitle);
nsresult SetTitle(const nsAString *aTitle);
nsresult GetReferrer(nsAString *aReferrer);
nsresult GetDomain(nsAString *aDomain);
nsresult GetURL(nsAString *aURL);
nsresult GetBody(nsIDOMHTMLElement **aBody);
nsresult SetBody(nsIDOMHTMLElement *aBody);
nsresult GetImages(nsIDOMHTMLCollection **aImages);
nsresult GetApplets(nsIDOMHTMLCollection **aApplets);
nsresult GetLinks(nsIDOMHTMLCollection **aLinks);
nsresult GetForms(nsIDOMHTMLCollection **aForms);
nsresult GetAnchors(nsIDOMHTMLCollection **aAnchors);
nsresult GetCookie(nsAString *aCookie);
nsresult SetCookie(const nsAString *aCookie);
nsresult Open(void);
nsresult Close(void);
nsresult Write(const nsAString *text);
nsresult Writeln(const nsAString *text);
nsresult GetElementsByName(const nsAString *elementName, nsIDOMNodeList **_retval);
}
[
object,
uuid(a6cf906b-15b3-11d2-932e-00805f8add32) uuid(a6cf906b-15b3-11d2-932e-00805f8add32)
] ]
interface nsIDOMWindow : nsISupports interface nsIDOMWindow : nsISupports
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment