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
119b1a69
Commit
119b1a69
authored
Mar 19, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLCSSStyleDeclaration::setProperty implementation.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d71532df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
8 deletions
+66
-8
htmlstyle.c
dlls/mshtml/htmlstyle.c
+42
-8
elements.js
dlls/mshtml/tests/elements.js
+24
-0
No files found.
dlls/mshtml/htmlstyle.c
View file @
119b1a69
...
...
@@ -933,7 +933,7 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_
return
S_OK
;
}
static
HRESULT
var_to_styleval
(
HTMLStyle
*
style
,
const
VARIANT
*
v
,
styleid_t
sid
,
WCHAR
*
buf
,
const
WCHAR
**
ret
)
static
HRESULT
var_to_styleval
(
HTMLStyle
*
style
,
const
VARIANT
*
v
,
const
style_tbl_entry_t
*
entry
,
WCHAR
*
buf
,
const
WCHAR
**
ret
)
{
switch
(
V_VT
(
v
))
{
case
VT_NULL
:
...
...
@@ -949,7 +949,7 @@ static HRESULT var_to_styleval(HTMLStyle *style, const VARIANT *v, styleid_t sid
return
S_OK
;
case
VT_I4
:
{
unsigned
flags
=
dispex_compat_mode
(
&
style
->
dispex
)
<
COMPAT_MODE_IE9
?
style_tbl
[
sid
].
flags
:
0
;
unsigned
flags
=
entry
&&
dispex_compat_mode
(
&
style
->
dispex
)
<
COMPAT_MODE_IE9
?
entry
->
flags
:
0
;
static
const
WCHAR
formatW
[]
=
{
'%'
,
'd'
,
0
};
static
const
WCHAR
hex_formatW
[]
=
{
'#'
,
'%'
,
'0'
,
'6'
,
'x'
,
0
};
...
...
@@ -1008,7 +1008,7 @@ static HRESULT set_style_property_var(HTMLStyle *style, styleid_t sid, VARIANT *
WCHAR
buf
[
14
];
HRESULT
hres
;
hres
=
var_to_styleval
(
style
,
value
,
sid
,
buf
,
&
val
);
hres
=
var_to_styleval
(
style
,
value
,
&
style_tbl
[
sid
]
,
buf
,
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -1615,7 +1615,7 @@ static HRESULT WINAPI HTMLStyle_put_backgroundPositionX(IHTMLStyle *iface, VARIA
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
v
));
hres
=
var_to_styleval
(
This
,
&
v
,
STYLEID_BACKGROUND_POSITION_X
,
buf
,
&
val
);
hres
=
var_to_styleval
(
This
,
&
v
,
&
style_tbl
[
STYLEID_BACKGROUND_POSITION_X
]
,
buf
,
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -1708,7 +1708,7 @@ static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIA
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_variant
(
&
v
));
hres
=
var_to_styleval
(
This
,
&
v
,
STYLEID_BACKGROUND_POSITION
,
buf
,
&
val
);
hres
=
var_to_styleval
(
This
,
&
v
,
&
style_tbl
[
STYLEID_BACKGROUND_POSITION
]
,
buf
,
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -5194,11 +5194,45 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_removeProperty(IHTMLCSSStyleDeclar
return
return_nsstr
(
nsres
,
&
ret_str
,
pbstrPropertyValue
);
}
static
HRESULT
WINAPI
HTMLCSSStyleDeclaration_setProperty
(
IHTMLCSSStyleDeclaration
*
iface
,
BSTR
bstrPropertyName
,
VARIANT
*
pvarPropertyValue
,
VARIANT
*
pvarPropertyP
riority
)
static
HRESULT
WINAPI
HTMLCSSStyleDeclaration_setProperty
(
IHTMLCSSStyleDeclaration
*
iface
,
BSTR
name
,
VARIANT
*
value
,
VARIANT
*
p
riority
)
{
HTMLStyle
*
This
=
impl_from_IHTMLCSSStyleDeclaration
(
iface
);
FIXME
(
"(%p)->(%s %p %p)
\n
"
,
This
,
debugstr_w
(
bstrPropertyName
),
pvarPropertyValue
,
pvarPropertyPriority
);
return
E_NOTIMPL
;
nsAString
priority_str
,
name_str
,
value_str
;
const
style_tbl_entry_t
*
style_entry
;
const
WCHAR
*
val
;
WCHAR
buf
[
14
];
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %s %s)
\n
"
,
This
,
debugstr_w
(
name
),
debugstr_variant
(
value
),
debugstr_variant
(
priority
));
style_entry
=
lookup_style_tbl
(
name
);
hres
=
var_to_styleval
(
This
,
value
,
style_entry
,
buf
,
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
priority
)
{
if
(
V_VT
(
priority
)
!=
VT_BSTR
)
{
WARN
(
"invalid priority type %s
\n
"
,
debugstr_variant
(
priority
));
return
S_OK
;
}
nsAString_InitDepend
(
&
priority_str
,
V_BSTR
(
priority
));
}
else
{
nsAString_InitDepend
(
&
priority_str
,
NULL
);
}
nsAString_InitDepend
(
&
name_str
,
style_entry
?
style_entry
->
name
:
name
);
nsAString_InitDepend
(
&
value_str
,
val
);
nsres
=
nsIDOMCSSStyleDeclaration_SetProperty
(
This
->
nsstyle
,
&
name_str
,
&
value_str
,
&
priority_str
);
nsAString_Finish
(
&
name_str
);
nsAString_Finish
(
&
value_str
);
nsAString_Finish
(
&
priority_str
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"SetProperty failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLCSSStyleDeclaration_item
(
IHTMLCSSStyleDeclaration
*
iface
,
LONG
index
,
BSTR
*
pbstrPropertyName
)
...
...
dlls/mshtml/tests/elements.js
View file @
119b1a69
...
...
@@ -239,6 +239,30 @@ function test_style_properties() {
ok
(
style
.
zIndex
===
1
,
"zIndex = "
+
style
.
zIndex
);
ok
(
style
[
"z-index"
]
===
1
,
"z-index = "
+
style
[
"z-index"
]);
style
.
setProperty
(
"border-width"
,
"5px"
);
ok
(
style
.
borderWidth
===
"5px"
,
"style.borderWidth = "
+
style
.
borderWidth
);
try
{
style
.
setProperty
(
"border-width"
,
6
);
ok
(
style
.
borderWidth
===
"5px"
,
"style.borderWidth = "
+
style
.
borderWidth
);
}
catch
(
e
)
{
win_skip
(
"skipping setProperty tests on too old IE version"
);
next_test
();
return
;
}
style
.
setProperty
(
"border-width"
,
"7px"
,
"test"
);
ok
(
style
.
borderWidth
===
"5px"
,
"style.borderWidth = "
+
style
.
borderWidth
);
style
.
setProperty
(
"border-width"
,
"6px"
,
""
);
ok
(
style
.
borderWidth
===
"6px"
,
"style.borderWidth = "
+
style
.
borderWidth
);
style
.
setProperty
(
"border-width"
,
"7px"
,
"important"
);
ok
(
style
.
borderWidth
===
"7px"
,
"style.borderWidth = "
+
style
.
borderWidth
);
style
.
setProperty
(
"border-width"
,
"8px"
,
undefined
);
ok
(
style
.
borderWidth
===
"7px"
,
"style.borderWidth = "
+
style
.
borderWidth
);
next_test
();
}
...
...
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