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
e8c68785
Commit
e8c68785
authored
Aug 22, 2015
by
Zhenbo Li
Committed by
Alexandre Julliard
Aug 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Add IHTMLOptionElement::form property implementation.
parent
85c31979
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
3 deletions
+73
-3
htmloption.c
dlls/mshtml/htmloption.c
+36
-2
dom.c
dlls/mshtml/tests/dom.c
+37
-1
No files found.
dlls/mshtml/htmloption.c
View file @
e8c68785
...
...
@@ -307,8 +307,42 @@ static HRESULT WINAPI HTMLOptionElement_get_text(IHTMLOptionElement *iface, BSTR
static
HRESULT
WINAPI
HTMLOptionElement_get_form
(
IHTMLOptionElement
*
iface
,
IHTMLFormElement
**
p
)
{
HTMLOptionElement
*
This
=
impl_from_IHTMLOptionElement
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsIDOMHTMLFormElement
*
nsform
;
nsIDOMNode
*
form_node
;
HTMLDOMNode
*
node
;
HRESULT
hres
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
p
)
return
E_POINTER
;
nsres
=
nsIDOMHTMLOptionElement_GetForm
(
This
->
nsoption
,
&
nsform
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetForm failed: %08x, nsform: %p
\n
"
,
nsres
,
nsform
);
*
p
=
NULL
;
return
E_FAIL
;
}
if
(
nsform
==
NULL
)
{
TRACE
(
"nsform not found
\n
"
);
*
p
=
NULL
;
return
S_OK
;
}
nsres
=
nsIDOMHTMLFormElement_QueryInterface
(
nsform
,
&
IID_nsIDOMNode
,
(
void
**
)
&
form_node
);
nsIDOMHTMLFormElement_Release
(
nsform
);
assert
(
nsres
==
NS_OK
);
hres
=
get_node
(
This
->
element
.
node
.
doc
,
form_node
,
TRUE
,
&
node
);
nsIDOMNode_Release
(
form_node
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
IHTMLDOMNode_QueryInterface
(
&
node
->
IHTMLDOMNode_iface
,
&
IID_IHTMLElement
,
(
void
**
)
p
);
node_release
(
node
);
return
hres
;
}
static
const
IHTMLOptionElementVtbl
HTMLOptionElementVtbl
=
{
...
...
dlls/mshtml/tests/dom.c
View file @
e8c68785
...
...
@@ -891,6 +891,17 @@ static IHTMLSelectElement *_get_select_iface(unsigned line, IUnknown *unk)
return
select
;
}
#define get_option_iface(u) _get_option_iface(__LINE__,u)
static
IHTMLOptionElement
*
_get_option_iface
(
unsigned
line
,
IUnknown
*
unk
)
{
IHTMLOptionElement
*
option
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IHTMLOptionElement
,
(
void
**
)
&
option
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"Could not get IHTMLOptionElement: %08x
\n
"
,
hres
);
return
option
;
}
#define get_form_iface(u) _get_form_iface(__LINE__,u)
static
IHTMLFormElement
*
_get_form_iface
(
unsigned
line
,
IUnknown
*
unk
)
{
...
...
@@ -5146,6 +5157,25 @@ static void test_create_option_elem(IHTMLDocument2 *doc)
IHTMLOptionElement_Release
(
option
);
}
static
void
test_option_form
(
IUnknown
*
uoption
,
IUnknown
*
uform
)
{
IHTMLOptionElement
*
option
=
get_option_iface
(
uoption
);
IHTMLFormElement
*
form
;
HRESULT
hres
;
hres
=
IHTMLOptionElement_get_form
(
option
,
NULL
);
ok
(
hres
==
E_POINTER
,
"got %08x
\n
, expected E_POINTER
\n
"
,
hres
);
hres
=
IHTMLOptionElement_get_form
(
option
,
&
form
);
ok
(
hres
==
S_OK
,
"get_form failed: %08x
\n
"
,
hres
);
ok
(
form
!=
NULL
,
"form == NULL
\n
"
);
ok
(
iface_cmp
(
uform
,
(
IUnknown
*
)
form
),
"Expected %p, got %p
\n
"
,
uform
,
form
);
IHTMLOptionElement_Release
(
option
);
IHTMLFormElement_Release
(
form
);
}
static
void
test_create_img_elem
(
IHTMLDocument2
*
doc
)
{
IHTMLImgElement
*
img
;
...
...
@@ -8582,12 +8612,18 @@ static void test_elems2(IHTMLDocument2 *doc)
}
test_elem_set_innerhtml
((
IUnknown
*
)
div
,
"<form id=
\"
form
\"
name=
\"
form_name
\"
><select id=
\"
sform
\"
></select></form>"
);
"<form id=
\"
form
\"
name=
\"
form_name
\"
><select id=
\"
sform
\"
><
option id=
\"
oform
\"
></option><
/select></form>"
);
elem
=
get_elem_by_id
(
doc
,
"sform"
,
TRUE
);
elem2
=
get_elem_by_id
(
doc
,
"form"
,
TRUE
);
if
(
elem
&&
elem2
)
{
test_select_form
((
IUnknown
*
)
elem
,
(
IUnknown
*
)
elem2
);
IHTMLElement_Release
(
elem
);
elem
=
get_elem_by_id
(
doc
,
"oform"
,
TRUE
);
if
(
elem
)
{
test_option_form
((
IUnknown
*
)
elem
,
(
IUnknown
*
)
elem2
);
IHTMLElement_Release
(
elem
);
}
IHTMLElement_Release
(
elem2
);
}
...
...
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