From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/htmlstyle.c | 21 +++++++++++------- dlls/mshtml/htmlstyle.h | 1 + dlls/mshtml/tests/style.c | 46 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 58 insertions(+), 10 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 2e9acc4ad86..3fa8954dbb6 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -408,6 +408,11 @@ static const style_tbl_entry_t style_tbl[] = { DISPID_UNKNOWN, ATTR_COMPAT_IE10 }, + { + L"content", + DISPID_IHTMLCSSSTYLEDECLARATION_CONTENT, + DISPID_IHTMLSTYLE6_CONTENT + }, { L"cursor", DISPID_IHTMLCSSSTYLEDECLARATION_CURSOR, @@ -4182,15 +4187,15 @@ DISPEX_IDISPATCH_IMPL(HTMLStyle6, IHTMLStyle6, impl_from_IHTMLStyle6(iface)->css static HRESULT WINAPI HTMLStyle6_put_content(IHTMLStyle6 *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle6(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + return set_style_property(&This->css_style, STYLEID_CONTENT, v); }
static HRESULT WINAPI HTMLStyle6_get_content(IHTMLStyle6 *iface, BSTR *p) { HTMLStyle *This = impl_from_IHTMLStyle6(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, p); + return get_style_property(&This->css_style, STYLEID_CONTENT, p); }
static HRESULT WINAPI HTMLStyle6_put_contentSide(IHTMLStyle6 *iface, BSTR v) @@ -6499,15 +6504,15 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_maxWidth(IHTMLCSSStyleDeclarat static HRESULT WINAPI HTMLCSSStyleDeclaration_put_content(IHTMLCSSStyleDeclaration *iface, BSTR v) { CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + return set_style_property(This, STYLEID_CONTENT, v); }
static HRESULT WINAPI HTMLCSSStyleDeclaration_get_content(IHTMLCSSStyleDeclaration *iface, BSTR *p) { CSSStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, p); + return get_style_property(This, STYLEID_CONTENT, p); }
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_captionSide(IHTMLCSSStyleDeclaration *iface, BSTR v) diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index 3ce9d9d1a4a..0ecd8ec3205 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -91,6 +91,7 @@ typedef enum { STYLEID_COLUMN_RULE_WIDTH, STYLEID_COLUMN_SPAN, STYLEID_COLUMN_WIDTH, + STYLEID_CONTENT, STYLEID_CURSOR, STYLEID_DIRECTION, STYLEID_DISPLAY, diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c index 8d33b85af84..be5c796f7cc 100644 --- a/dlls/mshtml/tests/style.c +++ b/dlls/mshtml/tests/style.c @@ -726,7 +726,7 @@ static void test_style5(IHTMLStyle5 *style5) VariantClear(&vdefault); }
-static void test_style6(IHTMLStyle6 *style) +static void test_style6(IHTMLStyle6 *style, IHTMLCSSStyleDeclaration *css_style) { BSTR str; HRESULT hres; @@ -782,6 +782,48 @@ static void test_style6(IHTMLStyle6 *style) ok(hres == S_OK, "get_borderSpacing failed: %08lx\n", hres); ok(!lstrcmpW(str, L"10px"), "borderSpacing = %s\n", wine_dbgstr_w(str)); SysFreeString(str); + + hres = IHTMLStyle6_get_content(style, &str); + ok(hres == S_OK, "get_content failed: %08lx\n", hres); + ok(!str, "content = %s\n", debugstr_w(str)); + + if(css_style) { + hres = IHTMLCSSStyleDeclaration_get_content(css_style, &str); + ok(hres == S_OK, "get_content failed: %08lx\n", hres); + ok(!str, "content = %s\n", debugstr_w(str)); + } + + str = SysAllocString(L"normal"); + hres = IHTMLStyle6_put_content(style, str); + ok(hres == S_OK, "put_content failed: %08lx\n", hres); + SysFreeString(str); + + hres = IHTMLStyle6_get_content(style, &str); + ok(hres == S_OK, "get_content failed: %08lx\n", hres); + ok(!wcscmp(str, L"normal"), "content = %s\n", debugstr_w(str)); + SysFreeString(str); + + if(css_style) { + hres = IHTMLCSSStyleDeclaration_get_content(css_style, &str); + ok(hres == S_OK, "get_content failed: %08lx\n", hres); + ok(!wcscmp(str, L"normal"), "content = %s\n", debugstr_w(str)); + SysFreeString(str); + + str = SysAllocString(L"none"); + hres = IHTMLCSSStyleDeclaration_put_content(css_style, str); + ok(hres == S_OK, "put_content failed: %08lx\n", hres); + SysFreeString(str); + + hres = IHTMLCSSStyleDeclaration_get_content(css_style, &str); + ok(hres == S_OK, "get_content failed: %08lx\n", hres); + ok(!wcscmp(str, L"none"), "content = %s\n", debugstr_w(str)); + SysFreeString(str); + + hres = IHTMLStyle6_get_content(style, &str); + ok(hres == S_OK, "get_content failed: %08lx\n", hres); + ok(!wcscmp(str, L"none"), "content = %s\n", debugstr_w(str)); + SysFreeString(str); + } }
static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style) @@ -3343,7 +3385,7 @@ static void test_body_style(IHTMLStyle *style)
hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle6, (void**)&style6); if(SUCCEEDED(hres)) { - test_style6(style6); + test_style6(style6, css_style); IHTMLStyle6_Release(style6); }else { win_skip("IHTMLStyle6 not available\n");