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
531a07db
Commit
531a07db
authored
Feb 19, 2011
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Oct 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement IHTMLDOMNode replaceChild.
parent
d0451f6b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
htmlnode.c
dlls/mshtml/htmlnode.c
+31
-2
dom.c
dlls/mshtml/tests/dom.c
+36
-0
No files found.
dlls/mshtml/htmlnode.c
View file @
531a07db
...
...
@@ -580,8 +580,37 @@ static HRESULT WINAPI HTMLDOMNode_replaceChild(IHTMLDOMNode *iface, IHTMLDOMNode
IHTMLDOMNode
*
oldChild
,
IHTMLDOMNode
**
node
)
{
HTMLDOMNode
*
This
=
impl_from_IHTMLDOMNode
(
iface
);
FIXME
(
"(%p)->(%p %p %p)
\n
"
,
This
,
newChild
,
oldChild
,
node
);
return
E_NOTIMPL
;
HTMLDOMNode
*
node_new
;
HTMLDOMNode
*
node_old
;
nsIDOMNode
*
nsnode
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p %p %p)
\n
"
,
This
,
newChild
,
oldChild
,
node
);
node_new
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
newChild
);
if
(
!
node_new
)
return
E_FAIL
;
node_old
=
get_node_obj
(
This
->
doc
,
(
IUnknown
*
)
oldChild
);
if
(
!
node_old
)
return
E_FAIL
;
nsres
=
nsIDOMNode_ReplaceChild
(
This
->
nsnode
,
node_new
->
nsnode
,
node_old
->
nsnode
,
&
nsnode
);
if
(
NS_FAILED
(
nsres
))
{
return
E_FAIL
;
}
nsnode
=
node_new
->
nsnode
;
hres
=
get_node
(
This
->
doc
,
nsnode
,
TRUE
,
&
node_new
);
nsIDOMNode_Release
(
nsnode
);
if
(
FAILED
(
hres
))
return
hres
;
*
node
=
&
node_new
->
IHTMLDOMNode_iface
;
IHTMLDOMNode_AddRef
(
*
node
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDOMNode_cloneNode
(
IHTMLDOMNode
*
iface
,
VARIANT_BOOL
fDeep
,
...
...
dlls/mshtml/tests/dom.c
View file @
531a07db
...
...
@@ -5639,6 +5639,41 @@ static void test_create_elems(IHTMLDocument2 *doc)
IHTMLElement_Release
(
body
);
}
static
void
test_replacechild_elems
(
IHTMLDocument2
*
doc
)
{
IHTMLElement
*
body
;
IHTMLDOMNode
*
node
,
*
node2
,
*
node3
;
IHTMLDOMNode
*
nodeBody
,
*
nodeNew
;
HRESULT
hres
;
VARIANT
var
;
body
=
doc_get_body
(
doc
);
node
=
test_create_text
(
doc
,
"insert"
);
V_VT
(
&
var
)
=
VT_NULL
;
V_DISPATCH
(
&
var
)
=
NULL
;
node2
=
test_node_insertbefore
((
IUnknown
*
)
body
,
node
,
&
var
);
IHTMLDOMNode_Release
(
node
);
test_elem_innertext
(
body
,
"insert"
);
node3
=
test_create_text
(
doc
,
"replaced"
);
nodeBody
=
_get_node_iface
(
__LINE__
,
(
IUnknown
*
)
body
);
hres
=
IHTMLDOMNode_replaceChild
(
nodeBody
,
node3
,
node2
,
&
nodeNew
);
ok
(
hres
==
S_OK
,
"Expected S_OK, got 0x%08x
\n
"
,
hres
);
test_elem_innertext
(
body
,
"replaced"
);
IHTMLDOMNode_Release
(
node2
);
IHTMLDOMNode_Release
(
node3
);
IHTMLDOMNode_Release
(
nodeBody
);
IHTMLElement_Release
(
body
);
}
static
void
test_null_write
(
IHTMLDocument2
*
doc
)
{
HRESULT
hres
;
...
...
@@ -6201,6 +6236,7 @@ START_TEST(dom)
run_domtest
(
cond_comment_str
,
test_cond_comment
);
run_domtest
(
frameset_str
,
test_frameset
);
run_domtest
(
emptydiv_str
,
test_docfrag
);
run_domtest
(
doc_blank
,
test_replacechild_elems
);
CoUninitialize
();
}
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