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
8e0d6619
Commit
8e0d6619
authored
May 04, 2015
by
Jacek Caban
Committed by
Alexandre Julliard
May 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Split getAttribute into helper function and use it in…
mshtml: Split getAttribute into helper function and use it in IHTMLDOMAttribute::get_nodeValue implementation.
parent
e2e1ac2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
33 deletions
+38
-33
htmlattr.c
dlls/mshtml/htmlattr.c
+1
-5
htmlelem.c
dlls/mshtml/htmlelem.c
+31
-28
mshtml_private.h
dlls/mshtml/mshtml_private.h
+6
-0
No files found.
dlls/mshtml/htmlattr.c
View file @
8e0d6619
...
...
@@ -164,8 +164,6 @@ static HRESULT WINAPI HTMLDOMAttribute_put_nodeValue(IHTMLDOMAttribute *iface, V
static
HRESULT
WINAPI
HTMLDOMAttribute_get_nodeValue
(
IHTMLDOMAttribute
*
iface
,
VARIANT
*
p
)
{
HTMLDOMAttribute
*
This
=
impl_from_IHTMLDOMAttribute
(
iface
);
DISPPARAMS
dp
=
{
NULL
,
NULL
,
0
,
0
};
EXCEPINFO
ei
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
...
...
@@ -174,9 +172,7 @@ static HRESULT WINAPI HTMLDOMAttribute_get_nodeValue(IHTMLDOMAttribute *iface, V
return
E_UNEXPECTED
;
}
memset
(
&
ei
,
0
,
sizeof
(
ei
));
return
IDispatchEx_InvokeEx
(
&
This
->
elem
->
node
.
dispex
.
IDispatchEx_iface
,
This
->
dispid
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYGET
,
&
dp
,
p
,
&
ei
,
NULL
);
return
get_elem_attr_value_by_dispid
(
This
->
elem
,
This
->
dispid
,
0
,
p
);
}
static
HRESULT
WINAPI
HTMLDOMAttribute_get_specified
(
IHTMLDOMAttribute
*
iface
,
VARIANT_BOOL
*
p
)
...
...
dlls/mshtml/htmlelem.c
View file @
8e0d6619
...
...
@@ -606,10 +606,6 @@ static HRESULT WINAPI HTMLElement_Invoke(IHTMLElement *iface, DISPID dispIdMembe
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
}
#define ATTRFLAG_CASESENSITIVE 0x0001
#define ATTRFLAG_ASSTRING 0x0002
#define ATTRFLAG_EXPANDURL 0x0004
static
HRESULT
WINAPI
HTMLElement_setAttribute
(
IHTMLElement
*
iface
,
BSTR
strAttributeName
,
VARIANT
AttributeValue
,
LONG
lFlags
)
{
...
...
@@ -640,14 +636,42 @@ 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
)
{
DISPPARAMS
dispParams
=
{
NULL
,
NULL
,
0
,
0
};
EXCEPINFO
excep
;
HRESULT
hres
;
hres
=
IDispatchEx_InvokeEx
(
&
elem
->
node
.
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_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
;
}
}
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLElement_getAttribute
(
IHTMLElement
*
iface
,
BSTR
strAttributeName
,
LONG
lFlags
,
VARIANT
*
AttributeValue
)
{
HTMLElement
*
This
=
impl_from_IHTMLElement
(
iface
);
DISPID
dispid
;
HRESULT
hres
;
DISPPARAMS
dispParams
=
{
NULL
,
NULL
,
0
,
0
};
EXCEPINFO
excep
;
TRACE
(
"(%p)->(%s %08x %p)
\n
"
,
This
,
debugstr_w
(
strAttributeName
),
lFlags
,
AttributeValue
);
...
...
@@ -666,28 +690,7 @@ static HRESULT WINAPI HTMLElement_getAttribute(IHTMLElement *iface, BSTR strAttr
return
hres
;
}
hres
=
IDispatchEx_InvokeEx
(
&
This
->
node
.
dispex
.
IDispatchEx_iface
,
dispid
,
LOCALE_SYSTEM_DEFAULT
,
DISPATCH_PROPERTYGET
,
&
dispParams
,
AttributeValue
,
&
excep
,
NULL
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
lFlags
&
ATTRFLAG_ASSTRING
)
{
switch
(
V_VT
(
AttributeValue
))
{
case
VT_BSTR
:
break
;
case
VT_DISPATCH
:
IDispatch_Release
(
V_DISPATCH
(
AttributeValue
));
V_VT
(
AttributeValue
)
=
VT_BSTR
;
V_BSTR
(
AttributeValue
)
=
SysAllocString
(
NULL
);
break
;
default:
hres
=
VariantChangeType
(
AttributeValue
,
AttributeValue
,
0
,
VT_BSTR
);
if
(
FAILED
(
hres
))
return
hres
;
}
}
return
S_OK
;
return
get_elem_attr_value_by_dispid
(
This
,
dispid
,
lFlags
,
AttributeValue
);
}
static
HRESULT
WINAPI
HTMLElement_removeAttribute
(
IHTMLElement
*
iface
,
BSTR
strAttributeName
,
...
...
dlls/mshtml/mshtml_private.h
View file @
8e0d6619
...
...
@@ -976,6 +976,12 @@ HRESULT wrap_iface(IUnknown*,IUnknown*,IUnknown**) DECLSPEC_HIDDEN;
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
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