ET_TR,
ET_TD,
ET_IFRAME,
- ET_FORM
+ ET_FORM,
+ ET_FRAME
} elem_type_t;
static const IID * const none_iids[] = {
NULL
};
+static const IID * const frame_iids[] = {
+ &IID_IHTMLDOMNode,
+ &IID_IHTMLDOMNode2,
+ &IID_IHTMLElement,
+ &IID_IHTMLElement2,
+ &IID_IHTMLElement3,
+ &IID_IHTMLFrameBase,
+ &IID_IHTMLFrameBase2,
+ &IID_IDispatchEx,
+ &IID_IConnectionPointContainer,
+ NULL
+};
+
static const IID * const iframe_iids[] = {
&IID_IHTMLDOMNode,
&IID_IHTMLDOMNode2,
&IID_IHTMLElement3,
&IID_IHTMLFrameBase,
&IID_IHTMLFrameBase2,
+ &IID_IHTMLIFrameElement,
&IID_IDispatchEx,
&IID_IConnectionPointContainer,
NULL
{"A", anchor_iids, &DIID_DispHTMLAnchorElement},
{"INPUT", input_iids, &DIID_DispHTMLInputElement},
{"SELECT", select_iids, &DIID_DispHTMLSelectElement},
- {"TEXTAREA", textarea_iids, NULL},
+ {"TEXTAREA", textarea_iids, &DIID_DispHTMLTextAreaElement},
{"OPTION", option_iids, &DIID_DispHTMLOptionElement},
{"STYLE", elem_iids, NULL},
{"BLOCKQUOTE",elem_iids, NULL},
{"BR", elem_iids, NULL},
{"TABLE", table_iids, &DIID_DispHTMLTable},
{"TBODY", elem_iids, NULL},
- {"SCRIPT", script_iids, NULL},
+ {"SCRIPT", script_iids, &DIID_DispHTMLScriptElement},
{"TEST", elem_iids, &DIID_DispHTMLUnknownElement},
{"TEST", generic_iids, &DIID_DispHTMLGenericElement},
{"!", comment_iids, &DIID_DispHTMLCommentElement},
{"TR", tr_iids, &DIID_DispHTMLTableRow},
{"TD", td_iids, NULL},
{"IFRAME", iframe_iids, &DIID_DispHTMLIFrame},
- {"FORM", form_iids, &DIID_DispHTMLFormElement}
+ {"FORM", form_iids, &DIID_DispHTMLFormElement},
+ {"FRAME", frame_iids, &DIID_DispHTMLFrameElement}
};
static const char *dbgstr_guid(REFIID riid)
return text;
}
+#define get_comment_iface(u) _get_comment_iface(__LINE__,u)
+static IHTMLCommentElement *_get_comment_iface(unsigned line, IUnknown *unk)
+{
+ IHTMLCommentElement *comment;
+ HRESULT hres;
+
+ hres = IUnknown_QueryInterface(unk, &IID_IHTMLCommentElement, (void**)&comment);
+ ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLCommentElement: %08x\n", hres);
+ return comment;
+}
+
#define test_node_name(u,n) _test_node_name(__LINE__,u,n)
static void _test_node_name(unsigned line, IUnknown *unk, const char *exname)
{
_test_option_value(line, option, value);
}
+#define test_comment_text(c,t) _test_comment_text(__LINE__,c,t)
+static void _test_comment_text(unsigned line, IUnknown *unk, const char *extext)
+{
+ IHTMLCommentElement *comment = _get_comment_iface(__LINE__,unk);
+ BSTR text;
+ HRESULT hres;
+
+ text = a2bstr(extext);
+ hres = IHTMLCommentElement_get_text(comment, &text);
+ ok_(__FILE__,line)(hres == S_OK, "get_text failed: %08x\n", hres);
+ ok_(__FILE__,line)(!strcmp_wa(text, extext), "text = \"%s\", expected \"%s\"\n", wine_dbgstr_w(text), extext);
+
+ IHTMLCommentElement_Release(comment);
+ SysFreeString(text);
+}
+
#define create_option_elem(d,t,v) _create_option_elem(__LINE__,d,t,v)
static IHTMLOptionElement *_create_option_elem(unsigned line, IHTMLDocument2 *doc,
const char *txt, const char *val)
HRESULT hres;
hres = IHTMLImgElement_get_width(img, &found);
- todo_wine ok_(__FILE__,line) (hres == S_OK, "get_width failed: %08x\n", hres);
- todo_wine ok_(__FILE__,line) (found == exp, "width=%d\n", found);
+ ok_(__FILE__,line) (hres == S_OK, "get_width failed: %08x\n", hres);
+ ok_(__FILE__,line) (found == exp, "width=%d\n", found);
}
#define test_img_put_width(o,w) _test_img_put_width(__LINE__,o,w)
HRESULT hres;
hres = IHTMLImgElement_put_width(img, width);
- todo_wine ok(hres == S_OK, "put_width failed: %08x\n", hres);
+ ok(hres == S_OK, "put_width failed: %08x\n", hres);
_test_img_width(line, img, width);
}
HRESULT hres;
hres = IHTMLImgElement_get_height(img, &found);
- todo_wine ok_(__FILE__,line) (hres == S_OK, "get_height failed: %08x\n", hres);
- todo_wine ok_(__FILE__,line) (found == exp, "height=%d\n", found);
+ ok_(__FILE__,line) (hres == S_OK, "get_height failed: %08x\n", hres);
+ ok_(__FILE__,line) (found == exp, "height=%d\n", found);
}
#define test_img_put_height(o,w) _test_img_put_height(__LINE__,o,w)
HRESULT hres;
hres = IHTMLImgElement_put_height(img, height);
- todo_wine ok(hres == S_OK, "put_height failed: %08x\n", hres);
+ ok(hres == S_OK, "put_height failed: %08x\n", hres);
_test_img_height(line, img, height);
}
SysFreeString(html);
}
+#define test_elem_outerhtml(e,t) _test_elem_outerhtml(__LINE__,e,t)
+static void _test_elem_outerhtml(unsigned line, IUnknown *unk, const char *outer_html)
+{
+ IHTMLElement *elem = _get_elem_iface(line, unk);
+ BSTR html;
+ HRESULT hres;
+
+ hres = IHTMLElement_get_outerHTML(elem, &html);
+ ok_(__FILE__,line)(hres == S_OK, "get_outerHTML failed: %08x\n", hres);
+ ok_(__FILE__,line)(!strcmp_wa(html, outer_html), "outerHTML = '%s', expected '%s'\n", wine_dbgstr_w(html), outer_html);
+
+ IHTMLElement_Release(elem);
+ SysFreeString(html);
+}
+
#define get_first_child(n) _get_first_child(__LINE__,n)
static IHTMLDOMNode *_get_first_child(unsigned line, IUnknown *unk)
{
ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
+ V_VT(&v) = VT_I4;
+ V_I4(&v) = 100;
+ hres = IHTMLStyle_put_width(style, v);
+ ok(hres == S_OK, "put_width failed: %08x\n", hres);
+
+ V_VT(&v) = VT_EMPTY;
+ hres = IHTMLStyle_get_width(style, &v);
+ ok(hres == S_OK, "get_width failed: %08x\n", hres);
+ ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
+ ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v)=%s\n", wine_dbgstr_w(V_BSTR(&v)));
+ VariantClear(&v);
+
/* margin tests */
str = (void*)0xdeadbeef;
hres = IHTMLStyle_get_margin(style, &str);
*/
V_BSTR(&v) = NULL;
hres = IHTMLStyle_get_borderRightColor(style, &v);
- todo_wine ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
- todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
+ ok(hres == S_OK, "get_borderRightColor failed: %08x\n", hres);
+ ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
V_BSTR(&v) = NULL;
*/
V_BSTR(&v) = NULL;
hres = IHTMLStyle_get_borderTopColor(style, &v);
- todo_wine ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
- todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
+ ok(hres == S_OK, "get_borderTopColor failed: %08x\n", hres);
+ ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
V_BSTR(&v) = NULL;
*/
V_BSTR(&v) = NULL;
hres = IHTMLStyle_get_borderBottomColor(style, &v);
- todo_wine ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
- todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
+ ok(hres == S_OK, "get_borderBottomColor failed: %08x\n", hres);
+ ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
V_BSTR(&v) = NULL;
*/
V_BSTR(&v) = NULL;
hres = IHTMLStyle_get_borderLeftColor(style, &v);
- todo_wine ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
- todo_wine ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
+ ok(hres == S_OK, "get_borderLeftColor failed: %08x\n", hres);
+ ok(!strcmp_wa(V_BSTR(&v), "red"), "str=%s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
V_BSTR(&v) = NULL;
SafeArrayDestroy(sa);
}
-static void test_frame_doc(IUnknown *frame_elem)
+static void test_frame_doc(IUnknown *frame_elem, BOOL iframe)
{
IHTMLDocument2 *window_doc, *elem_doc;
+ IHTMLFrameElement3 *frame_elem3;
IHTMLWindow2 *content_window;
+ HRESULT hres;
content_window = get_frame_content_window(frame_elem);
window_doc = get_window_doc(content_window);
elem_doc = get_elem_doc(frame_elem);
ok(iface_cmp((IUnknown*)window_doc, (IUnknown*)elem_doc), "content_doc != elem_doc\n");
+ if(!iframe) {
+ hres = IUnknown_QueryInterface(frame_elem, &IID_IHTMLFrameElement3, (void**)&frame_elem3);
+ if(SUCCEEDED(hres)) {
+ IDispatch *disp = NULL;
+
+ hres = IHTMLFrameElement3_get_contentDocument(frame_elem3, &disp);
+ ok(hres == S_OK, "get_contentDocument failed: %08x\n", hres);
+ ok(disp != NULL, "contentDocument == NULL\n");
+ ok(iface_cmp((IUnknown*)disp, (IUnknown*)window_doc), "contentDocument != contentWindow.document\n");
+
+ IDispatch_Release(disp);
+ IHTMLFrameElement3_Release(frame_elem3);
+ }else {
+ win_skip("IHTMLFrameElement3 not supported\n");
+ }
+ }
+
IHTMLDocument2_Release(elem_doc);
IHTMLDocument2_Release(window_doc);
}
ET_BR
};
- test_frame_doc((IUnknown*)elem);
+ test_frame_doc((IUnknown*)elem, TRUE);
content_window = get_frame_content_window((IUnknown*)elem);
test_window_length(content_window, 0);
{
VARIANT_BOOL vb;
+ hres = IHTMLScriptElement_put_type (script, NULL);
+ ok(hres == S_OK, "put_type failed: %08x\n", hres);
+ hres = IHTMLScriptElement_get_type(script, &type);
+ ok(hres == S_OK, "get_type failed: %08x\n", hres);
+ ok(type == NULL, "Unexpected type %s\n", wine_dbgstr_w(type));
+
+ hres = IHTMLScriptElement_put_type (script, a2bstr ("text/javascript"));
+ ok(hres == S_OK, "put_type failed: %08x\n", hres);
hres = IHTMLScriptElement_get_type(script, &type);
ok(hres == S_OK, "get_type failed: %08x\n", hres);
ok(!strcmp_wa(type, "text/javascript"), "Unexpected type %s\n", wine_dbgstr_w(type));
+
SysFreeString(type);
/* test defer */
ok(type == 8, "type=%d, expected 8\n", type);
test_node_get_value_str((IUnknown*)comment, "testing");
+ test_elem_title((IUnknown*)comment, NULL);
+ test_elem_set_title((IUnknown*)comment, "comment title");
+ test_elem_title((IUnknown*)comment, "comment title");
+ test_comment_text((IUnknown*)comment, "<!--testing-->");
+ test_elem_outerhtml((IUnknown*)comment, "<!--testing-->");
IHTMLDOMNode_Release(comment);
}
IHTMLElement_Release(body);
}
+static void test_null_write(IHTMLDocument2 *doc)
+{
+ HRESULT hres;
+
+ doc_write(doc, FALSE, NULL);
+ doc_write(doc, TRUE, NULL);
+
+ hres = IHTMLDocument2_write(doc, NULL);
+ ok(hres == S_OK,
+ "Expected IHTMLDocument2::write to return S_OK, got 0x%08x\n", hres);
+
+ hres = IHTMLDocument2_writeln(doc, NULL);
+ ok(hres == S_OK,
+ "Expected IHTMLDocument2::writeln to return S_OK, got 0x%08x\n", hres);
+}
+
static void test_exec(IUnknown *unk, const GUID *grpid, DWORD cmdid, VARIANT *in, VARIANT *out)
{
IOleCommandTarget *cmdtrg;
if(FAILED(hres))
return;
- test_frame_doc((IUnknown*)frame_elem);
+ test_elem_type((IUnknown*)frame_elem, ET_FRAME);
+ test_frame_doc((IUnknown*)frame_elem, FALSE);
test_elem_id((IUnknown*)frame_elem, exp_id);
IHTMLElement_Release(frame_elem);
run_domtest(elem_test2_str, test_elems2);
run_domtest(doc_blank, test_create_elems);
run_domtest(doc_blank, test_defaults);
+ run_domtest(doc_blank, test_null_write);
run_domtest(indent_test_str, test_indent);
run_domtest(cond_comment_str, test_cond_comment);
run_domtest(frameset_str, test_frameset);