Module: wine Branch: master Commit: f13c5685b5789e2cff5fe3b6501123c64ae181e7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f13c5685b5789e2cff5fe3b650...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Jun 19 16:14:03 2008 -0500
mshtml: Added IHTMLDocument2::createElement implementation.
---
dlls/mshtml/htmldoc.c | 27 +++++++++++++++++++++++++-- 1 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index fa9e16f..189ea43 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -878,8 +878,31 @@ static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTa IHTMLElement **newElem) { HTMLDocument *This = HTMLDOC_THIS(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem); - return E_NOTIMPL; + nsIDOMDocument *nsdoc; + nsIDOMElement *nselem; + HTMLElement *elem; + nsAString tag_str; + nsresult nsres; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem); + + nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc); + + nsAString_Init(&tag_str, eTag); + nsres = nsIDOMDocument_CreateElement(nsdoc, &tag_str, &nselem); + nsAString_Finish(&tag_str); + nsIDOMDocument_Release(nsdoc); + if(NS_FAILED(nsres)) { + ERR("CreateElement failed: %08x\n", nsres); + return E_FAIL; + } + + elem = HTMLElement_Create(This, (nsIDOMNode*)nselem); + nsIDOMElement_Release(nselem); + + *newElem = HTMLELEM(elem); + IHTMLElement_AddRef(HTMLELEM(elem)); + return S_OK; }
static HRESULT WINAPI HTMLDocument_put_onhelp(IHTMLDocument2 *iface, VARIANT v)