Commit cfefbb8f authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Send proper legacy storage event with actual url.

parent 7ca9e4ac
...@@ -3045,7 +3045,7 @@ static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface, ...@@ -3045,7 +3045,7 @@ static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
return E_NOTIMPL; return E_NOTIMPL;
} }
return create_event_obj(dispex_compat_mode(&This->node.event_target.dispex), ppEventObj); return create_event_obj(NULL, dispex_compat_mode(&This->node.event_target.dispex), ppEventObj);
} }
static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName, static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
......
...@@ -2035,11 +2035,11 @@ static HTMLEventObj *alloc_event_obj(DOMEvent *event, compat_mode_t compat_mode) ...@@ -2035,11 +2035,11 @@ static HTMLEventObj *alloc_event_obj(DOMEvent *event, compat_mode_t compat_mode)
return event_obj; return event_obj;
} }
HRESULT create_event_obj(compat_mode_t compat_mode, IHTMLEventObj **ret) HRESULT create_event_obj(DOMEvent *event, compat_mode_t compat_mode, IHTMLEventObj **ret)
{ {
HTMLEventObj *event_obj; HTMLEventObj *event_obj;
event_obj = alloc_event_obj(NULL, compat_mode); event_obj = alloc_event_obj(event, compat_mode);
if(!event_obj) if(!event_obj)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
...@@ -107,7 +107,7 @@ HRESULT fire_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*); ...@@ -107,7 +107,7 @@ HRESULT fire_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*);
void update_doc_cp_events(HTMLDocumentNode*,cp_static_data_t*); void update_doc_cp_events(HTMLDocumentNode*,cp_static_data_t*);
HRESULT doc_init_events(HTMLDocumentNode*); HRESULT doc_init_events(HTMLDocumentNode*);
void detach_events(HTMLDocumentNode *doc); void detach_events(HTMLDocumentNode *doc);
HRESULT create_event_obj(compat_mode_t,IHTMLEventObj**); HRESULT create_event_obj(DOMEvent*,compat_mode_t,IHTMLEventObj**);
void bind_target_event(HTMLDocumentNode*,EventTarget*,const WCHAR*,IDispatch*); void bind_target_event(HTMLDocumentNode*,EventTarget*,const WCHAR*,IDispatch*);
HRESULT ensure_doc_nsevent_handler(HTMLDocumentNode*,nsIDOMNode*,eventid_t); HRESULT ensure_doc_nsevent_handler(HTMLDocumentNode*,nsIDOMNode*,eventid_t);
......
...@@ -208,12 +208,21 @@ static void storage_event_proc(event_task_t *_task) ...@@ -208,12 +208,21 @@ static void storage_event_proc(event_task_t *_task)
struct storage_event_task *task = (struct storage_event_task*)_task; struct storage_event_task *task = (struct storage_event_task*)_task;
HTMLInnerWindow *window = task->header.window; HTMLInnerWindow *window = task->header.window;
DOMEvent *event = task->event; DOMEvent *event = task->event;
compat_mode_t compat_mode;
VARIANT_BOOL cancelled; VARIANT_BOOL cancelled;
HRESULT hres;
VARIANT var;
if(event->event_id == EVENTID_STORAGE && dispex_compat_mode(&window->event_target.dispex) >= COMPAT_MODE_IE9) { if(event->event_id == EVENTID_STORAGE && (compat_mode = dispex_compat_mode(&window->event_target.dispex)) >= COMPAT_MODE_IE9) {
dispatch_event(&window->event_target, event); dispatch_event(&window->event_target, event);
if(window->doc) if(window->doc) {
fire_event(&window->doc->node, L"onstorage", NULL, &cancelled); hres = create_event_obj(event, compat_mode, (IHTMLEventObj**)&V_DISPATCH(&var));
if(SUCCEEDED(hres)) {
V_VT(&var) = VT_DISPATCH;
fire_event(&window->doc->node, L"onstorage", &var, &cancelled);
IDispatch_Release(V_DISPATCH(&var));
}
}
}else if(window->doc) { }else if(window->doc) {
dispatch_event(&window->doc->node.event_target, event); dispatch_event(&window->doc->node.event_target, event);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment