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
a3ab8d67
Commit
a3ab8d67
authored
Mar 30, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Split conversion to string out of get_elem_attr_value_by_dispid.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
51304cbe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
34 deletions
+40
-34
htmlattr.c
dlls/mshtml/htmlattr.c
+4
-2
htmlelem.c
dlls/mshtml/htmlelem.c
+34
-27
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-5
No files found.
dlls/mshtml/htmlattr.c
View file @
a3ab8d67
...
...
@@ -169,7 +169,7 @@ static HRESULT WINAPI HTMLDOMAttribute_get_nodeValue(IHTMLDOMAttribute *iface, V
if
(
!
This
->
elem
)
return
VariantCopy
(
p
,
&
This
->
value
);
return
get_elem_attr_value_by_dispid
(
This
->
elem
,
This
->
dispid
,
0
,
p
);
return
get_elem_attr_value_by_dispid
(
This
->
elem
,
This
->
dispid
,
p
);
}
static
HRESULT
WINAPI
HTMLDOMAttribute_get_specified
(
IHTMLDOMAttribute
*
iface
,
VARIANT_BOOL
*
p
)
...
...
@@ -315,7 +315,9 @@ static HRESULT WINAPI HTMLDOMAttribute2_get_value(IHTMLDOMAttribute2 *iface, BST
return
E_UNEXPECTED
;
}
hres
=
get_elem_attr_value_by_dispid
(
This
->
elem
,
This
->
dispid
,
ATTRFLAG_ASSTRING
,
&
val
);
hres
=
get_elem_attr_value_by_dispid
(
This
->
elem
,
This
->
dispid
,
&
val
);
if
(
SUCCEEDED
(
hres
))
hres
=
attr_value_to_string
(
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/mshtml/htmlelem.c
View file @
a3ab8d67
...
...
@@ -63,6 +63,10 @@ static const WCHAR textareaW[] = {'T','E','X','T','A','R','E','A',0};
static
const
WCHAR
title_tagW
[]
=
{
'T'
,
'I'
,
'T'
,
'L'
,
'E'
,
0
};
static
const
WCHAR
trW
[]
=
{
'T'
,
'R'
,
0
};
#define ATTRFLAG_CASESENSITIVE 0x0001
#define ATTRFLAG_ASSTRING 0x0002
#define ATTRFLAG_EXPANDURL 0x0004
typedef
struct
{
const
WCHAR
*
name
;
HRESULT
(
*
constructor
)(
HTMLDocumentNode
*
,
nsIDOMHTMLElement
*
,
HTMLElement
**
);
...
...
@@ -638,39 +642,39 @@ static HRESULT WINAPI HTMLElement_setAttribute(IHTMLElement *iface, BSTR strAttr
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYPUT
,
&
dispParams
,
NULL
,
&
excep
,
NULL
);
}
HRESULT
get_elem_attr_value_by_dispid
(
HTMLElement
*
elem
,
DISPID
dispid
,
DWORD
flags
,
VARIANT
*
ret
)
HRESULT
get_elem_attr_value_by_dispid
(
HTMLElement
*
elem
,
DISPID
dispid
,
VARIANT
*
ret
)
{
DISPPARAMS
dispParams
=
{
NULL
,
NULL
,
0
,
0
};
EXCEPINFO
excep
;
return
IDispatchEx_InvokeEx
(
&
elem
->
node
.
event_target
.
dispex
.
IDispatchEx_iface
,
dispid
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYGET
,
&
dispParams
,
ret
,
&
excep
,
NULL
);
}
HRESULT
attr_value_to_string
(
VARIANT
*
v
)
{
HRESULT
hres
;
static
const
WCHAR
nullW
[]
=
{
'n'
,
'u'
,
'l'
,
'l'
,
0
};
hres
=
IDispatchEx_InvokeEx
(
&
elem
->
node
.
event_target
.
dispex
.
IDispatchEx_iface
,
dispid
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYGET
,
&
dispParams
,
ret
,
&
excep
,
NULL
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
flags
&
ATTRFLAG_ASSTRING
)
{
switch
(
V_VT
(
ret
))
{
case
VT_BSTR
:
break
;
case
VT_NULL
:
V_BSTR
(
ret
)
=
SysAllocString
(
nullW
);
if
(
!
V_BSTR
(
ret
))
return
E_OUTOFMEMORY
;
V_VT
(
ret
)
=
VT_BSTR
;
break
;
case
VT_DISPATCH
:
IDispatch_Release
(
V_DISPATCH
(
ret
));
V_VT
(
ret
)
=
VT_BSTR
;
V_BSTR
(
ret
)
=
SysAllocString
(
NULL
);
break
;
default:
hres
=
VariantChangeType
(
ret
,
ret
,
0
,
VT_BSTR
);
if
(
FAILED
(
hres
))
return
hres
;
}
switch
(
V_VT
(
v
))
{
case
VT_BSTR
:
break
;
case
VT_NULL
:
V_BSTR
(
v
)
=
SysAllocString
(
nullW
);
if
(
!
V_BSTR
(
v
))
return
E_OUTOFMEMORY
;
V_VT
(
v
)
=
VT_BSTR
;
break
;
case
VT_DISPATCH
:
IDispatch_Release
(
V_DISPATCH
(
v
));
V_VT
(
v
)
=
VT_BSTR
;
V_BSTR
(
v
)
=
SysAllocString
(
NULL
);
break
;
default:
hres
=
VariantChangeType
(
v
,
v
,
0
,
VT_BSTR
);
if
(
FAILED
(
hres
))
return
hres
;
}
return
S_OK
;
...
...
@@ -700,7 +704,10 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr
return
hres
;
}
return
get_elem_attr_value_by_dispid
(
This
,
dispid
,
lFlags
,
AttributeValue
);
hres
=
get_elem_attr_value_by_dispid
(
This
,
dispid
,
AttributeValue
);
if
(
SUCCEEDED
(
hres
)
&&
(
lFlags
&
ATTRFLAG_ASSTRING
))
hres
=
attr_value_to_string
(
AttributeValue
);
return
hres
;
}
static
HRESULT
WINAPI
HTMLElement_removeAttribute
(
IHTMLElement
*
iface
,
BSTR
strAttributeName
,
...
...
dlls/mshtml/mshtml_private.h
View file @
a3ab8d67
...
...
@@ -1016,11 +1016,8 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL) DECLSPEC_HIDDEN
IHTMLElementCollection
*
create_collection_from_nodelist
(
HTMLDocumentNode
*
,
nsIDOMNodeList
*
)
DECLSPEC_HIDDEN
;
IHTMLElementCollection
*
create_collection_from_htmlcol
(
HTMLDocumentNode
*
,
nsIDOMHTMLCollection
*
)
DECLSPEC_HIDDEN
;
#define ATTRFLAG_CASESENSITIVE 0x0001
#define ATTRFLAG_ASSTRING 0x0002
#define ATTRFLAG_EXPANDURL 0x0004
HRESULT
get_elem_attr_value_by_dispid
(
HTMLElement
*
,
DISPID
,
DWORD
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
attr_value_to_string
(
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
get_elem_attr_value_by_dispid
(
HTMLElement
*
,
DISPID
,
VARIANT
*
)
DECLSPEC_HIDDEN
;
HRESULT
get_elem_source_index
(
HTMLElement
*
,
LONG
*
)
DECLSPEC_HIDDEN
;
nsresult
get_elem_attr_value
(
nsIDOMHTMLElement
*
,
const
WCHAR
*
,
nsAString
*
,
const
PRUnichar
**
)
DECLSPEC_HIDDEN
;
...
...
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