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
62ccef38
Commit
62ccef38
authored
Sep 16, 2009
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Store document node in window.
parent
1d202079
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
35 deletions
+38
-35
htmldoc.c
dlls/mshtml/htmldoc.c
+1
-2
htmlevent.c
dlls/mshtml/htmlevent.c
+1
-1
htmlevent.h
dlls/mshtml/htmlevent.h
+1
-1
htmliframe.c
dlls/mshtml/htmliframe.c
+2
-2
htmllocation.c
dlls/mshtml/htmllocation.c
+2
-2
htmloption.c
dlls/mshtml/htmloption.c
+3
-3
htmlwindow.c
dlls/mshtml/htmlwindow.c
+13
-12
mshtml_private.h
dlls/mshtml/mshtml_private.h
+6
-6
nsembed.c
dlls/mshtml/nsembed.c
+3
-0
nsevents.c
dlls/mshtml/nsevents.c
+1
-1
script.c
dlls/mshtml/script.c
+5
-5
No files found.
dlls/mshtml/htmldoc.c
View file @
62ccef38
...
...
@@ -1949,7 +1949,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
ERR
(
"GetContentDOMWindow failed: %08x
\n
"
,
nsres
);
}
hres
=
HTMLWindow_Create
(
nswindow
,
&
doc
->
basedoc
.
window
);
hres
=
HTMLWindow_Create
(
doc
,
nswindow
,
&
doc
->
basedoc
.
window
);
if
(
nswindow
)
nsIDOMWindow_Release
(
nswindow
);
if
(
FAILED
(
hres
))
{
...
...
@@ -1958,7 +1958,6 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
}
update_nsdocument
(
doc
);
doc
->
basedoc
.
window
->
doc
=
&
doc
->
basedoc
;
get_thread_hwnd
();
return
S_OK
;
...
...
dlls/mshtml/htmlevent.c
View file @
62ccef38
...
...
@@ -961,7 +961,7 @@ void check_event_attr(HTMLDocument *doc, nsIDOMElement *nselem)
TRACE
(
"%p.%s = %s
\n
"
,
nselem
,
debugstr_w
(
event_info
[
i
].
attr_name
),
debugstr_w
(
attr_value
));
disp
=
script_parse_event
(
doc
,
attr_value
);
disp
=
script_parse_event
(
doc
->
window
,
attr_value
);
if
(
disp
)
{
node
=
get_node
(
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
);
set_event_handler_disp
(
get_node_event_target
(
node
),
node
->
doc
,
i
,
disp
);
...
...
dlls/mshtml/htmlevent.h
View file @
62ccef38
...
...
@@ -73,7 +73,7 @@ static inline HRESULT get_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *v
static
inline
HRESULT
set_window_event
(
HTMLWindow
*
window
,
eventid_t
eid
,
VARIANT
*
var
)
{
return
set_event_handler
(
&
window
->
event_target
,
window
->
doc
,
eid
,
var
);
return
set_event_handler
(
&
window
->
event_target
,
&
window
->
doc_obj
->
base
doc
,
eid
,
var
);
}
static
inline
HRESULT
get_window_event
(
HTMLWindow
*
window
,
eventid_t
eid
,
VARIANT
*
var
)
...
...
dlls/mshtml/htmliframe.c
View file @
62ccef38
...
...
@@ -129,7 +129,7 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
return
E_FAIL
;
}
hres
=
HTMLWindow_Create
(
NULL
,
&
window
);
hres
=
HTMLWindow_Create
(
This
->
element
.
node
.
doc
->
doc_obj
,
NULL
,
&
window
);
if
(
FAILED
(
hres
))
{
nsIDOMDocument_Release
(
nsdoc
);
return
hres
;
...
...
@@ -137,7 +137,7 @@ static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface,
hres
=
create_doc_from_nsdoc
(
nshtmldoc
,
This
->
element
.
node
.
doc
->
doc_obj
,
window
,
&
This
->
content_doc
);
if
(
SUCCEEDED
(
hres
))
window
->
doc
=
&
This
->
content_doc
->
base
doc
;
window
->
doc
=
This
->
content_
doc
;
IHTMLWindow2_Release
(
HTMLWINDOW2
(
window
));
nsIDOMHTMLDocument_Release
(
nshtmldoc
);
if
(
FAILED
(
hres
))
...
...
dlls/mshtml/htmllocation.c
View file @
62ccef38
...
...
@@ -37,12 +37,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
static
HRESULT
get_url
(
HTMLLocation
*
This
,
const
WCHAR
**
ret
)
{
if
(
!
This
->
window
||
!
This
->
window
->
doc
||
!
This
->
window
->
doc
->
url
)
{
if
(
!
This
->
window
||
!
This
->
window
->
doc
_obj
||
!
This
->
window
->
doc_obj
->
basedoc
.
url
)
{
FIXME
(
"No current URL
\n
"
);
return
E_NOTIMPL
;
}
*
ret
=
This
->
window
->
doc
->
url
;
*
ret
=
This
->
window
->
doc
_obj
->
basedoc
.
url
;
return
S_OK
;
}
...
...
dlls/mshtml/htmloption.c
View file @
62ccef38
...
...
@@ -459,7 +459,7 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
TRACE
(
"(%p)->(%s %s %s %s %p)
\n
"
,
This
,
debugstr_variant
(
&
text
),
debugstr_variant
(
&
value
),
debugstr_variant
(
&
defaultselected
),
debugstr_variant
(
&
selected
),
optelem
);
if
(
!
This
->
window
||
!
This
->
window
->
doc
||
!
This
->
window
->
doc
->
nsdoc
)
{
if
(
!
This
->
window
||
!
This
->
window
->
doc
||
!
This
->
window
->
doc
->
basedoc
.
nsdoc
)
{
WARN
(
"NULL nsdoc
\n
"
);
return
E_UNEXPECTED
;
}
...
...
@@ -467,14 +467,14 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
*
optelem
=
NULL
;
nsAString_Init
(
&
option_str
,
optionW
);
nsres
=
nsIDOMHTMLDocument_CreateElement
(
This
->
window
->
doc
->
nsdoc
,
&
option_str
,
&
nselem
);
nsres
=
nsIDOMHTMLDocument_CreateElement
(
This
->
window
->
doc
->
basedoc
.
nsdoc
,
&
option_str
,
&
nselem
);
nsAString_Finish
(
&
option_str
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"CreateElement failed: %08x
\n
"
,
nsres
);
return
E_FAIL
;
}
hres
=
IHTMLDOMNode_QueryInterface
(
HTMLDOMNODE
(
get_node
(
This
->
window
->
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
)),
hres
=
IHTMLDOMNode_QueryInterface
(
HTMLDOMNODE
(
get_node
(
&
This
->
window
->
doc_obj
->
base
doc
,
(
nsIDOMNode
*
)
nselem
,
TRUE
)),
&
IID_IHTMLOptionElement
,
(
void
**
)
optelem
);
nsIDOMElement_Release
(
nselem
);
...
...
dlls/mshtml/htmlwindow.c
View file @
62ccef38
...
...
@@ -223,7 +223,7 @@ static HRESULT WINAPI HTMLWindow2_clearTimeout(IHTMLWindow2 *iface, LONG timerID
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
timerID
);
return
clear_task_timer
(
This
->
doc
,
FALSE
,
timerID
);
return
clear_task_timer
(
&
This
->
doc
->
base
doc
,
FALSE
,
timerID
);
}
static
HRESULT
WINAPI
HTMLWindow2_alert
(
IHTMLWindow2
*
iface
,
BSTR
message
)
...
...
@@ -239,7 +239,7 @@ static HRESULT WINAPI HTMLWindow2_alert(IHTMLWindow2 *iface, BSTR message)
return
S_OK
;
}
MessageBoxW
(
This
->
doc
->
hwnd
,
message
,
wszTitle
,
MB_ICONWARNING
);
MessageBoxW
(
This
->
doc
_obj
->
basedoc
.
hwnd
,
message
,
wszTitle
,
MB_ICONWARNING
);
return
S_OK
;
}
...
...
@@ -260,7 +260,7 @@ static HRESULT WINAPI HTMLWindow2_confirm(IHTMLWindow2 *iface, BSTR message,
return
S_OK
;
}
if
(
MessageBoxW
(
This
->
doc
->
hwnd
,
message
,
wszTitle
,
if
(
MessageBoxW
(
This
->
doc
_obj
->
basedoc
.
hwnd
,
message
,
wszTitle
,
MB_OKCANCEL
|
MB_ICONQUESTION
)
==
IDOK
)
*
confirmed
=
VARIANT_TRUE
;
else
*
confirmed
=
VARIANT_FALSE
;
...
...
@@ -353,7 +353,7 @@ static HRESULT WINAPI HTMLWindow2_prompt(IHTMLWindow2 *iface, BSTR message,
arg
.
textdata
=
textdata
;
DialogBoxParamW
(
hInst
,
MAKEINTRESOURCEW
(
ID_PROMPT_DIALOG
),
This
->
doc
->
hwnd
,
prompt_dlgproc
,
(
LPARAM
)
&
arg
);
This
->
doc
_obj
->
basedoc
.
hwnd
,
prompt_dlgproc
,
(
LPARAM
)
&
arg
);
return
S_OK
;
}
...
...
@@ -632,7 +632,7 @@ static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocumen
if
(
This
->
doc
)
{
/* FIXME: We should return a wrapper object here */
*
p
=
HTMLDOC
(
This
->
doc
);
*
p
=
HTMLDOC
(
&
This
->
doc
->
base
doc
);
IHTMLDocument2_AddRef
(
*
p
);
}
else
{
*
p
=
NULL
;
...
...
@@ -752,7 +752,7 @@ static HRESULT WINAPI HTMLWindow2_clearInterval(IHTMLWindow2 *iface, LONG timerI
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
timerID
);
return
clear_task_timer
(
This
->
doc
,
TRUE
,
timerID
);
return
clear_task_timer
(
&
This
->
doc
->
base
doc
,
TRUE
,
timerID
);
}
static
HRESULT
WINAPI
HTMLWindow2_put_offscreenBuffering
(
IHTMLWindow2
*
iface
,
VARIANT
v
)
...
...
@@ -856,10 +856,10 @@ static HRESULT WINAPI HTMLWindow2_get_external(IHTMLWindow2 *iface, IDispatch **
*
p
=
NULL
;
if
(
!
This
->
doc
->
hostui
)
if
(
!
This
->
doc
_obj
->
basedoc
.
hostui
)
return
S_OK
;
return
IDocHostUIHandler_GetExternal
(
This
->
doc
->
hostui
,
p
);
return
IDocHostUIHandler_GetExternal
(
This
->
doc
_obj
->
basedoc
.
hostui
,
p
);
}
static
HRESULT
HTMLWindow_invoke
(
IUnknown
*
iface
,
DISPID
id
,
LCID
lcid
,
WORD
flags
,
DISPPARAMS
*
params
,
...
...
@@ -1055,7 +1055,7 @@ static HRESULT WINAPI HTMLWindow3_attachEvent(IHTMLWindow3 *iface, BSTR event, I
TRACE
(
"(%p)->(%s %p %p)
\n
"
,
This
,
debugstr_w
(
event
),
pDisp
,
pfResult
);
return
attach_event
(
&
This
->
event_target
,
This
->
doc
,
event
,
pDisp
,
pfResult
);
return
attach_event
(
&
This
->
event_target
,
&
This
->
doc_obj
->
base
doc
,
event
,
pDisp
,
pfResult
);
}
static
HRESULT
WINAPI
HTMLWindow3_detachEvent
(
IHTMLWindow3
*
iface
,
BSTR
event
,
IDispatch
*
pDisp
)
...
...
@@ -1077,7 +1077,7 @@ static HRESULT window_set_timer(HTMLWindow *This, VARIANT *expr, LONG msec, VARI
break
;
case
VT_BSTR
:
disp
=
script_parse_event
(
This
->
doc
,
V_BSTR
(
expr
));
disp
=
script_parse_event
(
This
,
V_BSTR
(
expr
));
break
;
default:
...
...
@@ -1088,7 +1088,7 @@ static HRESULT window_set_timer(HTMLWindow *This, VARIANT *expr, LONG msec, VARI
if
(
!
disp
)
return
E_FAIL
;
*
timer_id
=
set_task_timer
(
This
->
doc
,
msec
,
interval
,
disp
);
*
timer_id
=
set_task_timer
(
&
This
->
doc
->
base
doc
,
msec
,
interval
,
disp
);
IDispatch_Release
(
disp
);
return
S_OK
;
...
...
@@ -1413,7 +1413,7 @@ static dispex_static_data_t HTMLWindow_dispex = {
HTMLWindow_iface_tids
};
HRESULT
HTMLWindow_Create
(
nsIDOMWindow
*
nswindow
,
HTMLWindow
**
ret
)
HRESULT
HTMLWindow_Create
(
HTMLDocumentObj
*
doc_obj
,
nsIDOMWindow
*
nswindow
,
HTMLWindow
**
ret
)
{
HTMLWindow
*
window
;
...
...
@@ -1425,6 +1425,7 @@ HRESULT HTMLWindow_Create(nsIDOMWindow *nswindow, HTMLWindow **ret)
window
->
lpHTMLWindow3Vtbl
=
&
HTMLWindow3Vtbl
;
window
->
lpIDispatchExVtbl
=
&
WindowDispExVtbl
;
window
->
ref
=
1
;
window
->
doc_obj
=
doc_obj
;
init_dispex
(
&
window
->
dispex
,
(
IUnknown
*
)
HTMLWINDOW2
(
window
),
&
HTMLWindow_dispex
);
...
...
dlls/mshtml/mshtml_private.h
View file @
62ccef38
...
...
@@ -154,6 +154,8 @@ BOOL dispex_query_interface(DispatchEx*,REFIID,void**);
HRESULT
dispex_get_dprop_ref
(
DispatchEx
*
,
const
WCHAR
*
,
BOOL
,
VARIANT
**
);
typedef
struct
HTMLWindow
HTMLWindow
;
typedef
struct
HTMLDocumentNode
HTMLDocumentNode
;
typedef
struct
HTMLDocumentObj
HTMLDocumentObj
;
typedef
enum
{
SCRIPTMODE_GECKO
,
...
...
@@ -193,7 +195,8 @@ struct HTMLWindow {
LONG
ref
;
HTMLDocument
*
doc
;
HTMLDocumentNode
*
doc
;
HTMLDocumentObj
*
doc_obj
;
nsIDOMWindow
*
nswindow
;
event_target_t
*
event_target
;
...
...
@@ -249,9 +252,6 @@ typedef struct {
ULONG
(
*
release
)(
HTMLDocument
*
);
}
htmldoc_vtbl_t
;
typedef
struct
HTMLDocumentNode
HTMLDocumentNode
;
typedef
struct
HTMLDocumentObj
HTMLDocumentObj
;
struct
HTMLDocument
{
DispatchEx
dispex
;
const
htmldoc_vtbl_t
*
vtbl
;
...
...
@@ -548,7 +548,7 @@ HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
HRESULT
HTMLLoadOptions_Create
(
IUnknown
*
,
REFIID
,
void
**
);
HRESULT
create_doc_from_nsdoc
(
nsIDOMHTMLDocument
*
,
HTMLDocumentObj
*
,
HTMLWindow
*
,
HTMLDocumentNode
**
);
HRESULT
HTMLWindow_Create
(
nsIDOMWindow
*
,
HTMLWindow
**
);
HRESULT
HTMLWindow_Create
(
HTMLDocumentObj
*
,
nsIDOMWindow
*
,
HTMLWindow
**
);
HTMLWindow
*
nswindow_to_window
(
const
nsIDOMWindow
*
);
HTMLOptionElementFactory
*
HTMLOptionElementFactory_Create
(
HTMLWindow
*
);
HRESULT
HTMLLocation_Create
(
HTMLWindow
*
,
HTMLLocation
**
);
...
...
@@ -678,7 +678,7 @@ void release_nodes(HTMLDocument*);
void
release_script_hosts
(
HTMLWindow
*
);
void
connect_scripts
(
HTMLWindow
*
);
void
doc_insert_script
(
HTMLDocument
*
,
nsIDOMHTMLScriptElement
*
);
IDispatch
*
script_parse_event
(
HTML
Document
*
,
LPCWSTR
);
IDispatch
*
script_parse_event
(
HTML
Window
*
,
LPCWSTR
);
void
set_script_mode
(
HTMLWindow
*
,
SCRIPTMODE
);
BOOL
find_global_prop
(
HTMLWindow
*
,
BSTR
,
DWORD
,
ScriptHost
**
,
DISPID
*
);
IDispatch
*
get_script_disp
(
ScriptHost
*
);
...
...
dlls/mshtml/nsembed.c
View file @
62ccef38
...
...
@@ -844,6 +844,8 @@ void update_nsdocument(HTMLDocumentObj *doc)
doc_node
->
basedoc
.
doc_obj
=
NULL
;
IHTMLDocument2_Release
(
HTMLDOC
(
&
doc_node
->
basedoc
));
doc
->
basedoc
.
doc_node
=
NULL
;
doc
->
basedoc
.
window
->
doc
=
NULL
;
}
doc
->
basedoc
.
nsdoc
=
nsdoc
;
...
...
@@ -859,6 +861,7 @@ void update_nsdocument(HTMLDocumentObj *doc)
}
doc
->
basedoc
.
doc_node
=
doc_node
;
doc
->
basedoc
.
window
->
doc
=
doc_node
;
}
void
close_gecko
(
void
)
...
...
dlls/mshtml/nsevents.c
View file @
62ccef38
...
...
@@ -246,7 +246,7 @@ void add_nsevent_listener(HTMLWindow *window, LPCWSTR type)
return
;
}
init_event
(
target
,
type
,
NSEVENTLIST
(
&
window
->
doc
->
nscontainer
->
htmlevent_listener
),
TRUE
);
init_event
(
target
,
type
,
NSEVENTLIST
(
&
window
->
doc
_obj
->
basedoc
.
nscontainer
->
htmlevent_listener
),
TRUE
);
nsIDOMEventTarget_Release
(
target
);
}
...
...
dlls/mshtml/script.c
View file @
62ccef38
...
...
@@ -593,7 +593,7 @@ static void parse_extern_script(ScriptHost *script_host, LPCWSTR src)
if
(
FAILED
(
hres
))
return
;
hres
=
bind_mon_to_buffer
(
script_host
->
window
->
doc
,
mon
,
(
void
**
)
&
buf
,
&
size
);
hres
=
bind_mon_to_buffer
(
&
script_host
->
window
->
doc_obj
->
base
doc
,
mon
,
(
void
**
)
&
buf
,
&
size
);
IMoniker_Release
(
mon
);
if
(
FAILED
(
hres
))
return
;
...
...
@@ -762,7 +762,7 @@ void doc_insert_script(HTMLDocument *doc, nsIDOMHTMLScriptElement *nsscript)
parse_script_elem
(
script_host
,
nsscript
);
}
IDispatch
*
script_parse_event
(
HTML
Document
*
doc
,
LPCWSTR
text
)
IDispatch
*
script_parse_event
(
HTML
Window
*
window
,
LPCWSTR
text
)
{
ScriptHost
*
script_host
;
GUID
guid
=
CLSID_JScript
;
...
...
@@ -795,7 +795,7 @@ IDispatch *script_parse_event(HTMLDocument *doc, LPCWSTR text)
ptr
=
text
;
}
script_host
=
get_script_host
(
doc
->
window
,
&
guid
);
script_host
=
get_script_host
(
window
,
&
guid
);
if
(
!
script_host
||
!
script_host
->
parse_proc
)
return
NULL
;
...
...
@@ -890,10 +890,10 @@ void set_script_mode(HTMLWindow *window, SCRIPTMODE mode)
window
->
scriptmode
=
mode
;
if
(
!
window
->
doc
->
nscontainer
||
!
window
->
doc
->
nscontainer
->
webbrowser
)
if
(
!
window
->
doc
_obj
->
basedoc
.
nscontainer
||
!
window
->
doc_obj
->
basedoc
.
nscontainer
->
webbrowser
)
return
;
nsres
=
nsIWebBrowser_QueryInterface
(
window
->
doc
->
nscontainer
->
webbrowser
,
nsres
=
nsIWebBrowser_QueryInterface
(
window
->
doc
_obj
->
basedoc
.
nscontainer
->
webbrowser
,
&
IID_nsIWebBrowserSetup
,
(
void
**
)
&
setup
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsres
=
nsIWebBrowserSetup_SetProperty
(
setup
,
SETUP_ALLOW_JAVASCRIPT
,
...
...
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