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
2d4236bf
Commit
2d4236bf
authored
Oct 13, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLWindow2::name property implementation.
parent
6310ff1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
4 deletions
+90
-4
htmlwindow.c
dlls/mshtml/htmlwindow.c
+38
-4
dom.c
dlls/mshtml/tests/dom.c
+52
-0
No files found.
dlls/mshtml/htmlwindow.c
View file @
2d4236bf
...
...
@@ -438,15 +438,49 @@ static HRESULT WINAPI HTMLWindow2_get_navigator(IHTMLWindow2 *iface, IOmNavigato
static
HRESULT
WINAPI
HTMLWindow2_put_name
(
IHTMLWindow2
*
iface
,
BSTR
v
)
{
HTMLWindow
*
This
=
HTMLWINDOW2_THIS
(
iface
);
FIXME
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
return
E_NOTIMPL
;
nsAString
name_str
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s)
\n
"
,
This
,
debugstr_w
(
v
));
nsAString_Init
(
&
name_str
,
v
);
nsres
=
nsIDOMWindow_SetName
(
This
->
nswindow
,
&
name_str
);
nsAString_Finish
(
&
name_str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetName failed: %08x
\n
"
,
nsres
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLWindow2_get_name
(
IHTMLWindow2
*
iface
,
BSTR
*
p
)
{
HTMLWindow
*
This
=
HTMLWINDOW2_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
nsAString
name_str
;
nsresult
nsres
;
HRESULT
hres
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
nsAString_Init
(
&
name_str
,
NULL
);
nsres
=
nsIDOMWindow_GetName
(
This
->
nswindow
,
&
name_str
);
if
(
NS_SUCCEEDED
(
nsres
))
{
const
PRUnichar
*
name
;
nsAString_GetData
(
&
name_str
,
&
name
);
if
(
*
name
)
{
*
p
=
SysAllocString
(
name
);
hres
=
*
p
?
S_OK
:
E_OUTOFMEMORY
;
}
else
{
*
p
=
NULL
;
hres
=
S_OK
;
}
}
else
{
ERR
(
"GetName failed: %08x
\n
"
,
nsres
);
hres
=
E_FAIL
;
}
nsAString_Finish
(
&
name_str
);
return
hres
;
}
static
HRESULT
WINAPI
HTMLWindow2_get_parent
(
IHTMLWindow2
*
iface
,
IHTMLWindow2
**
p
)
...
...
dlls/mshtml/tests/dom.c
View file @
2d4236bf
...
...
@@ -656,6 +656,20 @@ static IHTMLDocument2 *_get_owner_doc(unsigned line, IUnknown *unk)
return
doc
;
}
#define get_doc_window(d) _get_doc_window(__LINE__,d)
static
IHTMLWindow2
*
_get_doc_window
(
unsigned
line
,
IHTMLDocument2
*
doc
)
{
IHTMLWindow2
*
window
;
HRESULT
hres
;
window
=
NULL
;
hres
=
IHTMLDocument2_get_parentWindow
(
doc
,
&
window
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_parentWindow failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)(
window
!=
NULL
,
"window == NULL
\n
"
);
return
window
;
}
#define clone_node(n,d) _clone_node(__LINE__,n,d)
static
IHTMLDOMNode
*
_clone_node
(
unsigned
line
,
IUnknown
*
unk
,
VARIANT_BOOL
deep
)
{
...
...
@@ -809,6 +823,35 @@ static IHTMLDocument2 *_get_doc_node(unsigned line, IHTMLDocument2 *doc)
return
ret
;
}
#define test_window_name(d,e) _test_window_name(__LINE__,d,e)
static
void
_test_window_name
(
unsigned
line
,
IHTMLWindow2
*
window
,
const
char
*
exname
)
{
BSTR
name
;
HRESULT
hres
;
hres
=
IHTMLWindow2_get_name
(
window
,
&
name
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"get_name failed: %08x
\n
"
,
hres
);
if
(
exname
)
ok_
(
__FILE__
,
line
)(
!
strcmp_wa
(
name
,
exname
),
"name = %s
\n
"
,
wine_dbgstr_w
(
name
));
else
ok_
(
__FILE__
,
line
)(
!
name
,
"name = %s
\n
"
,
wine_dbgstr_w
(
name
));
}
#define set_window_name(w,n) _set_window_name(__LINE__,w,n)
static
void
_set_window_name
(
unsigned
line
,
IHTMLWindow2
*
window
,
const
char
*
name
)
{
BSTR
str
;
HRESULT
hres
;
str
=
a2bstr
(
name
);
hres
=
IHTMLWindow2_put_name
(
window
,
str
);
SysFreeString
(
str
);
ok_
(
__FILE__
,
line
)(
hres
==
S_OK
,
"put_name failed: %08x
\n
"
,
hres
);
_test_window_name
(
line
,
window
,
name
);
}
static
void
test_get_set_attr
(
IHTMLDocument2
*
doc
)
{
IHTMLElement
*
elem
;
...
...
@@ -4369,6 +4412,9 @@ static void test_window(IHTMLDocument2 *doc)
ok
(
!
strcmp_wa
(
str
,
"[object]"
),
"toString returned %s
\n
"
,
wine_dbgstr_w
(
str
));
SysFreeString
(
str
);
test_window_name
(
window
,
NULL
);
set_window_name
(
window
,
"test"
);
IHTMLWindow2_Release
(
window
);
}
...
...
@@ -4738,6 +4784,7 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLDOMChildrenCollection
*
child_col
;
IHTMLElement
*
elem
,
*
elem2
,
*
elem3
;
IHTMLDOMNode
*
node
,
*
node2
;
IHTMLWindow2
*
window
;
IDispatch
*
disp
;
LONG
type
;
HRESULT
hres
;
...
...
@@ -5151,6 +5198,11 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release
(
elem
);
IHTMLDocument3_Release
(
doc3
);
window
=
get_doc_window
(
doc
);
test_window_name
(
window
,
NULL
);
set_window_name
(
window
,
"test name"
);
IHTMLWindow2_Release
(
window
);
}
static
void
test_create_elems
(
IHTMLDocument2
*
doc
)
...
...
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