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
3007b73c
Commit
3007b73c
authored
Dec 01, 2009
by
Andrew Eikum
Committed by
Alexandre Julliard
Dec 02, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Support get_dispid and invoke methods in HTMLFormElement.
parent
e5948590
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
1 deletion
+138
-1
htmlform.c
dlls/mshtml/htmlform.c
+138
-1
No files found.
dlls/mshtml/htmlform.c
View file @
3007b73c
...
...
@@ -338,11 +338,148 @@ static void HTMLFormElement_destructor(HTMLDOMNode *iface)
HTMLElement_destructor
(
&
This
->
element
.
node
);
}
static
HRESULT
HTMLFormElement_get_dispid
(
HTMLDOMNode
*
iface
,
BSTR
name
,
DWORD
grfdex
,
DISPID
*
pid
)
{
HTMLFormElement
*
This
=
HTMLFORM_NODE_THIS
(
iface
);
nsIDOMHTMLCollection
*
elements
;
PRUint32
len
,
i
;
static
const
PRUnichar
nameW
[]
=
{
'n'
,
'a'
,
'm'
,
'e'
,
0
};
nsAString
nsname
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s %x %p)
\n
"
,
This
,
wine_dbgstr_w
(
name
),
grfdex
,
pid
);
nsres
=
nsIDOMHTMLFormElement_GetElements
(
This
->
nsform
,
&
elements
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"GetElements failed: 0x%08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMHTMLCollection_GetLength
(
elements
,
&
len
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"GetLength failed: 0x%08x
\n
"
,
nsres
);
nsIDOMHTMLCollection_Release
(
elements
);
return
E_FAIL
;
}
nsAString_Init
(
&
nsname
,
nameW
);
for
(
i
=
0
;
i
<
len
;
++
i
)
{
nsIDOMNode
*
nsitem
;
nsIDOMHTMLElement
*
nshtml_elem
;
nsAString
nsstr
;
const
PRUnichar
*
str
;
nsres
=
nsIDOMHTMLCollection_Item
(
elements
,
i
,
&
nsitem
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"Item failed: 0x%08x
\n
"
,
nsres
);
nsAString_Finish
(
&
nsname
);
nsIDOMHTMLCollection_Release
(
elements
);
return
E_FAIL
;
}
nsres
=
nsIDOMNode_QueryInterface
(
nsitem
,
&
IID_nsIDOMHTMLElement
,
(
void
**
)
&
nshtml_elem
);
nsIDOMNode_Release
(
nsitem
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"Failed to get nsIDOMHTMLNode interface: 0x%08x
\n
"
,
nsres
);
nsAString_Finish
(
&
nsname
);
nsIDOMHTMLCollection_Release
(
elements
);
return
E_FAIL
;
}
/* compare by id attr */
nsAString_Init
(
&
nsstr
,
NULL
);
nsres
=
nsIDOMHTMLElement_GetId
(
nshtml_elem
,
&
nsstr
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"GetId failed: 0x%08x
\n
"
,
nsres
);
nsAString_Finish
(
&
nsname
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
nsIDOMHTMLCollection_Release
(
elements
);
return
E_FAIL
;
}
nsAString_GetData
(
&
nsstr
,
&
str
);
if
(
!
strcmpiW
(
str
,
name
))
{
/* FIXME: using index for dispid */
*
pid
=
MSHTML_DISPID_CUSTOM_MIN
+
i
;
nsAString_Finish
(
&
nsname
);
nsAString_Finish
(
&
nsstr
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
nsIDOMHTMLCollection_Release
(
elements
);
return
S_OK
;
}
/* compare by name attr */
nsres
=
nsIDOMHTMLElement_GetAttribute
(
nshtml_elem
,
&
nsname
,
&
nsstr
);
nsAString_GetData
(
&
nsstr
,
&
str
);
if
(
!
strcmpiW
(
str
,
name
))
{
/* FIXME: using index for dispid */
*
pid
=
MSHTML_DISPID_CUSTOM_MIN
+
i
;
nsAString_Finish
(
&
nsname
);
nsAString_Finish
(
&
nsstr
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
nsIDOMHTMLCollection_Release
(
elements
);
return
S_OK
;
}
nsAString_Finish
(
&
nsstr
);
nsIDOMHTMLElement_Release
(
nshtml_elem
);
}
nsAString_Finish
(
&
nsname
);
nsIDOMHTMLCollection_Release
(
elements
);
return
DISP_E_UNKNOWNNAME
;
}
static
HRESULT
HTMLFormElement_invoke
(
HTMLDOMNode
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
params
,
VARIANT
*
res
,
EXCEPINFO
*
ei
,
IServiceProvider
*
caller
)
{
HTMLFormElement
*
This
=
HTMLFORM_NODE_THIS
(
iface
);
nsIDOMHTMLCollection
*
elements
;
nsIDOMNode
*
item
;
HTMLDOMNode
*
node
;
nsresult
nsres
;
TRACE
(
"(%p)->(%x %x %x %p %p %p %p)
\n
"
,
This
,
id
,
lcid
,
flags
,
params
,
res
,
ei
,
caller
);
nsres
=
nsIDOMHTMLFormElement_GetElements
(
This
->
nsform
,
&
elements
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"GetElements failed: 0x%08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMHTMLCollection_Item
(
elements
,
id
-
MSHTML_DISPID_CUSTOM_MIN
,
&
item
);
nsIDOMHTMLCollection_Release
(
elements
);
if
(
NS_FAILED
(
nsres
))
{
FIXME
(
"Item failed: 0x%08x
\n
"
,
nsres
);
return
E_FAIL
;
}
node
=
get_node
(
This
->
element
.
node
.
doc
,
item
,
TRUE
);
V_VT
(
res
)
=
VT_DISPATCH
;
V_DISPATCH
(
res
)
=
(
IDispatch
*
)
node
;
IHTMLDOMNode_AddRef
(
HTMLDOMNODE
(
node
));
nsIDOMNode_Release
(
item
);
return
S_OK
;
}
#undef HTMLFORM_NODE_THIS
static
const
NodeImplVtbl
HTMLFormElementImplVtbl
=
{
HTMLFormElement_QI
,
HTMLFormElement_destructor
HTMLFormElement_destructor
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
HTMLFormElement_get_dispid
,
HTMLFormElement_invoke
};
static
const
tid_t
HTMLFormElement_iface_tids
[]
=
{
...
...
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