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
9944c4bd
Commit
9944c4bd
authored
Mar 26, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Propagate nsIDOMCSSStyleDeclaration errors.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
78a05ca6
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
24 deletions
+49
-24
htmlstyle.c
dlls/mshtml/htmlstyle.c
+11
-20
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-0
nsembed.c
dlls/mshtml/nsembed.c
+3
-1
dom.c
dlls/mshtml/tests/dom.c
+33
-3
No files found.
dlls/mshtml/htmlstyle.c
View file @
9944c4bd
...
...
@@ -921,16 +921,13 @@ static HRESULT set_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_
nsAString_InitDepend
(
&
str_name
,
style_tbl
[
sid
].
name
);
nsAString_InitDepend
(
&
str_value
,
value
);
nsAString_InitDepend
(
&
str_empty
,
emptyW
);
nsres
=
nsIDOMCSSStyleDeclaration_SetProperty
(
nsstyle
,
&
str_name
,
&
str_value
,
&
str_empty
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetProperty failed: %08x
\n
"
,
nsres
);
nsAString_Finish
(
&
str_name
);
nsAString_Finish
(
&
str_value
);
nsAString_Finish
(
&
str_empty
);
return
S_OK
;
if
(
NS_FAILED
(
nsres
))
WARN
(
"SetProperty failed: %08x
\n
"
,
nsres
);
return
map_nsresult
(
nsres
);
}
static
HRESULT
var_to_styleval
(
CSSStyle
*
style
,
const
VARIANT
*
v
,
const
style_tbl_entry_t
*
entry
,
WCHAR
*
buf
,
const
WCHAR
**
ret
)
...
...
@@ -1023,12 +1020,9 @@ static HRESULT get_nsstyle_attr_nsval(nsIDOMCSSStyleDeclaration *nsstyle, stylei
nsAString_InitDepend
(
&
str_name
,
style_tbl
[
sid
].
name
);
nsres
=
nsIDOMCSSStyleDeclaration_GetPropertyValue
(
nsstyle
,
&
str_name
,
value
);
nsAString_Finish
(
&
str_name
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"SetProperty failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
return
S_OK
;
if
(
NS_FAILED
(
nsres
))
WARN
(
"GetPropertyValue failed: %08x
\n
"
,
nsres
);
return
map_nsresult
(
nsres
);
}
static
HRESULT
nsstyle_to_bstr
(
const
WCHAR
*
val
,
DWORD
flags
,
BSTR
*
p
)
...
...
@@ -3179,11 +3173,11 @@ static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttri
nsAString_GetData
(
&
ret_str
,
&
ret
);
*
pfSuccess
=
variant_bool
(
*
ret
);
}
else
{
ERR
(
"RemoveProperty failed: %08x
\n
"
,
nsres
);
WARN
(
"RemoveProperty failed: %08x
\n
"
,
nsres
);
}
nsAString_Finish
(
&
name_str
);
nsAString_Finish
(
&
ret_str
);
return
NS_SUCCEEDED
(
nsres
)
?
S_OK
:
E_FAIL
;
return
map_nsresult
(
nsres
)
;
}
static
HRESULT
WINAPI
HTMLStyle_toString
(
IHTMLStyle
*
iface
,
BSTR
*
String
)
...
...
@@ -5063,12 +5057,9 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_setProperty(IHTMLCSSStyleDeclarati
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
;
if
(
NS_FAILED
(
nsres
))
WARN
(
"SetProperty failed: %08x
\n
"
,
nsres
);
return
map_nsresult
(
nsres
);
}
static
HRESULT
WINAPI
HTMLCSSStyleDeclaration_item
(
IHTMLCSSStyleDeclaration
*
iface
,
LONG
index
,
BSTR
*
pbstrPropertyName
)
...
...
dlls/mshtml/mshtml_private.h
View file @
9944c4bd
...
...
@@ -56,6 +56,7 @@
#define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L)
#define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
#define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
#define NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR ((nsresult)0x80530007)
#define NS_ERROR_MODULE_NETWORK 6
...
...
@@ -958,6 +959,7 @@ void nsAString_InitDepend(nsAString*,const PRUnichar*) DECLSPEC_HIDDEN;
UINT32
nsAString_GetData
(
const
nsAString
*
,
const
PRUnichar
**
)
DECLSPEC_HIDDEN
;
void
nsAString_Finish
(
nsAString
*
)
DECLSPEC_HIDDEN
;
HRESULT
map_nsresult
(
nsresult
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr
(
nsresult
,
nsAString
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr_variant
(
nsresult
nsres
,
nsAString
*
nsstr
,
VARIANT
*
p
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsform
(
nsresult
,
nsIDOMHTMLFormElement
*
,
IHTMLFormElement
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/mshtml/nsembed.c
View file @
9944c4bd
...
...
@@ -848,7 +848,7 @@ void nsAString_Finish(nsAString *str)
NS_StringContainerFinish
(
str
);
}
static
HRESULT
map_nsresult
(
nsresult
nsres
)
HRESULT
map_nsresult
(
nsresult
nsres
)
{
switch
(
nsres
)
{
case
NS_OK
:
...
...
@@ -865,6 +865,8 @@ static HRESULT map_nsresult(nsresult nsres)
return
E_INVALIDARG
;
case
NS_ERROR_UNEXPECTED
:
return
E_UNEXPECTED
;
case
NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR
:
return
0x80700007
;
/* according to tests */
}
return
E_FAIL
;
}
...
...
dlls/mshtml/tests/dom.c
View file @
9944c4bd
...
...
@@ -6750,6 +6750,27 @@ static void test_xmlhttprequest(IHTMLWindow5 *window)
VariantClear
(
&
var
);
}
static
void
test_read_only_style
(
IHTMLCSSStyleDeclaration
*
style
)
{
BSTR
none
=
a2bstr
(
"none"
),
display
=
a2bstr
(
"display"
),
str
;
VARIANT
v
;
HRESULT
hres
;
hres
=
IHTMLCSSStyleDeclaration_put_display
(
style
,
none
);
ok
(
hres
==
0x80700007
,
"put_display failed: %08x
\n
"
,
hres
);
hres
=
IHTMLCSSStyleDeclaration_removeProperty
(
style
,
display
,
&
str
);
ok
(
hres
==
0x80700007
,
"removeProperty failed: %08x
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
none
;
hres
=
IHTMLCSSStyleDeclaration_setProperty
(
style
,
display
,
&
v
,
NULL
);
ok
(
hres
==
0x80700007
,
"setProperty returned: %08x
\n
"
,
hres
);
SysFreeString
(
none
);
SysFreeString
(
display
);
}
static
void
test_window
(
IHTMLDocument2
*
doc
)
{
IHTMLWindow2
*
window
,
*
window2
,
*
self
,
*
parent
;
...
...
@@ -7099,10 +7120,19 @@ static void test_defaults(IHTMLDocument2 *doc)
test_ifaces
((
IUnknown
*
)
cstyle
,
cstyle_iids
);
hres
=
IHTMLCurrentStyle_QueryInterface
(
cstyle
,
&
IID_IHTMLCurrentStyle4
,
(
void
**
)
&
unk
);
if
(
SUCCEEDED
(
hres
))
if
(
SUCCEEDED
(
hres
))
{
IHTMLCSSStyleDeclaration
*
css_style
;
hres
=
IHTMLCurrentStyle_QueryInterface
(
cstyle
,
&
IID_IHTMLCSSStyleDeclaration
,
(
void
**
)
&
css_style
);
if
(
SUCCEEDED
(
hres
))
{
test_read_only_style
(
css_style
);
IHTMLCSSStyleDeclaration_Release
(
css_style
);
}
else
{
win_skip
(
"IHTMLCSSStyleDeclaration not supported
\n
"
);
}
IUnknown_Release
(
unk
);
else
{
}
else
{
/*IE6 doesn't have interface */
win_skip
(
"IID_IHTMLCurrentStyle4 not supported
\n
"
);
}
...
...
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