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
beec20f2
Commit
beec20f2
authored
Oct 13, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLDOMNode::insertBefore implementation.
parent
aae2c59d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
5 deletions
+78
-5
htmlnode.c
dlls/mshtml/htmlnode.c
+42
-2
dom.c
dlls/mshtml/tests/dom.c
+36
-3
No files found.
dlls/mshtml/htmlnode.c
View file @
beec20f2
...
...
@@ -446,8 +446,48 @@ static HRESULT WINAPI HTMLDOMNode_insertBefore(IHTMLDOMNode *iface, IHTMLDOMNode
VARIANT
refChild
,
IHTMLDOMNode
**
node
)
{
HTMLDOMNode
*
This
=
HTMLDOMNODE_THIS
(
iface
);
FIXME
(
"(%p)->(%p v %p)
\n
"
,
This
,
newChild
,
node
);
return
E_NOTIMPL
;
nsIDOMNode
*
nsnode
,
*
nsref
=
NULL
;
HTMLDOMNode
*
new_child
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p %s %p)
\n
"
,
This
,
newChild
,
debugstr_variant
(
&
refChild
),
node
);
new_child
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
newChild
);
if
(
!
new_child
)
{
ERR
(
"invalid newChild
\n
"
);
return
E_INVALIDARG
;
}
switch
(
V_VT
(
&
refChild
))
{
case
VT_NULL
:
break
;
case
VT_DISPATCH
:
{
HTMLDOMNode
*
ref_node
;
ref_node
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
V_DISPATCH
(
&
refChild
));
if
(
!
ref_node
)
{
ERR
(
"unvalid node
\n
"
);
return
E_FAIL
;
}
nsref
=
ref_node
->
nsnode
;
break
;
}
default:
FIXME
(
"unimplemented vt %d
\n
"
,
V_VT
(
&
refChild
));
return
E_NOTIMPL
;
}
nsres
=
nsIDOMNode_InsertBefore
(
This
->
nsnode
,
new_child
->
nsnode
,
nsref
,
&
nsnode
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"InsertBefore failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
*
node
=
HTMLDOMNODE
(
get_node
(
This
->
doc
,
nsnode
,
TRUE
));
nsIDOMNode_Release
(
nsnode
);
IHTMLDOMNode_AddRef
(
*
node
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDOMNode_removeChild
(
IHTMLDOMNode
*
iface
,
IHTMLDOMNode
*
oldChild
,
...
...
dlls/mshtml/tests/dom.c
View file @
beec20f2
...
...
@@ -1674,6 +1674,23 @@ static IHTMLDOMNode *_test_node_append_child(unsigned line, IUnknown *node_unk,
return
new_child
;
}
#define test_node_insertbefore(n,c,v) _test_node_insertbefore(__LINE__,n,c,v)
static
IHTMLDOMNode
*
_test_node_insertbefore
(
unsigned
line
,
IUnknown
*
node_unk
,
IHTMLDOMNode
*
child
,
VARIANT
*
var
)
{
IHTMLDOMNode
*
node
=
_get_node_iface
(
line
,
node_unk
);
IHTMLDOMNode
*
new_child
=
NULL
;
HRESULT
hres
;
hres
=
IHTMLDOMNode_insertBefore
(
node
,
child
,
*
var
,
&
new_child
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"insertBefore failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)
(
new_child
!=
NULL
,
"new_child == NULL
\n
"
);
/* TODO ok_(__FILE__,line) (new_child != child, "new_child == child\n"); */
IHTMLDOMNode_Release
(
node
);
return
new_child
;
}
#define test_node_remove_child(n,c) _test_node_remove_child(__LINE__,n,c)
static
void
_test_node_remove_child
(
unsigned
line
,
IUnknown
*
unk
,
IHTMLDOMNode
*
child
)
{
...
...
@@ -1682,7 +1699,7 @@ static void _test_node_remove_child(unsigned line, IUnknown *unk, IHTMLDOMNode *
HRESULT
hres
;
hres
=
IHTMLDOMNode_removeChild
(
node
,
child
,
&
new_node
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"
append
Child failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"
remove
Child failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)
(
new_node
!=
NULL
,
"new_node == NULL
\n
"
);
/* TODO ok_(__FILE__,line) (new_node != child, "new_node == child\n"); */
...
...
@@ -3209,8 +3226,9 @@ static void test_elems(IHTMLDocument2 *doc)
static
void
test_create_elems
(
IHTMLDocument2
*
doc
)
{
IHTMLElement
*
elem
,
*
body
,
*
elem2
;
IHTMLDOMNode
*
node
;
IHTMLDOMNode
*
node
,
*
node2
,
*
node3
;
IDispatch
*
disp
;
VARIANT
var
;
long
type
;
HRESULT
hres
;
...
...
@@ -3245,14 +3263,29 @@ static void test_create_elems(IHTMLDocument2 *doc)
IDispatch_Release
(
disp
);
test_node_has_child
((
IUnknown
*
)
body
,
VARIANT_FALSE
);
IHTMLElement_Release
(
body
);
IHTMLElement_Release
(
elem
);
IHTMLDOMNode_Release
(
node
);
node
=
test_create_text
(
doc
,
"test"
);
test_ifaces
((
IUnknown
*
)
node
,
text_iids
);
test_disp
((
IUnknown
*
)
node
,
&
DIID_DispHTMLDOMTextNode
);
V_VT
(
&
var
)
=
VT_NULL
;
node2
=
test_node_insertbefore
((
IUnknown
*
)
body
,
node
,
&
var
);
IHTMLDOMNode_Release
(
node
);
node
=
test_create_text
(
doc
,
"insert "
);
V_VT
(
&
var
)
=
VT_DISPATCH
;
V_DISPATCH
(
&
var
)
=
(
IDispatch
*
)
node2
;
node3
=
test_node_insertbefore
((
IUnknown
*
)
body
,
node
,
&
var
);
IHTMLDOMNode_Release
(
node
);
IHTMLDOMNode_Release
(
node2
);
IHTMLDOMNode_Release
(
node3
);
test_elem_innertext
(
body
,
"insert test"
);
IHTMLElement_Release
(
body
);
}
static
void
test_exec
(
IUnknown
*
unk
,
const
GUID
*
grpid
,
DWORD
cmdid
,
VARIANT
*
in
,
VARIANT
*
out
)
...
...
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