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
6420744c
Commit
6420744c
authored
Oct 10, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Oct 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Split the lookup for an element with name into a separate helper.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
8de5187d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
htmldoc.c
dlls/mshtml/htmldoc.c
+17
-12
No files found.
dlls/mshtml/htmldoc.c
View file @
6420744c
...
...
@@ -4818,30 +4818,30 @@ static inline HTMLDocument *impl_from_IDispatchEx(IDispatchEx *iface)
return
CONTAINING_RECORD
(
iface
,
HTMLDocument
,
IDispatchEx_iface
);
}
static
HRESULT
dispid_from_elem_name
(
HTMLDocumentNode
*
This
,
BSTR
name
,
DISPID
*
dispid
)
static
HRESULT
has_elem_name
(
nsIDOMHTMLDocument
*
nsdoc
,
const
WCHAR
*
name
)
{
nsIDOMNodeList
*
node_list
;
nsAString
name_str
;
UINT32
len
;
unsigned
i
;
nsresult
nsres
;
if
(
!
This
->
nsdoc
)
return
DISP_E_UNKNOWNNAME
;
UINT32
len
;
nsAString_InitDepend
(
&
name_str
,
name
);
nsres
=
nsIDOMHTMLDocument_GetElementsByName
(
This
->
nsdoc
,
&
name_str
,
&
node_list
);
nsres
=
nsIDOMHTMLDocument_GetElementsByName
(
nsdoc
,
&
name_str
,
&
node_list
);
nsAString_Finish
(
&
name_str
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
return
map_nsresult
(
nsres
)
;
nsres
=
nsIDOMNodeList_GetLength
(
node_list
,
&
len
);
nsIDOMNodeList_Release
(
node_list
);
if
(
NS_FAILED
(
nsres
))
return
E_FAIL
;
return
map_nsresult
(
nsres
);
return
len
?
S_OK
:
DISP_E_UNKNOWNNAME
;
}
if
(
!
len
)
return
DISP_E_UNKNOWNNAME
;
static
HRESULT
dispid_from_elem_name
(
HTMLDocumentNode
*
This
,
const
WCHAR
*
name
,
DISPID
*
dispid
)
{
unsigned
i
;
for
(
i
=
0
;
i
<
This
->
elem_vars_cnt
;
i
++
)
{
if
(
!
wcscmp
(
name
,
This
->
elem_vars
[
i
]))
{
...
...
@@ -4943,7 +4943,12 @@ static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
if
(
hres
!=
DISP_E_UNKNOWNNAME
)
return
hres
;
return
dispid_from_elem_name
(
This
->
doc_node
,
bstrName
,
pid
);
if
(
This
->
doc_node
->
nsdoc
)
{
hres
=
has_elem_name
(
This
->
doc_node
->
nsdoc
,
bstrName
);
if
(
SUCCEEDED
(
hres
))
hres
=
dispid_from_elem_name
(
This
->
doc_node
,
bstrName
,
pid
);
}
return
hres
;
}
static
HRESULT
WINAPI
DocDispatchEx_InvokeEx
(
IDispatchEx
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pdp
,
...
...
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