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
33171f3b
Commit
33171f3b
authored
Apr 16, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLStyle::removeAttribute tests.
parent
0cad55ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
jstest.html
dlls/mshtml/tests/jstest.html
+11
-0
style.c
dlls/mshtml/tests/style.c
+25
-0
No files found.
dlls/mshtml/tests/jstest.html
View file @
33171f3b
...
...
@@ -62,6 +62,16 @@ function test_document_name_as_index() {
ok
(
!
(
"formid"
in
document
),
"formid is in document"
);
}
function
test_remove_style_attribute
()
{
var
s
=
document
.
body
.
style
,
b
;
s
.
somevar
=
"test"
;
b
=
s
.
removeAttribute
(
"somevar"
,
1
);
ok
(
b
,
"removeAttribute returned "
+
b
+
" expected true"
);
b
=
s
.
removeAttribute
(
"somevar"
,
1
);
ok
(
b
===
false
,
"removeAttribute returned "
+
b
+
" expected false"
);
}
var
globalVar
=
false
;
function
runTest
()
{
...
...
@@ -75,6 +85,7 @@ function runTest() {
test_select_index
();
test_createDocumentFragment
();
test_document_name_as_index
();
test_remove_style_attribute
();
var
r
=
window
.
execScript
(
"globalVar = true;"
);
ok
(
r
===
undefined
,
"execScript returned "
+
r
);
...
...
dlls/mshtml/tests/style.c
View file @
33171f3b
...
...
@@ -242,6 +242,19 @@ static void _test_style_set_csstext(unsigned line, IHTMLStyle *style, const char
SysFreeString
(
tmp
);
}
#define test_style_remove_attribute(a,b,c) _test_style_remove_attribute(__LINE__,a,b,c)
static
void
_test_style_remove_attribute
(
unsigned
line
,
IHTMLStyle
*
style
,
const
char
*
attr
,
VARIANT_BOOL
exb
)
{
BSTR
str
=
a2bstr
(
attr
);
VARIANT_BOOL
b
=
100
;
HRESULT
hres
;
hres
=
IHTMLStyle_removeAttribute
(
style
,
str
,
1
,
&
b
);
SysFreeString
(
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"removeAttribute failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
b
==
exb
,
"removeAttribute returned %x, expected %x
\n
"
,
b
,
exb
);
}
static
void
test_set_csstext
(
IHTMLStyle
*
style
)
{
VARIANT
v
;
...
...
@@ -1883,6 +1896,13 @@ static void test_body_style(IHTMLStyle *style)
ok
(
!
strcmp_wa
(
str
,
"always"
),
"pageBreakBefore = %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
test_style_remove_attribute
(
style
,
"pageBreakBefore"
,
VARIANT_TRUE
);
test_style_remove_attribute
(
style
,
"pageBreakBefore"
,
VARIANT_FALSE
);
hres
=
IHTMLStyle_get_pageBreakBefore
(
style
,
&
str
);
ok
(
hres
==
S_OK
,
"get_pageBreakBefore failed: %08x
\n
"
,
hres
);
ok
(
!
str
,
"pageBreakBefore = %s
\n
"
,
wine_dbgstr_w
(
str
));
hres
=
IHTMLStyle_QueryInterface
(
style
,
&
IID_IHTMLStyle2
,
(
void
**
)
&
style2
);
ok
(
hres
==
S_OK
,
"Could not get IHTMLStyle2 iface: %08x
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
...
...
@@ -1984,6 +2004,11 @@ static void test_style_filters(IHTMLElement *elem)
test_style_filter
(
style
,
"alpha(opacity=100)"
);
set_style_filter
(
style
,
"xxx(a,b,c) alpha(opacity=100)"
);
set_style_filter
(
style
,
NULL
);
set_style_filter
(
style
,
"alpha(opacity=100)"
);
test_style_remove_attribute
(
style
,
"filter"
,
VARIANT_TRUE
);
test_style_remove_attribute
(
style
,
"filter"
,
VARIANT_FALSE
);
test_style_filter
(
style
,
NULL
);
IHTMLCurrentStyle2_Release
(
current_style2
);
IHTMLStyle_Release
(
style
);
...
...
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