Commit 12aa9e33 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLBodyElement::CreateTextRange implementation.

parent 700ccaf7
......@@ -395,8 +395,33 @@ static HRESULT WINAPI HTMLBodyElement_get_onbeforeunload(IHTMLBodyElement *iface
static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, IHTMLTxtRange **range)
{
HTMLBodyElement *This = HTMLBODY_THIS(iface);
FIXME("(%p)->(%p)\n", This, range);
return E_NOTIMPL;
nsIDOMRange *nsrange = NULL;
TRACE("(%p)->(%p)\n", This, range);
if(This->element->node->doc->nscontainer) {
nsIDOMDocument *nsdoc;
nsIDOMDocumentRange *nsdocrange;
nsresult nsres;
nsIWebNavigation_GetDocument(This->element->node->doc->nscontainer->navigation, &nsdoc);
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentRange, (void**)&nsdocrange);
nsIDOMDocument_Release(nsdoc);
nsres = nsIDOMDocumentRange_CreateRange(nsdocrange, &nsrange);
if(NS_SUCCEEDED(nsres)) {
nsres = nsIDOMRange_SelectNodeContents(nsrange, This->element->node->nsnode);
if(NS_FAILED(nsres))
ERR("SelectNodeContents failed: %08x\n", nsres);
}else {
ERR("CreateRange failed: %08x\n", nsres);
}
nsIDOMDocumentRange_Release(nsdocrange);
}
*range = HTMLTxtRange_Create(nsrange);
return S_OK;
}
static void HTMLBodyElement_destructor(IUnknown *iface)
......
......@@ -687,6 +687,16 @@ interface nsIDOMRange : nsISupports
[
object,
uuid(7b9badc6-c9bc-447a-8670-dbd195aed24b)
/* FROZEN */
]
interface nsIDOMDocumentRange : nsISupports
{
nsresult CreateRange(nsIDOMRange **_retval);
}
[
object,
uuid(b2c7ed59-8634-4352-9e37-5484c8b6e4e1)
/* FROZEN */
]
......
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