Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2e6598dc
Commit
2e6598dc
authored
Sep 12, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Expose IHTMLCSSStyleDeclaration interface to scripts.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d35e6fea
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
2 deletions
+71
-2
htmlstyle.c
dlls/mshtml/htmlstyle.c
+8
-1
documentmode.js
dlls/mshtml/tests/documentmode.js
+27
-0
elements.js
dlls/mshtml/tests/elements.js
+36
-1
No files found.
dlls/mshtml/htmlstyle.c
View file @
2e6598dc
...
...
@@ -9668,6 +9668,12 @@ static HRESULT HTMLStyle_get_dispid(DispatchEx *dispex, BSTR name, DWORD flags,
return
DISP_E_UNKNOWNNAME
;
}
void
HTMLStyle_init_dispex_info
(
dispex_data_t
*
info
,
compat_mode_t
mode
)
{
if
(
mode
>=
COMPAT_MODE_IE9
)
dispex_info_add_interface
(
info
,
IHTMLCSSStyleDeclaration_tid
,
NULL
);
}
static
const
dispex_static_data_vtbl_t
HTMLStyle_dispex_vtbl
=
{
NULL
,
HTMLStyle_get_dispid
,
...
...
@@ -9687,7 +9693,8 @@ static const tid_t HTMLStyle_iface_tids[] = {
static
dispex_static_data_t
HTMLStyle_dispex
=
{
&
HTMLStyle_dispex_vtbl
,
DispHTMLStyle_tid
,
HTMLStyle_iface_tids
HTMLStyle_iface_tids
,
HTMLStyle_init_dispex_info
};
static
HRESULT
get_style_from_elem
(
HTMLElement
*
elem
,
nsIDOMCSSStyleDeclaration
**
ret
)
...
...
dlls/mshtml/tests/documentmode.js
View file @
2e6598dc
...
...
@@ -128,6 +128,32 @@ function test_xhr_props() {
next_test
();
}
function
test_style_props
()
{
var
style
=
document
.
body
.
style
;
function
test_exposed
(
prop
,
expect
)
{
if
(
expect
)
ok
(
prop
in
style
,
prop
+
" not found in style object."
);
else
ok
(
!
(
prop
in
style
),
prop
+
" found in style object."
);
}
var
v
=
document
.
documentMode
;
test_exposed
(
"removeAttribute"
,
true
);
test_exposed
(
"zIndex"
,
true
);
test_exposed
(
"z-index"
,
true
);
test_exposed
(
"filter"
,
true
);
test_exposed
(
"pixelTop"
,
true
);
test_exposed
(
"float"
,
true
);
test_exposed
(
"css-float"
,
false
);
test_exposed
(
"style-float"
,
false
);
test_exposed
(
"setProperty"
,
v
>=
9
);
test_exposed
(
"removeProperty"
,
v
>=
9
);
next_test
();
}
function
test_javascript
()
{
var
g
=
window
;
...
...
@@ -270,6 +296,7 @@ var tests = [
test_window_props
,
test_javascript
,
test_xhr_props
,
test_style_props
,
test_elem_by_id
,
test_conditional_comments
];
dlls/mshtml/tests/elements.js
View file @
2e6598dc
...
...
@@ -208,6 +208,40 @@ function test_document_owner() {
next_test
();
}
function
test_style_properties
()
{
var
style
=
document
.
body
.
style
;
var
val
;
style
.
cssFloat
=
"left"
;
ok
(
style
.
cssFloat
===
"left"
,
"cssFloat = "
+
style
.
cssFloat
);
val
=
style
.
removeProperty
(
"float"
);
ok
(
val
===
"left"
,
"removeProperty() returned "
+
val
);
ok
(
style
.
cssFloat
===
""
,
"cssFloat = "
+
style
.
cssFloat
);
style
.
cssFloat
=
"left"
;
val
=
style
.
removeProperty
(
"FloaT"
);
ok
(
val
===
"left"
,
"removeProperty() returned "
+
val
);
ok
(
style
.
cssFloat
===
""
,
"cssFloat = "
+
style
.
cssFloat
);
style
.
cssFloat
=
"left"
;
val
=
style
.
removeProperty
(
"cssFloat"
);
ok
(
val
===
""
,
"removeProperty() returned "
+
val
);
ok
(
style
.
cssFloat
===
"left"
,
"cssFloat = "
+
style
.
cssFloat
);
ok
(
style
[
"float"
]
===
"left"
,
"float = "
+
style
[
"float"
]);
style
.
testVal
=
"test"
;
val
=
style
.
removeProperty
(
"testVal"
);
ok
(
val
===
""
,
"removeProperty() returned "
+
val
);
ok
(
style
.
testVal
===
"test"
,
"testVal = "
+
style
.
testVal
);
style
[
"z-index"
]
=
1
;
ok
(
style
.
zIndex
===
1
,
"zIndex = "
+
style
.
zIndex
);
ok
(
style
[
"z-index"
]
===
1
,
"z-index = "
+
style
[
"z-index"
]);
next_test
();
}
var
tests
=
[
test_input_selection
,
test_textContent
,
...
...
@@ -217,5 +251,6 @@ var tests = [
test_iframe
,
test_query_selector
,
test_compare_position
,
test_document_owner
test_document_owner
,
test_style_properties
];
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