39 nsres = nsIDOMHTMLDocument_GetElementById(doc->
nsdoc, &id_str, &nselem);
41 ERR(
"GetElementById failed: %08x\n", nsres);
47 nsres = nsIDOMHTMLDocument_GetElementsByName(doc->
nsdoc, &id_str, &nsnode_list);
50 ERR(
"getElementsByName failed: %08x\n", nsres);
52 nsIDOMElement_Release(nselem);
56 nsres = nsIDOMNodeList_Item(nsnode_list, 0, &nsnode);
57 nsIDOMNodeList_Release(nsnode_list);
60 if(nsnode && nselem) {
63 nsres = nsIDOMNode_CompareDocumentPosition(nsnode, (
nsIDOMNode*)nselem, &
pos);
65 FIXME(
"CompareDocumentPosition failed: 0x%08x\n", nsres);
66 nsIDOMNode_Release(nsnode);
67 nsIDOMElement_Release(nselem);
71 TRACE(
"CompareDocumentPosition gave: 0x%x\n",
pos);
72 if(!(
pos & (DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS))) {
73 nsIDOMElement_Release(nselem);
80 nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (
void**)&nselem);
83 nsIDOMNode_Release(nsnode);
92 nsIDOMElement_Release(nselem);
106 nsres = nsIDOMHTMLDocument_GetCharacterSet(doc->
nsdoc, &charset_str);
118 ERR(
"GetCharset failed: %08x\n", nsres);
158 return IDispatchEx_GetTypeInfoCount(&
This->IDispatchEx_iface, pctinfo);
166 return IDispatchEx_GetTypeInfo(&
This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
175 return IDispatchEx_GetIDsOfNames(&
This->IDispatchEx_iface,
riid, rgszNames, cNames, lcid,
181 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
185 return IDispatchEx_Invoke(&
This->IDispatchEx_iface, dispIdMember,
riid, lcid,
wFlags,
186 pDispParams, pVarResult, pExcepInfo, puArgErr);
196 IDispatch_AddRef(*
p);
210 if(!
This->doc_node->nsdoc) {
211 WARN(
"NULL nsdoc\n");
215 nsres = nsIDOMHTMLDocument_GetDocumentElement(
This->doc_node->nsdoc, &nselem);
217 ERR(
"GetDocumentElement failed: %08x\n", nsres);
227 nsIDOMElement_Release(nselem);
245 if(
This->doc_node->nsdoc) {
248 nsres = nsIDOMHTMLDocument_GetBody(
This->doc_node->nsdoc, &nsbody);
250 TRACE(
"Could not get body: %08x\n", nsres);
261 nsIDOMHTMLElement_Release(nsbody);
265 hres = IHTMLDOMNode_QueryInterface(&
node->IHTMLDOMNode_iface, &IID_IHTMLElement, (
void**)
p);
280 if(!
This->doc_node->nsdoc) {
289 nsres = nsIDOMHTMLDocument_GetActiveElement(
This->doc_node->nsdoc, &nselem);
291 ERR(
"GetActiveElement failed: %08x\n", nsres);
301 nsIDOMElement_Release(nselem);
305 *
p = &
elem->IHTMLElement_iface;
322 if(!
This->doc_node->nsdoc) {
323 WARN(
"NULL nsdoc\n");
327 nsres = nsIDOMHTMLDocument_GetImages(
This->doc_node->nsdoc, &nscoll);
329 ERR(
"GetImages failed: %08x\n", nsres);
335 nsIDOMHTMLCollection_Release(nscoll);
354 if(!
This->doc_node->nsdoc) {
355 WARN(
"NULL nsdoc\n");
359 nsres = nsIDOMHTMLDocument_GetApplets(
This->doc_node->nsdoc, &nscoll);
361 ERR(
"GetApplets failed: %08x\n", nsres);
367 nsIDOMHTMLCollection_Release(nscoll);
386 if(!
This->doc_node->nsdoc) {
387 WARN(
"NULL nsdoc\n");
391 nsres = nsIDOMHTMLDocument_GetLinks(
This->doc_node->nsdoc, &nscoll);
393 ERR(
"GetLinks failed: %08x\n", nsres);
399 nsIDOMHTMLCollection_Release(nscoll);
418 if(!
This->doc_node->nsdoc) {
419 WARN(
"NULL nsdoc\n");
423 nsres = nsIDOMHTMLDocument_GetForms(
This->doc_node->nsdoc, &nscoll);
425 ERR(
"GetForms failed: %08x\n", nsres);
431 nsIDOMHTMLCollection_Release(nscoll);
450 if(!
This->doc_node->nsdoc) {
451 WARN(
"NULL nsdoc\n");
455 nsres = nsIDOMHTMLDocument_GetAnchors(
This->doc_node->nsdoc, &nscoll);
457 ERR(
"GetAnchors failed: %08x\n", nsres);
463 nsIDOMHTMLCollection_Release(nscoll);
477 if(!
This->doc_node->nsdoc) {
478 WARN(
"NULL nsdoc\n");
483 nsres = nsIDOMHTMLDocument_SetTitle(
This->doc_node->nsdoc, &nsstr);
486 ERR(
"SetTitle failed: %08x\n", nsres);
500 if(!
This->doc_node->nsdoc) {
501 WARN(
"NULL nsdoc\n");
507 nsres = nsIDOMHTMLDocument_GetTitle(
This->doc_node->nsdoc, &nsstr);
515 ERR(
"GetTitle failed: %08x\n", nsres);
535 if(!
This->doc_node->nsdoc) {
536 WARN(
"NULL nsdoc\n");
540 nsres = nsIDOMHTMLDocument_GetScripts(
This->doc_node->nsdoc, &nscoll);
542 ERR(
"GetImages failed: %08x\n", nsres);
548 nsIDOMHTMLCollection_Release(nscoll);
559 static const WCHAR onW[] = {
'o',
'n',0};
579 static const WCHAR szOff[] = {
'O',
'f',
'f',0};
580 FIXME(
"(%p)->(%p) always returning Off\n",
This,
p);
598 nsres = nsIDOMWindow_GetSelection(
This->window->nswindow, &nsselection);
600 ERR(
"GetSelection failed: %08x\n", nsres);
612 TRACE(
"(%p)->(%p)\n", iface,
p);
626 return IHTMLWindow2_get_frames(&
This->window->base.IHTMLWindow2_iface,
p);
733 if(!
This->doc_node->nsdoc) {
734 WARN(
"NULL nsdoc\n");
738 return IHTMLWindow2_get_location(&
This->window->base.IHTMLWindow2_iface,
p);
755 FIXME(
"No window available\n");
767 {
'a',
'b',
'o',
'u',
't',
':',
'b',
'l',
'a',
'n',
'k',0};
769 TRACE(
"(%p)->(%p)\n", iface,
p);
789 if(!
This->window || !
This->window->uri) {
790 FIXME(
"No current URI\n");
794 hres = IUri_GetHost(
This->window->uri,
p);
884 if(!
This->doc_node->nsdoc) {
885 FIXME(
"NULL nsdoc\n");
890 nsres = nsIDOMHTMLDocument_GetCharacterSet(
This->doc_node->nsdoc, &charset_str);
973 if(!
This->doc_node->nsdoc) {
974 WARN(
"NULL nsdoc\n");
981 if(psarray->
cDims != 1) {
988 WARN(
"SafeArrayAccessData failed: %08x\n",
hres);
1008 if(!ln ||
i !=
argc-1)
1009 nsres = nsIDOMHTMLDocument_Write(
This->doc_node->nsdoc, &nsstr, jsctx);
1011 nsres = nsIDOMHTMLDocument_Writeln(
This->doc_node->nsdoc, &nsstr, jsctx);
1016 ERR(
"Write failed: %08x\n", nsres);
1031 TRACE(
"(%p)->(%p)\n", iface, psarray);
1052 static const WCHAR text_htmlW[] = {
't',
'e',
'x',
't',
'/',
'h',
't',
'm',
'l',0};
1057 if(!
This->doc_node->nsdoc) {
1064 FIXME(
"unsupported args\n");
1069 ERR(
"Open failed: %08x\n", nsres);
1074 nsISupports_Release(tmp);
1076 *pomWindowResult = (
IDispatch*)&
This->window->base.IHTMLWindow2_iface;
1077 IHTMLWindow2_AddRef(&
This->window->base.IHTMLWindow2_iface);
1088 if(!
This->doc_node->nsdoc) {
1093 nsres = nsIDOMHTMLDocument_Close(
This->doc_node->nsdoc);
1095 ERR(
"Close failed: %08x\n", nsres);
1109 nsres = nsIDOMHTMLDocument_Clear(
This->doc_node->nsdoc);
1111 ERR(
"Clear failed: %08x\n", nsres);
1119 {
'c',
'o',
'p',
'y',0};
1123 {
'f',
'o',
'n',
't',
'n',
'a',
'm',
'e',0};
1125 {
'f',
'o',
'n',
't',
's',
'i',
'z',
'e',0};
1127 {
'i',
'n',
'd',
'e',
'n',
't',0};
1129 {
'i',
'n',
's',
'e',
'r',
't',
'o',
'r',
'd',
'e',
'r',
'e',
'd',
'l',
'i',
's',
't',0};
1131 {
'i',
'n',
's',
'e',
'r',
't',
'u',
'n',
'o',
'r',
'd',
'e',
'r',
'e',
'd',
'l',
'i',
's',
't',0};
1133 {
'o',
'u',
't',
'd',
'e',
'n',
't',0};
1135 {
'p',
'a',
's',
't',
'e',0};
1137 {
'r',
'e',
's',
'p',
'e',
'c',
't',
'v',
'i',
's',
'i',
'b',
'i',
'l',
'i',
't',
'y',
'i',
'n',
'd',
'e',
's',
'i',
'g',
'n',0};
1139static const struct {
1229 return OLECMDERR_E_NOTSUPPORTED;
1232 hres = IOleCommandTarget_Exec(&
This->IOleCommandTarget_iface, &CGID_MSHTML, cmdid,
1233 showUI ? 0 : OLECMDEXECOPT_DONTPROMPTUSER, &
value, &
ret);
1242 *pfRet = VARIANT_TRUE;
1255 IHTMLElement **newElem)
1267 *newElem = &
elem->IHTMLElement_iface;
1562 IHTMLElement **elementHit)
1570 TRACE(
"(%p)->(%d %d %p)\n",
This,
x,
y, elementHit);
1572 nsres = nsIDOMHTMLDocument_ElementFromPoint(
This->doc_node->nsdoc,
x,
y, &nselem);
1574 ERR(
"ElementFromPoint failed: %08x\n", nsres);
1584 nsIDOMElement_Release(nselem);
1588 hres = IHTMLDOMNode_QueryInterface(&
node->IHTMLDOMNode_iface, &IID_IHTMLElement, (
void**)elementHit);
1599 *
p = &
This->window->base.IHTMLWindow2_iface;
1600 IHTMLWindow2_AddRef(*
p);
1605 IHTMLStyleSheetsCollection **
p)
1615 if(!
This->doc_node->nsdoc) {
1616 WARN(
"NULL nsdoc\n");
1620 nsres = nsIDOMHTMLDocument_GetStyleSheets(
This->doc_node->nsdoc, &nsstylelist);
1622 ERR(
"GetStyleSheets failed: %08x\n", nsres);
1627 nsIDOMStyleSheetList_Release(nsstylelist);
1664 static const WCHAR objectW[] = {
'[',
'o',
'b',
'j',
'e',
'c',
't',
']',0};
1677 LONG lIndex, IHTMLStyleSheet **ppnewStyleSheet)
1681 IHTMLStyleElement *style_elem;
1686 static const WCHAR styleW[] = {
's',
't',
'y',
'l',
'e',0};
1690 if(!
This->doc_node->nsdoc) {
1691 FIXME(
"not a real doc object\n");
1696 FIXME(
"Unsupported lIndex %d\n", lIndex);
1698 if(bstrHref && *bstrHref) {
1708 nsres = nsIDOMHTMLDocument_GetHead(
This->doc_node->nsdoc, &head_elem);
1712 nsres = nsIDOMHTMLHeadElement_QueryInterface(head_elem, &IID_nsIDOMNode, (
void**)&head_node);
1713 nsIDOMHTMLHeadElement_Release(head_elem);
1716 nsres = nsIDOMNode_AppendChild(head_node,
elem->node.nsnode, &tmp_node);
1717 nsIDOMNode_Release(head_node);
1719 nsIDOMNode_Release(tmp_node);
1722 IHTMLElement_Release(&
elem->IHTMLElement_iface);
1726 hres = IHTMLElement_QueryInterface(&
elem->IHTMLElement_iface, &IID_IHTMLStyleElement, (
void**)&style_elem);
1728 IHTMLElement_Release(&
elem->IHTMLElement_iface);
1730 hres = IHTMLStyleElement_get_styleSheet(style_elem, ppnewStyleSheet);
1731 IHTMLStyleElement_Release(style_elem);
1881 return IDispatchEx_GetTypeInfoCount(&
This->IDispatchEx_iface, pctinfo);
1888 return IDispatchEx_GetTypeInfo(&
This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
1896 return IDispatchEx_GetIDsOfNames(&
This->IDispatchEx_iface,
riid, rgszNames, cNames, lcid,
1902 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
1905 return IDispatchEx_Invoke(&
This->IDispatchEx_iface, dispIdMember,
riid, lcid,
wFlags,
1906 pDispParams, pVarResult, pExcepInfo, puArgErr);
1920 WARN(
"(%p)->(%x)\n",
This, fForce);
1927 IHTMLDOMNode **newTextNode)
1938 if(!
This->doc_node->nsdoc) {
1939 WARN(
"NULL nsdoc\n");
1944 nsres = nsIDOMHTMLDocument_CreateTextNode(
This->doc_node->nsdoc, &text_str, &nstext);
1947 ERR(
"CreateTextNode failed: %08x\n", nsres);
1952 nsIDOMText_Release(nstext);
1956 *newTextNode = &
node->IHTMLDOMNode_iface;
1970 if(
This->window->readystate == READYSTATE_UNINITIALIZED) {
1975 if(!
This->doc_node->nsdoc) {
1976 WARN(
"NULL nsdoc\n");
1980 nsres = nsIDOMHTMLDocument_GetDocumentElement(
This->doc_node->nsdoc, &nselem);
1982 ERR(
"GetDocumentElement failed: %08x\n", nsres);
1992 nsIDOMElement_Release(nselem);
1996 hres = IHTMLDOMNode_QueryInterface(&
node->IHTMLDOMNode_iface, &IID_IHTMLElement, (
void**)
p);
2173 IHTMLDocument2 **ppNewDoc)
2183 if(!
This->doc_node->nsdoc) {
2184 FIXME(
"NULL nsdoc\n");
2188 nsres = nsIDOMHTMLDocument_CreateDocumentFragment(
This->doc_node->nsdoc, &doc_frag);
2190 ERR(
"CreateDocumentFragment failed: %08x\n", nsres);
2195 nsIDOMDocumentFragment_Release(doc_frag);
2247 return IHTMLDOMNode_get_childNodes(&
This->doc_node->node.IHTMLDOMNode_iface,
p);
2281 IHTMLElementCollection **ppelColl)
2289 static const WCHAR formatW[] = {
'*',
'[',
'i',
'd',
'=',
'%',
's',
']',
',',
'*',
'[',
'n',
'a',
'm',
'e',
'=',
'%',
's',
']',0};
2293 if(!
This->doc_node || !
This->doc_node->nsdoc) {
2295 FIXME(
"No nsdoc\n");
2310 nsres = nsIDOMHTMLDocument_QuerySelectorAll(
This->doc_node->nsdoc, &selector_str, &node_list);
2314 ERR(
"QuerySelectorAll failed: %08x\n", nsres);
2319 nsIDOMNodeList_Release(node_list);
2339 *pel = &
elem->IHTMLElement_iface;
2345 IHTMLElementCollection **pelColl)
2354 if(!
This->doc_node->nsdoc) {
2355 WARN(
"NULL nsdoc\n");
2360 nsres = nsIDOMHTMLDocument_GetElementsByTagName(
This->doc_node->nsdoc, &id_str, &nslist);
2363 ERR(
"GetElementByName failed: %08x\n", nsres);
2368 nsIDOMNodeList_Release(nslist);
2451 return IDispatchEx_GetTypeInfoCount(&
This->IDispatchEx_iface, pctinfo);
2458 return IDispatchEx_GetTypeInfo(&
This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2466 return IDispatchEx_GetIDsOfNames(&
This->IDispatchEx_iface,
riid, rgszNames, cNames, lcid,
2472 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
2475 return IDispatchEx_Invoke(&
This->IDispatchEx_iface, dispIdMember,
riid, lcid,
wFlags,
2476 pDispParams, pVarResult, pExcepInfo, puArgErr);
2487 nsres = nsIDOMHTMLDocument_GetBody(
This->doc_node->nsdoc, &nsbody);
2489 ERR(
"GetBody failed: %08x\n", nsres);
2493 nsres = nsIDOMHTMLElement_Focus(nsbody);
2494 nsIDOMHTMLElement_Release(nsbody);
2496 ERR(
"Focus failed: %08x\n", nsres);
2532 BSTR bstrOptions, IHTMLDocument2 **newDoc)
2554 VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
2573 TRACE(
"(%p)->(%s %p %p)\n",
This,
debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
2575 return dispatch_event(&
This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled);
2579 IHTMLRenderStyle **ppIHTMLRenderStyle)
2658 return IDispatchEx_GetTypeInfoCount(&
This->IDispatchEx_iface, pctinfo);
2665 return IDispatchEx_GetTypeInfo(&
This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2672 return IDispatchEx_GetIDsOfNames(&
This->IDispatchEx_iface,
riid, rgszNames, cNames, lcid,
2678 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
2681 return IDispatchEx_Invoke(&
This->IDispatchEx_iface, dispIdMember,
riid, lcid,
wFlags,
2682 pDispParams, pVarResult, pExcepInfo, puArgErr);
2727 IHTMLDOMAttribute **ppattribute)
2739 *ppattribute = &
attr->IHTMLDOMAttribute_iface;
2744 IHTMLDOMNode **ppRetNode)
2755 if(!
This->doc_node->nsdoc) {
2756 WARN(
"NULL nsdoc\n");
2761 nsres = nsIDOMHTMLDocument_CreateComment(
This->doc_node->nsdoc, &
str, &nscomment);
2764 ERR(
"CreateTextNode failed: %08x\n", nsres);
2769 nsIDOMComment_Release(nscomment);
2773 *ppRetNode = &
elem->node.IHTMLDOMNode_iface;
2869 if(!
This->doc_node->nsdoc) {
2870 WARN(
"NULL nsdoc\n");
2875 nsres = nsIDOMHTMLDocument_GetCompatMode(
This->doc_node->nsdoc, &mode_str);
2935 return IDispatchEx_GetTypeInfoCount(&
This->IDispatchEx_iface, pctinfo);
2942 return IDispatchEx_GetTypeInfo(&
This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
2949 return IDispatchEx_GetIDsOfNames(&
This->IDispatchEx_iface,
riid, rgszNames, cNames, lcid,
2955 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
2958 return IDispatchEx_Invoke(&
This->IDispatchEx_iface, dispIdMember,
riid, lcid,
wFlags,
2959 pDispParams, pVarResult, pExcepInfo, puArgErr);
2963 IHTMLDocumentCompatibleInfoCollection **
p)
3009 BSTR bstrId, IHTMLElement2 **
p)
3067 return IDispatchEx_GetTypeInfoCount(&
This->IDispatchEx_iface, pctinfo);
3074 return IDispatchEx_GetTypeInfo(&
This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
3081 return IDispatchEx_GetIDsOfNames(&
This->IDispatchEx_iface,
riid, rgszNames, cNames, lcid,
3087 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
3090 return IDispatchEx_Invoke(&
This->IDispatchEx_iface, dispIdMember,
riid, lcid,
wFlags,
3091 pDispParams, pVarResult, pExcepInfo, puArgErr);
3104 FIXME(
"(%p)->(%p)\n",
This, newCDATASectionNode);
3111 FIXME(
"(%p)->(%p)\n",
This, ppIHTMLSelection);
3116 BSTR bstrLocalName, IHTMLElementCollection **pelColl)
3131 BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute)
3181 BSTR data, IDOMProcessingInstruction **newProcessingInstruction)
3191 FIXME(
"(%p)->(%p %p)\n",
This, pNodeSource, ppNodeDest);
3261 FIXME(
"(%p)->(%p)\n",
This, pfHasAttributes);