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
9623fcb4
Commit
9623fcb4
authored
Feb 08, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Fixed error handling in IHTMLElementCollection::item in IE9+ mode.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7da84dfe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
htmlelemcol.c
dlls/mshtml/htmlelemcol.c
+14
-10
No files found.
dlls/mshtml/htmlelemcol.c
View file @
9623fcb4
...
...
@@ -63,7 +63,7 @@ static inline HTMLElement *elem_from_HTMLDOMNode(HTMLDOMNode *iface)
return
CONTAINING_RECORD
(
iface
,
HTMLElement
,
node
);
}
static
IHTMLElementCollection
*
HTMLElementCollection_Create
(
HTMLElement
**
elems
,
DWORD
len
);
static
IHTMLElementCollection
*
HTMLElementCollection_Create
(
HTMLElement
**
,
DWORD
,
compat_mode_t
);
static
void
elem_vector_add
(
elem_vector_t
*
buf
,
HTMLElement
*
elem
)
{
...
...
@@ -421,7 +421,7 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
case
VT_I4
:
case
VT_INT
:
if
(
V_I4
(
&
name
)
<
0
)
return
E_INVALIDARG
;
return
dispex_compat_mode
(
&
This
->
dispex
)
<
COMPAT_MODE_IE9
?
E_INVALIDARG
:
S_OK
;
hres
=
get_item_idx
(
This
,
V_I4
(
&
name
),
pdisp
);
break
;
...
...
@@ -462,7 +462,8 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
if
(
buf
.
len
>
1
)
{
elem_vector_normalize
(
&
buf
);
*
pdisp
=
(
IDispatch
*
)
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
);
*
pdisp
=
(
IDispatch
*
)
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
,
dispex_compat_mode
(
&
This
->
dispex
));
}
else
{
if
(
buf
.
len
==
1
)
{
/* Already AddRef-ed */
...
...
@@ -524,7 +525,8 @@ static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface,
TRACE
(
"fount %d tags
\n
"
,
buf
.
len
);
*
pdisp
=
(
IDispatch
*
)
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
);
*
pdisp
=
(
IDispatch
*
)
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
,
dispex_compat_mode
(
&
This
->
dispex
));
return
S_OK
;
}
...
...
@@ -677,7 +679,8 @@ IHTMLElementCollection *create_all_collection(HTMLDOMNode *node, BOOL include_ro
create_all_list
(
node
->
doc
,
node
,
&
buf
);
elem_vector_normalize
(
&
buf
);
return
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
);
return
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
,
dispex_compat_mode
(
&
node
->
event_target
.
dispex
));
}
IHTMLElementCollection
*
create_collection_from_nodelist
(
HTMLDocumentNode
*
doc
,
nsIDOMNodeList
*
nslist
)
...
...
@@ -712,7 +715,7 @@ IHTMLElementCollection *create_collection_from_nodelist(HTMLDocumentNode *doc, n
buf
.
buf
=
NULL
;
}
return
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
);
return
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
,
doc
->
document_mode
);
}
IHTMLElementCollection
*
create_collection_from_htmlcol
(
HTMLDocumentNode
*
doc
,
nsIDOMHTMLCollection
*
nscol
)
...
...
@@ -748,7 +751,7 @@ IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocumentNode *doc, ns
return
NULL
;
}
return
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
);
return
HTMLElementCollection_Create
(
buf
.
buf
,
buf
.
len
,
doc
->
document_mode
);
}
HRESULT
get_elem_source_index
(
HTMLElement
*
elem
,
LONG
*
ret
)
...
...
@@ -820,7 +823,8 @@ HRESULT get_elem_source_index(HTMLElement *elem, LONG *ret)
return
S_OK
;
}
static
IHTMLElementCollection
*
HTMLElementCollection_Create
(
HTMLElement
**
elems
,
DWORD
len
)
static
IHTMLElementCollection
*
HTMLElementCollection_Create
(
HTMLElement
**
elems
,
DWORD
len
,
compat_mode_t
compat_mode
)
{
HTMLElementCollection
*
ret
=
heap_alloc_zero
(
sizeof
(
HTMLElementCollection
));
...
...
@@ -832,8 +836,8 @@ static IHTMLElementCollection *HTMLElementCollection_Create(HTMLElement **elems,
ret
->
elems
=
elems
;
ret
->
len
=
len
;
init_dispex
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IHTMLElementCollection_iface
,
&
HTMLElementCollection_dispex
);
init_dispex
_with_compat_mode
(
&
ret
->
dispex
,
(
IUnknown
*
)
&
ret
->
IHTMLElementCollection_iface
,
&
HTMLElementCollection_dispex
,
compat_mode
);
TRACE
(
"ret=%p len=%d
\n
"
,
ret
,
len
);
...
...
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