Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e1dcafc6
Commit
e1dcafc6
authored
Aug 25, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added HTMLAttributeCollection_item implementation.
parent
7b37a1bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
4 deletions
+99
-4
htmlelem.c
dlls/mshtml/htmlelem.c
+99
-4
No files found.
dlls/mshtml/htmlelem.c
View file @
e1dcafc6
...
...
@@ -2262,11 +2262,90 @@ static HRESULT WINAPI HTMLAttributeCollection__newEnum(IHTMLAttributeCollection
return
E_NOTIMPL
;
}
static
inline
HRESULT
get_attr_dispid_by_idx
(
HTMLAttributeCollection
*
This
,
LONG
index
,
DISPID
*
id
)
{
if
(
index
<
0
||
index
>=
This
->
size
)
return
DISP_E_UNKNOWNNAME
;
*
id
=
This
->
collection
[
index
];
return
S_OK
;
}
static
inline
HRESULT
get_attr_dispid_by_name
(
HTMLAttributeCollection
*
This
,
BSTR
name
,
DISPID
*
id
)
{
HRESULT
hres
;
if
(
name
[
0
]
>=
'0'
&&
name
[
0
]
<=
'9'
)
{
WCHAR
*
end_ptr
;
LONG
idx
;
idx
=
strtoulW
(
name
,
&
end_ptr
,
10
);
if
(
!*
end_ptr
)
{
hres
=
get_attr_dispid_by_idx
(
This
,
idx
,
id
);
if
(
SUCCEEDED
(
hres
))
return
hres
;
}
}
hres
=
IDispatchEx_GetDispID
(
&
This
->
elem
->
node
.
dispex
.
IDispatchEx_iface
,
name
,
fdexNameCaseInsensitive
,
id
);
return
hres
;
}
static
inline
HRESULT
get_domattr
(
HTMLElement
*
elem
,
DISPID
id
,
HTMLDOMAttribute
**
attr
)
{
HTMLDOMAttribute
*
iter
;
HRESULT
hres
;
*
attr
=
NULL
;
LIST_FOR_EACH_ENTRY
(
iter
,
&
elem
->
attrs
,
HTMLDOMAttribute
,
entry
)
{
if
(
iter
->
dispid
==
id
)
{
*
attr
=
iter
;
break
;
}
}
if
(
!*
attr
)
{
hres
=
HTMLDOMAttribute_Create
(
elem
,
id
,
attr
);
if
(
FAILED
(
hres
))
return
hres
;
}
IHTMLDOMAttribute_AddRef
(
&
(
*
attr
)
->
IHTMLDOMAttribute_iface
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLAttributeCollection_item
(
IHTMLAttributeCollection
*
iface
,
VARIANT
*
name
,
IDispatch
**
ppItem
)
{
HTMLAttributeCollection
*
This
=
impl_from_IHTMLAttributeCollection
(
iface
);
FIXME
(
"(%p)->(%s, %p)
\n
"
,
This
,
debugstr_variant
(
name
),
ppItem
);
return
E_NOTIMPL
;
HTMLDOMAttribute
*
attr
;
DISPID
id
;
HRESULT
hres
;
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_variant
(
name
),
ppItem
);
switch
(
V_VT
(
name
))
{
case
VT_I4
:
hres
=
get_attr_dispid_by_idx
(
This
,
V_I4
(
name
),
&
id
);
break
;
case
VT_BSTR
:
hres
=
get_attr_dispid_by_name
(
This
,
V_BSTR
(
name
),
&
id
);
break
;
default:
FIXME
(
"unsupported vt %x
\n
"
,
V_VT
(
name
));
hres
=
E_NOTIMPL
;
}
if
(
hres
==
DISP_E_UNKNOWNNAME
)
return
E_INVALIDARG
;
if
(
FAILED
(
hres
))
return
hres
;
hres
=
get_domattr
(
This
->
elem
,
id
,
&
attr
);
if
(
FAILED
(
hres
))
return
hres
;
*
ppItem
=
(
IDispatch
*
)
&
attr
->
IHTMLDOMAttribute_iface
;
return
S_OK
;
}
static
const
IHTMLAttributeCollectionVtbl
HTMLAttributeCollectionVtbl
=
{
...
...
@@ -2452,8 +2531,24 @@ static HRESULT WINAPI HTMLAttributeCollection3_removeNamedItem(IHTMLAttributeCol
static
HRESULT
WINAPI
HTMLAttributeCollection3_item
(
IHTMLAttributeCollection3
*
iface
,
LONG
index
,
IHTMLDOMAttribute
**
ppNodeOut
)
{
HTMLAttributeCollection
*
This
=
impl_from_IHTMLAttributeCollection3
(
iface
);
FIXME
(
"(%p)->(%d %p)
\n
"
,
This
,
index
,
ppNodeOut
);
return
E_NOTIMPL
;
HTMLDOMAttribute
*
attr
;
DISPID
id
;
HRESULT
hres
;
TRACE
(
"(%p)->(%d %p)
\n
"
,
This
,
index
,
ppNodeOut
);
hres
=
get_attr_dispid_by_idx
(
This
,
index
,
&
id
);
if
(
hres
==
DISP_E_UNKNOWNNAME
)
return
E_INVALIDARG
;
if
(
FAILED
(
hres
))
return
hres
;
hres
=
get_domattr
(
This
->
elem
,
id
,
&
attr
);
if
(
FAILED
(
hres
))
return
hres
;
*
ppNodeOut
=
&
attr
->
IHTMLDOMAttribute_iface
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLAttributeCollection3_get_length
(
IHTMLAttributeCollection3
*
iface
,
LONG
*
p
)
...
...
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