Jacek Caban : mshtml: Added IHTMLStyle::[get|put]_filter implementation.
Alexandre Julliard
julliard at winehq.org
Wed Oct 8 08:32:51 CDT 2008
Module: wine
Branch: master
Commit: 7918196ee8a73023f79ef89fc22e4b6ed203fec6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7918196ee8a73023f79ef89fc22e4b6ed203fec6
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Oct 7 14:45:46 2008 -0500
mshtml: Added IHTMLStyle::[get|put]_filter implementation.
---
dlls/mshtml/htmlstyle.c | 17 +++++++++++++----
dlls/mshtml/htmlstyle.h | 1 +
dlls/mshtml/tests/dom.c | 10 ++++++++++
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index b315f55..48ae2fe 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -50,6 +50,8 @@ static const WCHAR attrCursor[] =
{'c','u','r','s','o','r',0};
static const WCHAR attrDisplay[] =
{'d','i','s','p','l','a','y',0};
+static const WCHAR attrFilter[] =
+ {'f','i','l','e','t','e','r',0};
static const WCHAR attrFontFamily[] =
{'f','o','n','t','-','f','a','m','i','l','y',0};
static const WCHAR attrFontSize[] =
@@ -99,6 +101,7 @@ static const struct{
{attrColor, DISPID_IHTMLSTYLE_COLOR},
{attrCursor, DISPID_IHTMLSTYLE_CURSOR},
{attrDisplay, DISPID_IHTMLSTYLE_DISPLAY},
+ {attrFilter, DISPID_IHTMLSTYLE_FILTER},
{attrFontFamily, DISPID_IHTMLSTYLE_FONTFAMILY},
{attrFontSize, DISPID_IHTMLSTYLE_FONTSIZE},
{attrFontStyle, DISPID_IHTMLSTYLE_FONTSTYLE},
@@ -1873,15 +1876,21 @@ static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_filter(IHTMLStyle *iface, BSTR v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(v));
- return E_NOTIMPL;
+
+ WARN("(%p)->(%s)\n", This, debugstr_w(v));
+
+ /* FIXME: Handle MS-style filters */
+ return set_style_attr(This, STYLEID_FILTER, v, 0);
}
static HRESULT WINAPI HTMLStyle_get_filter(IHTMLStyle *iface, BSTR *p)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ WARN("(%p)->(%p)\n", This, p);
+
+ /* FIXME: Handle MS-style filters */
+ return get_style_attr(This, STYLEID_FILTER, p);
}
static HRESULT WINAPI HTMLStyle_setAttribute(IHTMLStyle *iface, BSTR strAttributeName,
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index 0ed7d6d..5c1dfe3 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -39,6 +39,7 @@ typedef enum {
STYLEID_COLOR,
STYLEID_CURSOR,
STYLEID_DISPLAY,
+ STYLEID_FILTER,
STYLEID_FONT_FAMILY,
STYLEID_FONT_SIZE,
STYLEID_FONT_STYLE,
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index c23a6fb..82dd655 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2266,6 +2266,16 @@ static void test_default_style(IHTMLStyle *style)
ok(!strcmp_wa(str, "center"), "textAlign = %s\n", dbgstr_w(V_BSTR(&v)));
SysFreeString(str);
+ str = (void*)0xdeadbeef;
+ hres = IHTMLStyle_get_filter(style, &str);
+ ok(hres == S_OK, "get_filter failed: %08x\n", hres);
+ ok(!str, "filter != NULL\n");
+
+ str = a2bstr("alpha(opacity=100)");
+ hres = IHTMLStyle_put_filter(style, str);
+ ok(hres == S_OK, "put_filter failed: %08x\n", hres);
+ SysFreeString(str);
+
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_zIndex(style, &v);
ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);
More information about the wine-cvs
mailing list