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
4ff0a824
Commit
4ff0a824
authored
Sep 04, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Properly expose frame and iframe element's windows to scripts.
parent
99d1c9ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
2 deletions
+52
-2
htmlwindow.c
dlls/mshtml/htmlwindow.c
+43
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+2
-1
jstest.html
dlls/mshtml/tests/jstest.html
+7
-0
No files found.
dlls/mshtml/htmlwindow.c
View file @
4ff0a824
...
...
@@ -2358,7 +2358,25 @@ static HRESULT WINAPI WindowDispEx_GetDispID(IDispatchEx *iface, BSTR bstrName,
if
(
hres
!=
DISP_E_UNKNOWNNAME
)
return
hres
;
if
(
window
->
base
.
inner_window
->
doc
)
{
if
(
This
->
outer_window
)
{
HTMLOuterWindow
*
frame
;
hres
=
get_frame_by_name
(
This
->
outer_window
,
bstrName
,
FALSE
,
&
frame
);
if
(
SUCCEEDED
(
hres
)
&&
frame
)
{
global_prop_t
*
prop
;
IHTMLWindow2_Release
(
&
frame
->
base
.
IHTMLWindow2_iface
);
prop
=
alloc_global_prop
(
window
,
GLOBAL_FRAMEVAR
,
bstrName
);
if
(
!
prop
)
return
E_OUTOFMEMORY
;
*
pid
=
prop_to_dispid
(
window
,
prop
);
return
S_OK
;
}
}
if
(
window
->
doc
)
{
global_prop_t
*
prop
;
IHTMLElement
*
elem
;
...
...
@@ -2603,6 +2621,30 @@ static HRESULT HTMLWindow_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD
FIXME
(
"Not supported flags: %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
case
GLOBAL_FRAMEVAR
:
if
(
!
This
->
base
.
outer_window
)
return
E_UNEXPECTED
;
switch
(
flags
)
{
case
DISPATCH_PROPERTYGET
:
{
HTMLOuterWindow
*
frame
;
hres
=
get_frame_by_name
(
This
->
base
.
outer_window
,
prop
->
name
,
FALSE
,
&
frame
);
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
frame
)
return
DISP_E_MEMBERNOTFOUND
;
V_VT
(
res
)
=
VT_DISPATCH
;
V_DISPATCH
(
res
)
=
(
IDispatch
*
)
&
frame
->
base
.
inner_window
->
base
.
IHTMLWindow2_iface
;
IDispatch_AddRef
(
V_DISPATCH
(
res
));
return
S_OK
;
}
default:
FIXME
(
"Not supported flags: %x
\n
"
,
flags
);
return
E_NOTIMPL
;
}
case
GLOBAL_DISPEXVAR
:
return
IDispatchEx_InvokeEx
(
&
This
->
dispex
.
IDispatchEx_iface
,
prop
->
id
,
0
,
flags
,
params
,
res
,
ei
,
caller
);
default:
...
...
dlls/mshtml/mshtml_private.h
View file @
4ff0a824
...
...
@@ -294,7 +294,8 @@ typedef struct ScriptHost ScriptHost;
typedef
enum
{
GLOBAL_SCRIPTVAR
,
GLOBAL_ELEMENTVAR
,
GLOBAL_DISPEXVAR
GLOBAL_DISPEXVAR
,
GLOBAL_FRAMEVAR
}
global_prop_type_t
;
typedef
struct
{
...
...
dlls/mshtml/tests/jstest.html
View file @
4ff0a824
...
...
@@ -68,6 +68,13 @@ function test_document_name_as_index() {
ok
(
window
.
formname
===
1
,
"window.formname = "
+
window
.
formname
);
formname
=
2
;
ok
(
window
.
formname
===
2
,
"window.formname = "
+
window
.
formname
);
document
.
body
.
innerHTML
=
'<iframe id="iframeid"></iframe>'
;
ok
(
"iframeid"
in
window
,
"iframeid is not in window"
);
e
=
document
.
getElementById
(
"iframeid"
);
ok
(
!!
e
,
"e is null"
);
ok
(
iframeid
!=
e
,
"iframeid == e"
);
ok
(
iframeid
.
frameElement
===
e
,
"frameid != e.contentWindow"
);
}
function
test_remove_style_attribute
()
{
...
...
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