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
995835e1
Commit
995835e1
authored
Sep 17, 2008
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Sep 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Implement IHTMLBody get/put_Text.
parent
b64b5ea5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
4 deletions
+72
-4
htmlbody.c
dlls/mshtml/htmlbody.c
+35
-4
dom.c
dlls/mshtml/tests/dom.c
+37
-0
No files found.
dlls/mshtml/htmlbody.c
View file @
995835e1
...
...
@@ -300,15 +300,46 @@ static HRESULT WINAPI HTMLBodyElement_get_bgColor(IHTMLBodyElement *iface, VARIA
static
HRESULT
WINAPI
HTMLBodyElement_put_text
(
IHTMLBodyElement
*
iface
,
VARIANT
v
)
{
HTMLBodyElement
*
This
=
HTMLBODY_THIS
(
iface
);
FIXME
(
"(%p)->()
\n
"
,
This
);
return
E_NOTIMPL
;
nsAString
text
;
nsresult
nsres
;
TRACE
(
"(%p)->(v%d)
\n
"
,
This
,
V_VT
(
&
v
));
if
(
!
variant_to_nscolor
(
&
v
,
&
text
))
return
S_OK
;
nsres
=
nsIDOMHTMLBodyElement_SetText
(
This
->
nsbody
,
&
text
);
nsAString_Finish
(
&
text
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLBodyElement_get_text
(
IHTMLBodyElement
*
iface
,
VARIANT
*
p
)
{
HTMLBodyElement
*
This
=
HTMLBODY_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsAString
text
;
nsresult
nsres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
text
,
NULL
);
V_VT
(
p
)
=
VT_BSTR
;
V_BSTR
(
p
)
=
NULL
;
nsres
=
nsIDOMHTMLBodyElement_GetText
(
This
->
nsbody
,
&
text
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
sText
;
nsAString_GetData
(
&
text
,
&
sText
);
V_VT
(
p
)
=
VT_BSTR
;
V_BSTR
(
p
)
=
SysAllocString
(
sText
);
}
nsAString_Finish
(
&
text
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLBodyElement_put_link
(
IHTMLBodyElement
*
iface
,
VARIANT
v
)
...
...
dlls/mshtml/tests/dom.c
View file @
995835e1
...
...
@@ -2064,6 +2064,10 @@ static void test_default_body(IHTMLBodyElement *body)
long
l
;
BSTR
bstr
;
HRESULT
hres
;
VARIANT
v
;
WCHAR
sBodyText
[]
=
{
'#'
,
'F'
,
'F'
,
'0'
,
'0'
,
'0'
,
'0'
,
0
};
WCHAR
sTextInvalid
[]
=
{
'I'
,
'n'
,
'v'
,
'a'
,
'l'
,
'i'
,
'd'
,
0
};
WCHAR
sResInvalid
[]
=
{
'#'
,
'0'
,
'0'
,
'a'
,
'0'
,
'd'
,
'0'
,
0
};
bstr
=
(
void
*
)
0xdeadbeef
;
hres
=
IHTMLBodyElement_get_background
(
body
,
&
bstr
);
...
...
@@ -2077,6 +2081,39 @@ static void test_default_body(IHTMLBodyElement *body)
l
=
elem_get_scroll_top
((
IUnknown
*
)
body
);
ok
(
!
l
,
"scrollTop = %ld
\n
"
,
l
);
elem_get_scroll_left
((
IUnknown
*
)
body
);
/* get_text tests */
hres
=
IHTMLBodyElement_get_text
(
body
,
&
v
);
ok
(
hres
==
S_OK
,
"expect S_OK got 0x%08d
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"Expected VT_BSTR got %d
\n
"
,
V_VT
(
&
v
));
ok
(
bstr
==
NULL
,
"bstr != NULL
\n
"
);
/* get_text - Invalid Text */
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
SysAllocString
(
sTextInvalid
);
hres
=
IHTMLBodyElement_put_text
(
body
,
v
);
ok
(
hres
==
S_OK
,
"expect S_OK got 0x%08d
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_NULL
;
hres
=
IHTMLBodyElement_get_text
(
body
,
&
v
);
ok
(
hres
==
S_OK
,
"expect S_OK got 0x%08d
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"Expected VT_BSTR got %d
\n
"
,
V_VT
(
&
v
));
ok
(
!
lstrcmpW
(
sResInvalid
,
V_BSTR
(
&
v
)),
"bstr != sResInvalid
\n
"
);
VariantClear
(
&
v
);
/* get_text - Valid Text */
V_VT
(
&
v
)
=
VT_BSTR
;
V_BSTR
(
&
v
)
=
SysAllocString
(
sBodyText
);
hres
=
IHTMLBodyElement_put_text
(
body
,
v
);
ok
(
hres
==
S_OK
,
"expect S_OK got 0x%08d
\n
"
,
hres
);
V_VT
(
&
v
)
=
VT_NULL
;
hres
=
IHTMLBodyElement_get_text
(
body
,
&
v
);
ok
(
hres
==
S_OK
,
"expect S_OK got 0x%08d
\n
"
,
hres
);
ok
(
V_VT
(
&
v
)
==
VT_BSTR
,
"Expected VT_BSTR got %d
\n
"
,
V_VT
(
&
v
));
ok
(
lstrcmpW
(
bstr
,
V_BSTR
(
&
v
)),
"bstr != V_BSTR(&v)
\n
"
);
VariantClear
(
&
v
);
}
static
void
test_body_funs
(
IHTMLBodyElement
*
body
)
...
...
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