Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0131e047
Commit
0131e047
authored
Feb 28, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store style filter in HTMLStyle object.
parent
62428749
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
6 deletions
+71
-6
htmlstyle.c
dlls/mshtml/htmlstyle.c
+22
-6
htmlstyle.h
dlls/mshtml/htmlstyle.h
+1
-0
dom.c
dlls/mshtml/tests/dom.c
+48
-0
No files found.
dlls/mshtml/htmlstyle.c
View file @
0131e047
...
@@ -633,6 +633,7 @@ static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
...
@@ -633,6 +633,7 @@ static ULONG WINAPI HTMLStyle_Release(IHTMLStyle *iface)
if
(
!
ref
)
{
if
(
!
ref
)
{
if
(
This
->
nsstyle
)
if
(
This
->
nsstyle
)
nsIDOMCSSStyleDeclaration_Release
(
This
->
nsstyle
);
nsIDOMCSSStyleDeclaration_Release
(
This
->
nsstyle
);
heap_free
(
This
->
filter
);
release_dispex
(
&
This
->
dispex
);
release_dispex
(
&
This
->
dispex
);
heap_free
(
This
);
heap_free
(
This
);
}
}
...
@@ -2547,21 +2548,36 @@ static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
...
@@ -2547,21 +2548,36 @@ static HRESULT WINAPI HTMLStyle_get_clip(IHTMLStyle *iface, BSTR *p)
static
HRESULT
WINAPI
HTMLStyle_put_filter
(
IHTMLStyle
*
iface
,
BSTR
v
)
static
HRESULT
WINAPI
HTMLStyle_put_filter
(
IHTMLStyle
*
iface
,
BSTR
v
)
{
{
HTMLStyle
*
This
=
impl_from_IHTMLStyle
(
iface
);
HTMLStyle
*
This
=
impl_from_IHTMLStyle
(
iface
);
WCHAR
*
new_filter
=
NULL
;
WARN
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
if
(
v
)
{
new_filter
=
heap_strdupW
(
v
);
if
(
!
new_filter
)
return
E_OUTOFMEMORY
;
}
/* FIXME: Handle MS-style filters */
heap_free
(
This
->
filter
);
return
set_style_attr
(
This
,
STYLEID_FILTER
,
v
,
0
);
This
->
filter
=
new_filter
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
HTMLStyle_get_filter
(
IHTMLStyle
*
iface
,
BSTR
*
p
)
static
HRESULT
WINAPI
HTMLStyle_get_filter
(
IHTMLStyle
*
iface
,
BSTR
*
p
)
{
{
HTMLStyle
*
This
=
impl_from_IHTMLStyle
(
iface
);
HTMLStyle
*
This
=
impl_from_IHTMLStyle
(
iface
);
WARN
(
"(%p)->(%p)
\n
"
,
This
,
p
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
filter
)
{
*
p
=
SysAllocString
(
This
->
filter
);
if
(
!*
p
)
return
E_OUTOFMEMORY
;
}
else
{
*
p
=
NULL
;
}
/* FIXME: Handle MS-style filters */
return
S_OK
;
return
get_style_attr
(
This
,
STYLEID_FILTER
,
p
);
}
}
static
HRESULT
WINAPI
HTMLStyle_setAttribute
(
IHTMLStyle
*
iface
,
BSTR
strAttributeName
,
static
HRESULT
WINAPI
HTMLStyle_setAttribute
(
IHTMLStyle
*
iface
,
BSTR
strAttributeName
,
...
...
dlls/mshtml/htmlstyle.h
View file @
0131e047
...
@@ -26,6 +26,7 @@ struct HTMLStyle {
...
@@ -26,6 +26,7 @@ struct HTMLStyle {
LONG
ref
;
LONG
ref
;
nsIDOMCSSStyleDeclaration
*
nsstyle
;
nsIDOMCSSStyleDeclaration
*
nsstyle
;
WCHAR
*
filter
;
};
};
/* NOTE: Make sure to keep in sync with style_tbl in htmlstyle.c */
/* NOTE: Make sure to keep in sync with style_tbl in htmlstyle.c */
...
...
dlls/mshtml/tests/dom.c
View file @
0131e047
...
@@ -5569,6 +5569,53 @@ static void test_default_style(IHTMLStyle *style)
...
@@ -5569,6 +5569,53 @@ static void test_default_style(IHTMLStyle *style)
}
}
}
}
#define test_style_filter(a,b) _test_style_filter(__LINE__,a,b)
static
void
_test_style_filter
(
unsigned
line
,
IHTMLStyle
*
style
,
const
char
*
exval
)
{
BSTR
str
;
HRESULT
hres
;
str
=
(
void
*
)
0xdeadbeef
;
hres
=
IHTMLStyle_get_filter
(
style
,
&
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_filter failed: %08x
\n
"
,
hres
);
if
(
exval
)
ok_
(
__FILE__
,
line
)(
str
&&
!
strcmp_wa
(
str
,
exval
),
"filter = %s, expected %s
\n
"
,
wine_dbgstr_w
(
str
),
exval
);
else
ok_
(
__FILE__
,
line
)(
!
str
,
"str = %s, expected NULL
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
}
#define set_style_filter(a,b) _set_style_filter(__LINE__,a,b)
static
void
_set_style_filter
(
unsigned
line
,
IHTMLStyle
*
style
,
const
char
*
val
)
{
BSTR
str
=
a2bstr
(
val
);
HRESULT
hres
;
hres
=
IHTMLStyle_put_filter
(
style
,
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"put_filter failed: %08x
\n
"
,
hres
);
SysFreeString
(
str
);
_test_style_filter
(
line
,
style
,
val
);
}
static
void
test_style_filters
(
IHTMLElement
*
elem
)
{
IHTMLStyle
*
style
;
HRESULT
hres
;
hres
=
IHTMLElement_get_style
(
elem
,
&
style
);
ok
(
hres
==
S_OK
,
"get_style failed: %08x
\n
"
,
hres
);
test_style_filter
(
style
,
NULL
);
set_style_filter
(
style
,
"alpha(opacity=50.00000)"
);
set_style_filter
(
style
,
"alpha(opacity=100)"
);
set_style_filter
(
style
,
"xxx(a,b,c) alpha(opacity=100)"
);
set_style_filter
(
style
,
NULL
);
IHTMLStyle_Release
(
style
);
}
static
void
test_set_csstext
(
IHTMLStyle
*
style
)
static
void
test_set_csstext
(
IHTMLStyle
*
style
)
{
{
VARIANT
v
;
VARIANT
v
;
...
@@ -6770,6 +6817,7 @@ static void test_elems2(IHTMLDocument2 *doc)
...
@@ -6770,6 +6817,7 @@ static void test_elems2(IHTMLDocument2 *doc)
}
}
test_attr
(
div
);
test_attr
(
div
);
test_style_filters
(
div
);
IHTMLElement_Release
(
div
);
IHTMLElement_Release
(
div
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment