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
23ad0986
Commit
23ad0986
authored
Jun 23, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLImgElement::put_src implementation.
parent
47d83520
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
3 deletions
+80
-3
htmlimg.c
dlls/mshtml/htmlimg.c
+22
-2
nsiface.idl
dlls/mshtml/nsiface.idl
+33
-0
dom.c
dlls/mshtml/tests/dom.c
+25
-1
No files found.
dlls/mshtml/htmlimg.c
View file @
23ad0986
...
...
@@ -35,6 +35,8 @@ typedef struct {
HTMLElement
element
;
const
IHTMLImgElementVtbl
*
lpHTMLImgElementVtbl
;
nsIDOMHTMLImageElement
*
nsimg
;
}
HTMLImgElement
;
#define HTMLIMG(x) ((IHTMLImgElement*) &(x)->lpHTMLImgElementVtbl)
...
...
@@ -240,8 +242,18 @@ static HRESULT WINAPI HTMLImgElement_get_alt(IHTMLImgElement *iface, BSTR *p)
static
HRESULT
WINAPI
HTMLImgElement_put_src
(
IHTMLImgElement
*
iface
,
BSTR
v
)
{
HTMLImgElement
*
This
=
HTMLIMG_THIS
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
E_NOTIMPL
;
nsAString
src_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
nsAString_Init
(
&
src_str
,
v
);
nsres
=
nsIDOMHTMLImageElement_SetSrc
(
This
->
nsimg
,
&
src_str
);
nsAString_Finish
(
&
src_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetSrc failed: %08x
\n
"
,
nsres
);
return
NS_OK
;
}
static
HRESULT
WINAPI
HTMLImgElement_get_src
(
IHTMLImgElement
*
iface
,
BSTR
*
p
)
...
...
@@ -516,6 +528,9 @@ static void HTMLImgElement_destructor(HTMLDOMNode *iface)
{
HTMLImgElement
*
This
=
HTMLIMG_NODE_THIS
(
iface
);
if
(
This
->
nsimg
)
nsIDOMHTMLImageElement_Release
(
This
->
nsimg
);
HTMLElement_destructor
(
&
This
->
element
.
node
);
}
...
...
@@ -544,10 +559,15 @@ static dispex_static_data_t HTMLImgElement_dispex = {
HTMLElement
*
HTMLImgElement_Create
(
nsIDOMHTMLElement
*
nselem
)
{
HTMLImgElement
*
ret
=
heap_alloc_zero
(
sizeof
(
HTMLImgElement
));
nsresult
nsres
;
ret
->
lpHTMLImgElementVtbl
=
&
HTMLImgElementVtbl
;
ret
->
element
.
node
.
vtbl
=
&
HTMLImgElementImplVtbl
;
nsres
=
nsIDOMHTMLElement_QueryInterface
(
nselem
,
&
IID_nsIDOMHTMLImageElement
,
(
void
**
)
&
ret
->
nsimg
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"Could not get nsIDOMHTMLImageElement: %08x
\n
"
,
nsres
);
init_dispex
(
&
ret
->
element
.
node
.
dispex
,
(
IUnknown
*
)
HTMLIMG
(
ret
),
&
HTMLImgElement_dispex
);
HTMLElement_Init
(
&
ret
->
element
);
...
...
dlls/mshtml/nsiface.idl
View file @
23ad0986
...
...
@@ -1297,6 +1297,39 @@ interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
[
object,
uuid(a6cf90ab-15b3-11d2-932e-00805f8add32),
local
]
interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
{
nsresult GetName(nsAString *aName);
nsresult SetName(const nsAString *aName);
nsresult GetAlign(nsAString *aAlign);
nsresult SetAlign(const nsAString *aAlign);
nsresult GetAlt(nsAString *aAlt);
nsresult SetAlt(const nsAString *aAlt);
nsresult GetBorder(nsAString *aBorder);
nsresult SetBorder(const nsAString *aBorder);
nsresult GetHeight(PRInt32 *aHeight);
nsresult SetHeight(PRInt32 aHeight);
nsresult GetHspace(PRInt32 *aHspace);
nsresult SetHspace(PRInt32 aHspace);
nsresult GetIsMap(PRBool *aIsMap);
nsresult SetIsMap(PRBool aIsMap);
nsresult GetLongDesc(nsAString *aLongDesc);
nsresult SetLongDesc(const nsAString *aLongDesc);
nsresult GetSrc(nsAString *aSrc);
nsresult SetSrc(const nsAString *aSrc);
nsresult GetUseMap(nsAString *aUseMap);
nsresult SetUseMap(const nsAString *aUseMap);
nsresult GetVspace(PRInt32 *aVspace);
nsresult SetVspace(PRInt32 aVspace);
nsresult GetWidth(PRInt32 *aWidth);
nsresult SetWidth(PRInt32 aWidth);
}
[
object,
uuid(94928ab3-8b63-11d3-989d-001083010e9b),
local
/* FROZEN */
...
...
dlls/mshtml/tests/dom.c
View file @
23ad0986
...
...
@@ -48,7 +48,7 @@ static const char elem_test_str[] =
"<table><tbody></tbody></table>"
"<script id=
\"
sc
\"
type=
\"
text/javascript
\"
></script>"
"<test />"
"<img
/
"
"<img
id=
\"
imgid
\"
/>
"
"</body></html>"
;
static
const
char
indent_test_str
[]
=
"<html><head><title>test</title></head><body>abc<br /><a href=
\"
about:blank
\"
>123</a></body></html>"
;
...
...
@@ -845,6 +845,23 @@ static long _get_node_type(unsigned line, IUnknown *unk)
return
type
;
}
#define test_img_set_src(u,s) _test_img_set_src(__LINE__,u,s)
static
void
_test_img_set_src
(
unsigned
line
,
IUnknown
*
unk
,
const
char
*
src
)
{
IHTMLImgElement
*
img
;
BSTR
tmp
;
HRESULT
hres
;
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IHTMLImgElement
,
(
void
**
)
&
img
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"Could not get IHTMLImgElement: %08x
\n
"
,
hres
);
tmp
=
a2bstr
(
src
);
hres
=
IHTMLImgElement_put_src
(
img
,
tmp
);
IHTMLImgElement_Release
(
img
);
SysFreeString
(
tmp
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"put_src failed: %08x
\n
"
,
hres
);
}
#define test_input_get_disabled(i,b) _test_input_get_disabled(__LINE__,i,b)
static
void
_test_input_get_disabled
(
unsigned
line
,
IHTMLInputElement
*
input
,
VARIANT_BOOL
exb
)
{
...
...
@@ -1759,6 +1776,7 @@ static void test_elems(IHTMLDocument2 *doc)
long
type
;
HRESULT
hres
;
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
sW
[]
=
{
's'
,
0
};
...
...
@@ -1888,6 +1906,12 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release
(
elem
);
}
elem
=
get_elem_by_id
(
doc
,
imgidW
,
TRUE
);
if
(
elem
)
{
test_img_set_src
((
IUnknown
*
)
elem
,
"about:blank"
);
IHTMLElement_Release
(
elem
);
}
hres
=
IHTMLDocument2_get_body
(
doc
,
&
elem
);
ok
(
hres
==
S_OK
,
"get_body failed: %08x
\n
"
,
hres
);
...
...
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