Author: cwittich
Date: Sun Mar 21 16:12:30 2010
New Revision: 46303
URL:
http://svn.reactos.org/svn/reactos?rev=46303&view=rev
Log:
[MSHTML]
sync mshtml with wine 1.1.41
Modified:
trunk/reactos/dll/win32/mshtml/De.rc
trunk/reactos/dll/win32/mshtml/Fr.rc
trunk/reactos/dll/win32/mshtml/It.rc
trunk/reactos/dll/win32/mshtml/Ja.rc
trunk/reactos/dll/win32/mshtml/Lt.rc
trunk/reactos/dll/win32/mshtml/No.rc
trunk/reactos/dll/win32/mshtml/Si.rc
trunk/reactos/dll/win32/mshtml/htmldoc.c
trunk/reactos/dll/win32/mshtml/htmldoc3.c
trunk/reactos/dll/win32/mshtml/htmlelem2.c
trunk/reactos/dll/win32/mshtml/htmlevent.c
trunk/reactos/dll/win32/mshtml/htmlevent.h
trunk/reactos/dll/win32/mshtml/htmlimg.c
trunk/reactos/dll/win32/mshtml/htmlwindow.c
trunk/reactos/dll/win32/mshtml/mshtml_private.h
trunk/reactos/dll/win32/mshtml/mutation.c
trunk/reactos/dll/win32/mshtml/navigate.c
trunk/reactos/dll/win32/mshtml/nsevents.c
trunk/reactos/dll/win32/mshtml/nsio.c
trunk/reactos/dll/win32/mshtml/omnavigator.c
trunk/reactos/dll/win32/mshtml/persist.c
Modified: trunk/reactos/dll/win32/mshtml/De.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/De.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/De.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/De.rc [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -72,4 +72,3 @@
PUSHBUTTON "OK", IDOK, 40, 65, 45, 15, BS_DEFPUSHBUTTON | WS_GROUP |
WS_TABSTOP
PUSHBUTTON "Abbrechen", IDCANCEL, 115, 65, 45, 15, WS_GROUP | WS_TABSTOP
}
-#pragma code_page(default)
Modified: trunk/reactos/dll/win32/mshtml/Fr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/Fr.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/Fr.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/Fr.rc [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -72,4 +72,3 @@
PUSHBUTTON "OK", IDOK, 40, 65, 45, 15, BS_DEFPUSHBUTTON | WS_GROUP |
WS_TABSTOP
PUSHBUTTON "Annuler", IDCANCEL, 115, 65, 45, 15, WS_GROUP | WS_TABSTOP
}
-#pragma code_page(default)
Modified: trunk/reactos/dll/win32/mshtml/It.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/It.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/It.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/It.rc [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -69,4 +69,3 @@
PUSHBUTTON "OK", IDOK, 40, 65, 45, 15, BS_DEFPUSHBUTTON | WS_GROUP |
WS_TABSTOP
PUSHBUTTON "Annulla", IDCANCEL, 115, 65, 45, 15, WS_GROUP | WS_TABSTOP
}
-#pragma code_page(default)
Modified: trunk/reactos/dll/win32/mshtml/Ja.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/Ja.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/Ja.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/Ja.rc [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -69,4 +69,3 @@
PUSHBUTTON "OK", IDOK, 40, 65, 45, 15, BS_DEFPUSHBUTTON | WS_GROUP |
WS_TABSTOP
PUSHBUTTON "ãã£ã³ã»ã«", IDCANCEL, 115, 65, 45, 15, WS_GROUP |
WS_TABSTOP
}
-#pragma code_page(default)
Modified: trunk/reactos/dll/win32/mshtml/Lt.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/Lt.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/Lt.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/Lt.rc [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -69,4 +69,3 @@
PUSHBUTTON "Gerai", IDOK, 40, 65, 45, 15, BS_DEFPUSHBUTTON | WS_GROUP |
WS_TABSTOP
PUSHBUTTON "Atsisakyti", IDCANCEL, 115, 65, 45, 15, WS_GROUP | WS_TABSTOP
}
-#pragma code_page(default)
Modified: trunk/reactos/dll/win32/mshtml/No.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/No.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/No.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/No.rc [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -70,4 +70,3 @@
PUSHBUTTON "OK", IDOK, 40, 65, 45, 15, BS_DEFPUSHBUTTON | WS_GROUP |
WS_TABSTOP
PUSHBUTTON "Avbryt", IDCANCEL, 115, 65, 45, 15, WS_GROUP | WS_TABSTOP
}
-#pragma code_page(default)
Modified: trunk/reactos/dll/win32/mshtml/Si.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/Si.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/Si.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/Si.rc [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -68,4 +68,3 @@
PUSHBUTTON "V redu", IDOK, 40, 65, 45, 15, BS_DEFPUSHBUTTON | WS_GROUP |
WS_TABSTOP
PUSHBUTTON "PrekliÄi", IDCANCEL, 115, 65, 45, 15, WS_GROUP | WS_TABSTOP
}
-#pragma code_page(default)
Modified: trunk/reactos/dll/win32/mshtml/htmldoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmldoc.c…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmldoc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmldoc.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -554,9 +554,12 @@
static HRESULT WINAPI HTMLDocument_get_referrer(IHTMLDocument2 *iface, BSTR *p)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
-}
+
+ FIXME("(%p)->(%p)\n", This, p);
+
+ *p = NULL;
+ return S_OK;
+ }
static HRESULT WINAPI HTMLDocument_get_location(IHTMLDocument2 *iface, IHTMLLocation
**p)
{
@@ -1474,7 +1477,7 @@
HTMLDocument *This = HTMLDOC_THIS(iface);
if(This->window)
- update_cp_events(This->window, cp);
+ update_cp_events(This->window, &This->doc_node->node.event_target,
cp, This->doc_node->node.nsnode);
}
#undef HTMLDOC_THIS
@@ -1595,6 +1598,11 @@
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
{
HTMLDocument *This = DISPEX_THIS(iface);
+
+ if(This->window && id == DISPID_IHTMLDOCUMENT2_LOCATION && (wFlags
& DISPATCH_PROPERTYPUT))
+ return IDispatchEx_InvokeEx(DISPATCHEX(This->window),
DISPID_IHTMLWINDOW2_LOCATION, lcid, wFlags,
+ pdp, pvarRes, pei, pspCaller);
+
return IDispatchEx_InvokeEx(This->dispex, id, lcid, wFlags, pdp, pvarRes, pei,
pspCaller);
}
Modified: trunk/reactos/dll/win32/mshtml/htmldoc3.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmldoc3.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmldoc3.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmldoc3.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -182,7 +182,7 @@
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
- return attach_event(&This->doc_node->node.event_target, This, event, pDisp,
pfResult);
+ return attach_event(&This->doc_node->node.event_target,
This->doc_node->node.nsnode, This, event, pDisp, pfResult);
}
static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
Modified: trunk/reactos/dll/win32/mshtml/htmlelem2.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlelem2…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlelem2.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlelem2.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -649,7 +649,7 @@
TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
- return attach_event(get_node_event_target(&This->node),
&This->node.doc->basedoc, event, pDisp, pfResult);
+ return attach_event(get_node_event_target(&This->node), This->node.nsnode,
&This->node.doc->basedoc, event, pDisp, pfResult);
}
static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event,
IDispatch *pDisp)
Modified: trunk/reactos/dll/win32/mshtml/htmlevent.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlevent…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlevent.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlevent.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -40,6 +40,7 @@
} handler_vector_t;
struct event_target_t {
+ DWORD node_handlers_mask;
handler_vector_t *event_table[EVENTID_LAST];
};
@@ -129,6 +130,7 @@
#define EVENT_DEFAULTLISTENER 0x0001
#define EVENT_BUBBLE 0x0002
#define EVENT_FORWARDBODY 0x0004
+#define EVENT_NODEHANDLER 0x0008
static const event_info_t event_info[] = {
{beforeunloadW, onbeforeunloadW, EVENTT_NONE,
DISPID_EVMETH_ONBEFOREUNLOAD,
@@ -152,7 +154,7 @@
{keyupW, onkeyupW, EVENTT_KEY, DISPID_EVMETH_ONKEYUP,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{loadW, onloadW, EVENTT_HTML, DISPID_EVMETH_ONLOAD,
- 0},
+ EVENT_NODEHANDLER},
{mousedownW, onmousedownW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEDOWN,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{mouseoutW, onmouseoutW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEOUT,
@@ -171,6 +173,8 @@
0}
};
+static const eventid_t node_handled_list[] = { EVENTID_LOAD };
+
eventid_t str_to_eid(LPCWSTR str)
{
int i;
@@ -194,6 +198,19 @@
}
return EVENTID_LAST;
+}
+
+static DWORD get_node_handler_mask(eventid_t eid)
+{
+ DWORD i;
+
+ for(i=0; i<sizeof(node_handled_list)/sizeof(*node_handled_list); i++) {
+ if(node_handled_list[i] == eid)
+ return 1 << i;
+ }
+
+ ERR("Invalid eid %d\n", eid);
+ return ~0;
}
typedef struct {
@@ -882,7 +899,7 @@
}
}
-void fire_event(HTMLDocumentNode *doc, eventid_t eid, nsIDOMNode *target, nsIDOMEvent
*nsevent)
+void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode *target,
nsIDOMEvent *nsevent)
{
IHTMLEventObj *prev_event, *event_obj = NULL;
nsIDOMNode *parent, *nsnode;
@@ -892,7 +909,9 @@
TRACE("(%p) %s\n", doc, debugstr_w(event_info[eid].name));
prev_event = doc->basedoc.window->event;
- event_obj = doc->basedoc.window->event = create_event(get_node(doc, target,
TRUE), eid, nsevent);
+ if(set_event)
+ event_obj = create_event(get_node(doc, target, TRUE), eid, nsevent);
+ doc->basedoc.window->event = event_obj;
nsIDOMNode_GetNodeType(target, &node_type);
nsnode = target;
@@ -949,7 +968,8 @@
if(nsnode)
nsIDOMNode_Release(nsnode);
- IHTMLEventObj_Release(event_obj);
+ if(event_obj)
+ IHTMLEventObj_Release(event_obj);
doc->basedoc.window->event = prev_event;
}
@@ -971,7 +991,7 @@
return E_NOTIMPL;
}
- fire_event(node->doc, eid, node->nsnode, NULL);
+ fire_event(node->doc, eid, TRUE, node->nsnode, NULL);
*cancelled = VARIANT_TRUE; /* FIXME */
return S_OK;
@@ -989,7 +1009,7 @@
return hres;
}
- fire_event(node->doc, eid, node->nsnode, NULL);
+ fire_event(node->doc, eid, TRUE, node->nsnode, NULL);
return S_OK;
}
@@ -1021,9 +1041,24 @@
return TRUE;
}
-static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, eventid_t eid)
-{
- if(!doc->nsdoc || !(event_info[eid].flags & EVENT_DEFAULTLISTENER))
+static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t
*event_target, nsIDOMNode *nsnode, eventid_t eid)
+{
+ if(!doc->nsdoc)
+ return S_OK;
+
+ if(event_info[eid].flags & EVENT_NODEHANDLER) {
+ DWORD mask;
+
+ mask = get_node_handler_mask(eid);
+ if(event_target->node_handlers_mask & mask)
+ return S_OK;
+
+ add_nsevent_listener(doc, nsnode, event_info[eid].name);
+ event_target->node_handlers_mask |= mask;
+ return S_OK;
+ }
+
+ if(!(event_info[eid].flags & EVENT_DEFAULTLISTENER))
return S_OK;
if(!doc->event_vector) {
@@ -1034,16 +1069,29 @@
if(!doc->event_vector[eid]) {
doc->event_vector[eid] = TRUE;
- add_nsevent_listener(doc, event_info[eid].name);
- }
-
- return S_OK;
-}
-
-static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDocumentNode
*doc,
+ add_nsevent_listener(doc, NULL, event_info[eid].name);
+ }
+
+ return S_OK;
+}
+
+static HRESULT remove_event_handler(event_target_t **event_target, eventid_t eid)
+{
+ if(*event_target && (*event_target)->event_table[eid]->handler_prop) {
+ IDispatch_Release((*event_target)->event_table[eid]->handler_prop);
+ (*event_target)->event_table[eid]->handler_prop = NULL;
+ }
+
+ return S_OK;
+}
+
+static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, nsIDOMNode
*nsnode, HTMLDocumentNode *doc,
eventid_t eid, IDispatch *disp)
{
event_target_t *event_target;
+
+ if(!disp)
+ return remove_event_handler(event_target_ptr, eid);
event_target = get_event_target(event_target_ptr);
if(!event_target)
@@ -1056,25 +1104,19 @@
IDispatch_Release(event_target->event_table[eid]->handler_prop);
event_target->event_table[eid]->handler_prop = disp;
- if(!disp)
- return S_OK;
IDispatch_AddRef(disp);
- return ensure_nsevent_handler(doc, eid);
-}
-
-HRESULT set_event_handler(event_target_t **event_target, HTMLDocumentNode *doc, eventid_t
eid, VARIANT *var)
+ return ensure_nsevent_handler(doc, event_target, nsnode, eid);
+}
+
+HRESULT set_event_handler(event_target_t **event_target, nsIDOMNode *nsnode,
HTMLDocumentNode *doc, eventid_t eid, VARIANT *var)
{
switch(V_VT(var)) {
case VT_NULL:
- if(*event_target && (*event_target)->event_table[eid] &&
(*event_target)->event_table[eid]->handler_prop) {
- IDispatch_Release((*event_target)->event_table[eid]->handler_prop);
- (*event_target)->event_table[eid]->handler_prop = NULL;
- }
- break;
+ return remove_event_handler(event_target, eid);
case VT_DISPATCH:
- return set_event_handler_disp(event_target, doc, eid, V_DISPATCH(var));
+ return set_event_handler_disp(event_target, nsnode, doc, eid, V_DISPATCH(var));
default:
FIXME("not supported vt=%d\n", V_VT(var));
@@ -1098,7 +1140,8 @@
return S_OK;
}
-HRESULT attach_event(event_target_t **event_target_ptr, HTMLDocument *doc, BSTR name,
IDispatch *disp, VARIANT_BOOL *res)
+HRESULT attach_event(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTMLDocument
*doc, BSTR name,
+ IDispatch *disp, VARIANT_BOOL *res)
{
event_target_t *event_target;
eventid_t eid;
@@ -1128,7 +1171,7 @@
event_target->event_table[eid]->handlers[i] = disp;
*res = VARIANT_TRUE;
- return ensure_nsevent_handler(doc->doc_node, eid);
+ return ensure_nsevent_handler(doc->doc_node, event_target, nsnode, eid);
}
HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name,
IDispatch *disp)
@@ -1159,13 +1202,18 @@
return S_OK;
}
-void update_cp_events(HTMLWindow *window, cp_static_data_t *cp)
-{
+void update_cp_events(HTMLWindow *window, event_target_t **event_target_ptr,
cp_static_data_t *cp, nsIDOMNode *nsnode)
+{
+ event_target_t *event_target;
int i;
+
+ event_target = get_event_target(event_target_ptr);
+ if(!event_target)
+ return; /* FIXME */
for(i=0; i < EVENTID_LAST; i++) {
if((event_info[i].flags & EVENT_DEFAULTLISTENER) && is_cp_event(cp,
event_info[i].dispid))
- ensure_nsevent_handler(window->doc, i);
+ ensure_nsevent_handler(window->doc, event_target, nsnode, i);
}
}
@@ -1194,7 +1242,7 @@
disp = script_parse_event(doc->basedoc.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);
+ set_event_handler_disp(get_node_event_target(node), node->nsnode,
node->doc, i, disp);
IDispatch_Release(disp);
}
}
Modified: trunk/reactos/dll/win32/mshtml/htmlevent.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlevent…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlevent.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlevent.h [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -42,14 +42,14 @@
eventid_t str_to_eid(LPCWSTR);
void check_event_attr(HTMLDocumentNode*,nsIDOMElement*);
void release_event_target(event_target_t*);
-void fire_event(HTMLDocumentNode*,eventid_t,nsIDOMNode*,nsIDOMEvent*);
-HRESULT set_event_handler(event_target_t**,HTMLDocumentNode*,eventid_t,VARIANT*);
+void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*);
+HRESULT
set_event_handler(event_target_t**,nsIDOMNode*,HTMLDocumentNode*,eventid_t,VARIANT*);
HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*);
-HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*);
+HRESULT
attach_event(event_target_t**,nsIDOMNode*,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*);
HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*);
HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*);
HRESULT call_event(HTMLDOMNode*,eventid_t);
-void update_cp_events(HTMLWindow*,cp_static_data_t*);
+void update_cp_events(HTMLWindow*,event_target_t**,cp_static_data_t*,nsIDOMNode*);
static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
{
@@ -58,7 +58,7 @@
static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
{
- return set_event_handler(get_node_event_target(node), node->doc, eid, var);
+ return set_event_handler(get_node_event_target(node), node->nsnode, node->doc,
eid, var);
}
static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
Modified: trunk/reactos/dll/win32/mshtml/htmlimg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlimg.c…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlimg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlimg.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -28,6 +28,7 @@
#include "wine/debug.h"
#include "mshtml_private.h"
+#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@@ -388,15 +389,19 @@
static HRESULT WINAPI HTMLImgElement_put_onload(IHTMLImgElement *iface, VARIANT v)
{
HTMLImgElement *This = HTMLIMG_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+ return set_node_event(&This->element.node, EVENTID_LOAD, &v);
}
static HRESULT WINAPI HTMLImgElement_get_onload(IHTMLImgElement *iface, VARIANT *p)
{
HTMLImgElement *This = HTMLIMG_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_node_event(&This->element.node, EVENTID_LOAD, p);
}
static HRESULT WINAPI HTMLImgElement_put_onerror(IHTMLImgElement *iface, VARIANT v)
Modified: trunk/reactos/dll/win32/mshtml/htmlwindow.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlwindo…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlwindow.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlwindow.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -126,7 +126,7 @@
return E_FAIL;
}
- return set_event_handler(&window->doc->body_event_target, window->doc,
eid, var);
+ return set_event_handler(&window->doc->body_event_target, NULL,
window->doc, eid, var);
}
static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)
@@ -1419,7 +1419,7 @@
return E_FAIL;
}
- return attach_event(&This->doc->body_event_target,
&This->doc->basedoc, event, pDisp, pfResult);
+ return attach_event(&This->doc->body_event_target, NULL,
&This->doc->basedoc, event, pDisp, pfResult);
}
static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch
*pDisp)
Modified: trunk/reactos/dll/win32/mshtml/mshtml_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/mshtml_pr…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/mshtml_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/mshtml_private.h [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -736,7 +736,7 @@
void init_nsevents(HTMLDocumentNode*);
void release_nsevents(HTMLDocumentNode*);
-void add_nsevent_listener(HTMLDocumentNode*,LPCWSTR);
+void add_nsevent_listener(HTMLDocumentNode*,nsIDOMNode*,LPCWSTR);
void set_window_bscallback(HTMLWindow*,nsChannelBSC*);
void set_current_mon(HTMLWindow*,IMoniker*);
Modified: trunk/reactos/dll/win32/mshtml/mutation.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/mutation.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/mutation.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/mutation.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -337,6 +337,9 @@
docobj_task_t *task;
TRACE("\n");
+
+ if(!This->basedoc.doc_obj)
+ return;
if(This != This->basedoc.doc_obj->basedoc.doc_node) {
set_ready_state(This->basedoc.window, READYSTATE_INTERACTIVE);
Modified: trunk/reactos/dll/win32/mshtml/navigate.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/navigate.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/navigate.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/navigate.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -972,8 +972,11 @@
on_start_nsrequest(This);
- if(This->window)
+ if(This->window) {
update_window_doc(This->window);
+ if(This->window->readystate != READYSTATE_LOADING)
+ set_ready_state(This->window, READYSTATE_LOADING);
+ }
}
This->bsc.readed += This->nsstream->buf_size;
Modified: trunk/reactos/dll/win32/mshtml/nsevents.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/nsevents.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/nsevents.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/nsevents.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -216,7 +216,7 @@
TRACE("(%p)\n", doc);
- if(!doc)
+ if(!doc || !doc->basedoc.window)
return NS_ERROR_FAILURE;
doc_obj = doc->basedoc.doc_obj;
@@ -254,7 +254,7 @@
nsIDOMHTMLDocument_GetBody(doc->nsdoc, &nsbody);
if(nsbody) {
- fire_event(doc, EVENTID_LOAD, (nsIDOMNode*)nsbody, event);
+ fire_event(doc, EVENTID_LOAD, TRUE, (nsIDOMNode*)nsbody, event);
nsIDOMHTMLElement_Release(nsbody);
}
@@ -271,6 +271,8 @@
eventid_t eid;
nsresult nsres;
+ TRACE("\n");
+
nsAString_Init(&type_str, NULL);
nsIDOMEvent_GetType(event, &type_str);
nsAString_GetData(&type_str, &type);
@@ -290,7 +292,7 @@
return NS_OK;
}
- fire_event(doc, eid, nsnode, event);
+ fire_event(doc, eid, TRUE, nsnode, event);
nsIDOMNode_Release(nsnode);
@@ -334,12 +336,15 @@
This->This = listener;
}
-void add_nsevent_listener(HTMLDocumentNode *doc, LPCWSTR type)
+void add_nsevent_listener(HTMLDocumentNode *doc, nsIDOMNode *nsnode, LPCWSTR type)
{
nsIDOMEventTarget *target;
nsresult nsres;
- nsres = nsIDOMWindow_QueryInterface(doc->basedoc.window->nswindow,
&IID_nsIDOMEventTarget, (void**)&target);
+ if(nsnode)
+ nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMEventTarget,
(void**)&target);
+ else
+ nsres = nsIDOMWindow_QueryInterface(doc->basedoc.window->nswindow,
&IID_nsIDOMEventTarget, (void**)&target);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMEventTarget interface: %08x\n", nsres);
return;
Modified: trunk/reactos/dll/win32/mshtml/nsio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/nsio.c?re…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/nsio.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/nsio.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -904,7 +904,7 @@
open = FALSE;
}else {
- open = before_async_open(This, window->doc_obj->nscontainer);
+ open = !before_async_open(This, window->doc_obj->nscontainer);
if(!open) {
TRACE("canceled\n");
nsres = NS_ERROR_UNEXPECTED;
Modified: trunk/reactos/dll/win32/mshtml/omnavigator.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/omnavigat…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/omnavigator.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/omnavigator.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -160,19 +160,28 @@
{
OmNavigator *This = OMNAVIGATOR_THIS(iface);
- /* FIXME: Should we return something smarter? */
- static const WCHAR app_verW[] =
- {'4','.','0','
','(','c','o','m','p','a','t','i','b','l','e',';',
- ' ','M','S','I','E','
','7','.','0',';',
- '
','W','i','n','d','o','w','s','
','N','T','
','5','.','1',';',
- '
','M','o','z','i','l','l','a','/','4','.','0',')',0};
-
- TRACE("(%p)->(%p)\n", This, p);
-
- *p = SysAllocString(app_verW);
+ char user_agent[512];
+ DWORD size;
+ HRESULT hres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ size = sizeof(user_agent);
+ hres = ObtainUserAgentString(0, user_agent, &size);
+ if(FAILED(hres))
+ return hres;
+
+ if(strncmp(user_agent, "Mozilla/", 8)) {
+ FIXME("Unsupported user agent\n");
+ return E_FAIL;
+ }
+
+ size = MultiByteToWideChar(CP_ACP, 0, user_agent+8, -1, NULL, 0);
+ *p = SysAllocStringLen(NULL, size-1);
if(!*p)
return E_OUTOFMEMORY;
+ MultiByteToWideChar(CP_ACP, 0, user_agent+8, -1, *p, size);
return S_OK;
}
Modified: trunk/reactos/dll/win32/mshtml/persist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/persist.c…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/persist.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/persist.c [iso-8859-1] Sun Mar 21 16:12:30 2010
@@ -108,6 +108,7 @@
V_I4(&progress) = 0; /* FIXME */
IOleCommandTarget_Exec(olecmd, NULL, OLECMDID_SETPROGRESSPOS,
OLECMDEXECOPT_DONTPROMPTUSER,
&progress, NULL);
+ IOleCommandTarget_Release(olecmd);
}
if(doc->usermode == EDITMODE && doc->hostui) {
@@ -282,11 +283,15 @@
void set_ready_state(HTMLWindow *window, READYSTATE readystate)
{
window->readystate = readystate;
+
if(window->doc_obj && window->doc_obj->basedoc.window == window)
call_property_onchanged(&window->doc_obj->basedoc.cp_propnotif,
DISPID_READYSTATE);
+
+ fire_event(window->doc, EVENTID_READYSTATECHANGE, FALSE,
window->doc->node.nsnode, NULL);
+
if(window->frame_element)
fire_event(window->frame_element->element.node.doc,
EVENTID_READYSTATECHANGE,
- window->frame_element->element.node.nsnode, NULL);
+ TRUE, window->frame_element->element.node.nsnode, NULL);
}
static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)