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
9bf51405
Commit
9bf51405
authored
Nov 06, 2006
by
Kovács András
Committed by
Alexandre Julliard
Nov 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: HTMLElementCollection_item implementation.
parent
63b62dc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
12 deletions
+63
-12
htmlelem.c
dlls/mshtml/htmlelem.c
+63
-12
No files found.
dlls/mshtml/htmlelem.c
View file @
9bf51405
...
...
@@ -1183,22 +1183,73 @@ static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
{
HTMLElementCollection
*
This
=
ELEMCOL_THIS
(
iface
);
if
(
V_VT
(
&
index
)
!=
VT_I4
)
{
WARN
(
"Invalid index vt=%d
\n
"
,
V_VT
(
&
index
));
return
E_INVALIDARG
;
}
TRACE
(
"(%p)->(v(%d) v(%d) %p)
\n
"
,
This
,
V_VT
(
&
name
),
V_VT
(
&
index
),
pdisp
);
if
(
V_VT
(
&
name
)
!=
VT_I4
||
V_I4
(
&
name
)
!=
V_I4
(
&
index
))
FIXME
(
"Unsupproted name vt=%d
\n
"
,
V_VT
(
&
name
));
if
(
V_VT
(
&
name
)
==
VT_I4
)
{
TRACE
(
"name is VT_I4: %d
\n
"
,
V_I4
(
&
name
));
if
(
V_I4
(
&
name
)
<
0
||
V_I4
(
&
name
)
>=
This
->
len
)
{
ERR
(
"Invalid name! name=%d
\n
"
,
V_I4
(
&
name
));
return
E_INVALIDARG
;
}
TRACE
(
"(%p)->(%d %d %p)
\n
"
,
This
,
V_I4
(
&
name
),
V_I4
(
&
index
),
pdisp
);
*
pdisp
=
(
IDispatch
*
)
This
->
elems
[
V_I4
(
&
name
)];
IDispatch_AddRef
(
*
pdisp
);
TRACE
(
"Returning pdisp=%p
\n
"
,
pdisp
);
return
S_OK
;
}
if
(
V_I4
(
&
index
)
<
0
||
V_I4
(
&
index
)
>=
This
->
len
)
return
E_INVALIDARG
;
if
(
V_VT
(
&
name
)
==
VT_BSTR
)
{
DWORD
i
;
nsAString
tag_str
;
const
PRUnichar
*
tag
;
elem_vector
buf
=
{
NULL
,
0
,
8
};
TRACE
(
"name is VT_BSTR: %s
\n
"
,
debugstr_w
(
V_BSTR
(
&
name
)));
nsAString_Init
(
&
tag_str
,
NULL
);
buf
.
buf
=
mshtml_alloc
(
buf
.
size
*
sizeof
(
HTMLElement
*
));
for
(
i
=
0
;
i
<
This
->
len
;
i
++
)
{
if
(
!
This
->
elems
[
i
]
->
nselem
)
continue
;
nsIDOMHTMLElement_GetId
(
This
->
elems
[
i
]
->
nselem
,
&
tag_str
);
nsAString_GetData
(
&
tag_str
,
&
tag
,
NULL
);
if
(
CompareStringW
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
tag
,
-
1
,
V_BSTR
(
&
name
),
-
1
)
==
CSTR_EQUAL
)
{
TRACE
(
"Found name. elem=%d
\n
"
,
i
);
if
(
V_VT
(
&
index
)
==
VT_I4
)
if
(
buf
.
len
==
V_I4
(
&
index
))
{
nsAString_Finish
(
&
tag_str
);
mshtml_free
(
buf
.
buf
);
buf
.
buf
=
NULL
;
*
pdisp
=
(
IDispatch
*
)
This
->
elems
[
i
];
TRACE
(
"Returning element %d pdisp=%p
\n
"
,
i
,
pdisp
);
IDispatch_AddRef
(
*
pdisp
);
return
S_OK
;
}
elem_vector_add
(
&
buf
,
This
->
elems
[
i
]);
}
}
nsAString_Finish
(
&
tag_str
);
if
(
V_VT
(
&
index
)
==
VT_I4
)
{
mshtml_free
(
buf
.
buf
);
buf
.
buf
=
NULL
;
ERR
(
"Invalid index. index=%d >= buf.len=%d
\n
"
,
V_I4
(
&
index
),
buf
.
len
);
return
E_INVALIDARG
;
}
if
(
!
buf
.
len
)
{
mshtml_free
(
buf
.
buf
);
buf
.
buf
=
NULL
;
}
else
if
(
buf
.
size
>
buf
.
len
)
{
buf
.
buf
=
mshtml_realloc
(
buf
.
buf
,
buf
.
len
*
sizeof
(
HTMLElement
*
));
}
TRACE
(
"Returning %d element(s).
\n
"
,
buf
.
len
);
return
HTMLElementCollection_Create
(
This
->
ref_unk
,
buf
.
buf
,
buf
.
len
,
pdisp
);
}
*
pdisp
=
(
IDispatch
*
)
This
->
elems
[
V_I4
(
&
index
)];
IDispatch_AddRef
(
*
pdisp
);
return
S_OK
;
FIXME
(
"unsupported arguments
\n
"
);
return
E_INVALIDARG
;
}
static
HRESULT
WINAPI
HTMLElementCollection_tags
(
IHTMLElementCollection
*
iface
,
...
...
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