Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
76d667ca
Commit
76d667ca
authored
Mar 09, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLElement::put_innerHTML implementation.
parent
8f2b4954
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
2 deletions
+73
-2
htmlelem.c
dlls/mshtml/htmlelem.c
+31
-2
dom.c
dlls/mshtml/tests/dom.c
+42
-0
No files found.
dlls/mshtml/htmlelem.c
View file @
76d667ca
...
...
@@ -833,8 +833,37 @@ static HRESULT WINAPI HTMLElement_put_innerHTML(IHTMLElement *iface, BSTR v)
static
HRESULT
WINAPI
HTMLElement_get_innerHTML
(
IHTMLElement
*
iface
,
BSTR
*
p
)
{
HTMLElement
*
This
=
HTMLELEM_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsIDOMNSHTMLElement
*
nselem
;
nsAString
html_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
!
This
->
nselem
)
{
FIXME
(
"NULL nselem
\n
"
);
return
E_NOTIMPL
;
}
nsres
=
nsIDOMHTMLElement_QueryInterface
(
This
->
nselem
,
&
IID_nsIDOMNSHTMLElement
,
(
void
**
)
&
nselem
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMNSHTMLElement: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
nsAString_Init
(
&
html_str
,
NULL
);
nsres
=
nsIDOMNSHTMLElement_GetInnerHTML
(
nselem
,
&
html_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
html
;
nsAString_GetData
(
&
html_str
,
&
html
);
*
p
=
*
html
?
SysAllocString
(
html
)
:
NULL
;
}
else
{
FIXME
(
"SetInnerHtml failed %08x
\n
"
,
nsres
);
*
p
=
NULL
;
}
nsAString_Finish
(
&
html_str
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLElement_put_innerText
(
IHTMLElement
*
iface
,
BSTR
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
76d667ca
...
...
@@ -1132,6 +1132,39 @@ static void _test_elem_set_innertext(unsigned line, IHTMLElement *elem, const ch
}
#define test_elem_innerhtml(e,t) _test_elem_innerhtml(__LINE__,e,t)
static
void
_test_elem_innerhtml
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
inner_html
)
{
IHTMLElement
*
elem
=
_get_elem_iface
(
line
,
unk
);
BSTR
html
;
HRESULT
hres
;
hres
=
IHTMLElement_get_innerHTML
(
elem
,
&
html
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_innerHTML failed: %08x
\n
"
,
hres
);
if
(
inner_html
)
ok_
(
__FILE__
,
line
)(
!
strcmp_wa
(
html
,
inner_html
),
"unexpected innerHTML: %s
\n
"
,
dbgstr_w
(
html
));
else
ok_
(
__FILE__
,
line
)(
!
html
,
"innerHTML = %s
\n
"
,
dbgstr_w
(
html
));
IHTMLElement_Release
(
elem
);
SysFreeString
(
html
);
}
#define test_elem_set_innerhtml(e,t) _test_elem_set_innerhtml(__LINE__,e,t)
static
void
_test_elem_set_innerhtml
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
inner_html
)
{
IHTMLElement
*
elem
=
_get_elem_iface
(
line
,
unk
);
BSTR
html
;
HRESULT
hres
;
html
=
a2bstr
(
inner_html
);
hres
=
IHTMLElement_put_innerHTML
(
elem
,
html
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"put_innerHTML failed: %08x
\n
"
,
hres
);
IHTMLElement_Release
(
elem
);
SysFreeString
(
html
);
}
#define get_first_child(n) _get_first_child(__LINE__,n)
static
IHTMLDOMNode
*
_get_first_child
(
unsigned
line
,
IUnknown
*
unk
)
{
...
...
@@ -4051,6 +4084,7 @@ static void test_elems(IHTMLDocument2 *doc)
static
const
WCHAR
imgidW
[]
=
{
'i'
,
'm'
,
'g'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
inW
[]
=
{
'i'
,
'n'
,
0
};
static
const
WCHAR
xW
[]
=
{
'x'
,
0
};
static
const
WCHAR
yW
[]
=
{
'y'
,
0
};
static
const
WCHAR
sW
[]
=
{
's'
,
0
};
static
const
WCHAR
scW
[]
=
{
's'
,
'c'
,
0
};
static
const
WCHAR
xxxW
[]
=
{
'x'
,
'x'
,
'x'
,
0
};
...
...
@@ -4449,6 +4483,13 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElementCollection_Release
(
col
);
}
elem
=
get_doc_elem_by_id
(
doc
,
yW
);
test_elem_set_innerhtml
((
IUnknown
*
)
elem
,
"inner html"
);
test_elem_innerhtml
((
IUnknown
*
)
elem
,
"inner html"
);
test_elem_set_innerhtml
((
IUnknown
*
)
elem
,
""
);
test_elem_innerhtml
((
IUnknown
*
)
elem
,
NULL
);
IHTMLElement_Release
(
elem
);
IHTMLDocument3_Release
(
doc3
);
}
...
...
@@ -4515,6 +4556,7 @@ static void test_create_elems(IHTMLDocument2 *doc)
IHTMLDOMNode_Release
(
node3
);
test_elem_innertext
(
body
,
"insert test"
);
test_elem_innerhtml
((
IUnknown
*
)
body
,
"insert test"
);
hres
=
IHTMLDocument2_QueryInterface
(
doc
,
&
IID_IHTMLDocument5
,
(
void
**
)
&
doc5
);
if
(
hres
==
S_OK
)
...
...
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