Commit 41e3de93 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLTxtRange::moveToElementText implementation.

parent f1786a20
......@@ -4823,6 +4823,7 @@ static void test_txtrange(IHTMLDocument2 *doc)
IHTMLTxtRange *body_range, *range, *range2;
IHTMLSelectionObject *selection;
IDispatch *disp_range;
IHTMLElement *body;
HRESULT hres;
body_range = test_create_body_range(doc);
......@@ -5008,6 +5009,16 @@ static void test_txtrange(IHTMLDocument2 *doc)
test_range_moveend(range, characterW, 2, 2);
test_range_text(range, "ab");
body = doc_get_body(doc);
hres = IHTMLTxtRange_moveToElementText(range, body);
ok(hres == S_OK, "moveToElementText failed: %08x\n", hres);
test_range_text(range, "abc xyz abc 123\r\nit's text");
test_range_parent(range, ET_BODY);
IHTMLElement_Release(body);
IHTMLTxtRange_Release(range);
}
......
......@@ -1579,8 +1579,22 @@ static HRESULT WINAPI HTMLTxtRange_pasteHTML(IHTMLTxtRange *iface, BSTR html)
static HRESULT WINAPI HTMLTxtRange_moveToElementText(IHTMLTxtRange *iface, IHTMLElement *element)
{
HTMLTxtRange *This = impl_from_IHTMLTxtRange(iface);
FIXME("(%p)->(%p)\n", This, element);
return E_NOTIMPL;
HTMLElement *elem;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, element);
elem = unsafe_impl_from_IHTMLElement(element);
if(!elem)
return E_INVALIDARG;
nsres = nsIDOMRange_SelectNodeContents(This->nsrange, elem->node.nsnode);
if(NS_FAILED(nsres)) {
ERR("SelectNodeContents failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLTxtRange_setEndPoint(IHTMLTxtRange *iface, BSTR how,
......
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