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
ad1599f2
Commit
ad1599f2
authored
Feb 20, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Share more code between get_form implementations.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cff46126
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
114 deletions
+38
-114
htmlform.c
dlls/mshtml/htmlform.c
+32
-0
htmlinput.c
dlls/mshtml/htmlinput.c
+2
-38
htmloption.c
dlls/mshtml/htmloption.c
+1
-27
htmlselect.c
dlls/mshtml/htmlselect.c
+1
-27
htmltextarea.c
dlls/mshtml/htmltextarea.c
+1
-22
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
No files found.
dlls/mshtml/htmlform.c
View file @
ad1599f2
...
...
@@ -42,6 +42,38 @@ struct HTMLFormElement {
nsIDOMHTMLFormElement
*
nsform
;
};
HRESULT
return_nsform
(
nsresult
nsres
,
nsIDOMHTMLFormElement
*
form
,
IHTMLFormElement
**
p
)
{
nsIDOMNode
*
form_node
;
HTMLDOMNode
*
node
;
HRESULT
hres
;
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetForm failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
if
(
!
form
)
{
*
p
=
NULL
;
TRACE
(
"NULL
\n
"
);
return
S_OK
;
}
nsres
=
nsIDOMHTMLFormElement_QueryInterface
(
form
,
&
IID_nsIDOMNode
,
(
void
**
)
&
form_node
);
nsIDOMHTMLFormElement_Release
(
form
);
assert
(
nsres
==
NS_OK
);
hres
=
get_node
(
form_node
,
TRUE
,
&
node
);
nsIDOMNode_Release
(
form_node
);
if
(
FAILED
(
hres
))
return
hres
;
TRACE
(
"node %p
\n
"
,
node
);
hres
=
IHTMLDOMNode_QueryInterface
(
&
node
->
IHTMLDOMNode_iface
,
&
IID_IHTMLFormElement
,
(
void
**
)
p
);
node_release
(
node
);
return
hres
;
}
static
HRESULT
htmlform_item
(
HTMLFormElement
*
This
,
int
i
,
IDispatch
**
ret
)
{
nsIDOMHTMLCollection
*
elements
;
...
...
dlls/mshtml/htmlinput.c
View file @
ad1599f2
...
...
@@ -46,32 +46,6 @@ struct HTMLInputElement {
static
const
WCHAR
forW
[]
=
{
'f'
,
'o'
,
'r'
,
0
};
static
HRESULT
return_nsform
(
HTMLElement
*
elem
,
nsIDOMHTMLFormElement
*
nsform
,
IHTMLFormElement
**
p
)
{
nsIDOMNode
*
form_node
;
HTMLDOMNode
*
node
;
nsresult
nsres
;
HRESULT
hres
;
if
(
!
nsform
)
{
*
p
=
NULL
;
return
S_OK
;
}
nsres
=
nsIDOMHTMLFormElement_QueryInterface
(
nsform
,
&
IID_nsIDOMNode
,
(
void
**
)
&
form_node
);
nsIDOMHTMLFormElement_Release
(
nsform
);
assert
(
nsres
==
NS_OK
);
hres
=
get_node
(
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
inline
HTMLInputElement
*
impl_from_IHTMLInputElement
(
IHTMLInputElement
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
HTMLInputElement
,
IHTMLInputElement_iface
);
...
...
@@ -288,12 +262,7 @@ static HRESULT WINAPI HTMLInputElement_get_form(IHTMLInputElement *iface, IHTMLF
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsres
=
nsIDOMHTMLInputElement_GetForm
(
This
->
nsinput
,
&
nsform
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetForm failed: %08x, nsform: %p
\n
"
,
nsres
,
nsform
);
return
E_FAIL
;
}
return
return_nsform
(
&
This
->
element
,
nsform
,
p
);
return
return_nsform
(
nsres
,
nsform
,
p
);
}
static
HRESULT
WINAPI
HTMLInputElement_put_size
(
IHTMLInputElement
*
iface
,
LONG
v
)
...
...
@@ -1905,12 +1874,7 @@ static HRESULT WINAPI HTMLButtonElement_get_form(IHTMLButtonElement *iface, IHTM
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsres
=
nsIDOMHTMLButtonElement_GetForm
(
This
->
nsbutton
,
&
nsform
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetForm failed: %08x, nsform: %p
\n
"
,
nsres
,
nsform
);
return
E_FAIL
;
}
return
return_nsform
(
&
This
->
element
,
nsform
,
p
);
return
return_nsform
(
nsres
,
nsform
,
p
);
}
static
HRESULT
WINAPI
HTMLButtonElement_createTextRange
(
IHTMLButtonElement
*
iface
,
IHTMLTxtRange
**
range
)
...
...
dlls/mshtml/htmloption.c
View file @
ad1599f2
...
...
@@ -308,9 +308,6 @@ static HRESULT WINAPI HTMLOptionElement_get_form(IHTMLOptionElement *iface, IHTM
{
HTMLOptionElement
*
This
=
impl_from_IHTMLOptionElement
(
iface
);
nsIDOMHTMLFormElement
*
nsform
;
nsIDOMNode
*
form_node
;
HTMLDOMNode
*
node
;
HRESULT
hres
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
...
...
@@ -319,30 +316,7 @@ static HRESULT WINAPI HTMLOptionElement_get_form(IHTMLOptionElement *iface, IHTM
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
(
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
;
return
return_nsform
(
nsres
,
nsform
,
p
);
}
static
const
IHTMLOptionElementVtbl
HTMLOptionElementVtbl
=
{
...
...
dlls/mshtml/htmlselect.c
View file @
ad1599f2
...
...
@@ -372,9 +372,6 @@ static HRESULT WINAPI HTMLSelectElement_get_form(IHTMLSelectElement *iface, IHTM
{
HTMLSelectElement
*
This
=
impl_from_IHTMLSelectElement
(
iface
);
nsIDOMHTMLFormElement
*
nsform
;
nsIDOMNode
*
form_node
;
HTMLDOMNode
*
node
;
HRESULT
hres
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
...
...
@@ -383,30 +380,7 @@ static HRESULT WINAPI HTMLSelectElement_get_form(IHTMLSelectElement *iface, IHTM
return
E_POINTER
;
nsres
=
nsIDOMHTMLSelectElement_GetForm
(
This
->
nsselect
,
&
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
(
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
;
return
return_nsform
(
nsres
,
nsform
,
p
);
}
static
HRESULT
WINAPI
HTMLSelectElement_add
(
IHTMLSelectElement
*
iface
,
IHTMLElement
*
element
,
...
...
dlls/mshtml/htmltextarea.c
View file @
ad1599f2
...
...
@@ -197,33 +197,12 @@ static HRESULT WINAPI HTMLTextAreaElement_get_form(IHTMLTextAreaElement *iface,
{
HTMLTextAreaElement
*
This
=
impl_from_IHTMLTextAreaElement
(
iface
);
nsIDOMHTMLFormElement
*
nsform
;
nsIDOMNode
*
nsnode
;
HTMLDOMNode
*
node
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsres
=
nsIDOMHTMLTextAreaElement_GetForm
(
This
->
nstextarea
,
&
nsform
);
assert
(
nsres
==
NS_OK
);
if
(
!
nsform
)
{
*
p
=
NULL
;
return
S_OK
;
}
nsres
=
nsIDOMHTMLFormElement_QueryInterface
(
nsform
,
&
IID_nsIDOMNode
,
(
void
**
)
&
nsnode
);
nsIDOMHTMLFormElement_Release
(
nsform
);
assert
(
nsres
==
NS_OK
);
hres
=
get_node
(
nsnode
,
TRUE
,
&
node
);
nsIDOMNode_Release
(
nsnode
);
if
(
FAILED
(
hres
))
return
hres
;
hres
=
IHTMLDOMNode_QueryInterface
(
&
node
->
IHTMLDOMNode_iface
,
&
IID_IHTMLFormElement
,
(
void
**
)
p
);
IHTMLDOMNode_Release
(
&
node
->
IHTMLDOMNode_iface
);
return
hres
;
return
return_nsform
(
nsres
,
nsform
,
p
);
}
static
HRESULT
WINAPI
HTMLTextAreaElement_put_defaultValue
(
IHTMLTextAreaElement
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/mshtml_private.h
View file @
ad1599f2
...
...
@@ -948,6 +948,7 @@ void nsAString_Finish(nsAString*) DECLSPEC_HIDDEN;
HRESULT
return_nsstr
(
nsresult
,
nsAString
*
,
BSTR
*
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsstr_variant
(
nsresult
nsres
,
nsAString
*
nsstr
,
VARIANT
*
p
)
DECLSPEC_HIDDEN
;
HRESULT
return_nsform
(
nsresult
,
nsIDOMHTMLFormElement
*
,
IHTMLFormElement
**
)
DECLSPEC_HIDDEN
;
nsICommandParams
*
create_nscommand_params
(
void
)
DECLSPEC_HIDDEN
;
HRESULT
nsnode_to_nsstring
(
nsIDOMNode
*
,
nsAString
*
)
DECLSPEC_HIDDEN
;
...
...
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