Commit 4f358c40 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Add IDOMEvent::isTrusted implementation.

parent 8dd582eb
......@@ -1058,8 +1058,11 @@ static HRESULT WINAPI DOMEvent_stopImmediatePropagation(IDOMEvent *iface)
static HRESULT WINAPI DOMEvent_get_isTrusted(IDOMEvent *iface, VARIANT_BOOL *p)
{
DOMEvent *This = impl_from_IDOMEvent(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
*p = variant_bool(This->trusted);
return S_OK;
}
static HRESULT WINAPI DOMEvent_put_cancelBubble(IDOMEvent *iface, VARIANT_BOOL v)
......@@ -2294,6 +2297,7 @@ HRESULT create_event_from_nsevent(nsIDOMEvent *nsevent, compat_mode_t compat_mod
if(!event)
return E_OUTOFMEMORY;
event->trusted = TRUE;
*ret_event = event;
return S_OK;
}
......@@ -2342,6 +2346,7 @@ HRESULT create_document_event(HTMLDocumentNode *doc, eventid_t event_id, DOMEven
return E_OUTOFMEMORY;
event->event_id = event_id;
event->trusted = TRUE;
*ret_event = event;
return S_OK;
}
......
......@@ -86,6 +86,7 @@ typedef struct DOMEvent {
BOOL prevent_default;
BOOL stop_propagation;
BOOL stop_immediate_propagation;
BOOL trusted;
DOM_EVENT_PHASE phase;
IHTMLEventObj *event_obj;
......
......@@ -316,6 +316,7 @@ sync_test("prevent_default", function() {
a.addEventListener("click", function(e) {
calls += "a,";
ok(e.defaultPrevented === true, "e.defaultPrevented = " + e.defaultPrevented);
ok(e.isTrusted === true, "isTrusted = " + e.isTrusted);
}, true);
calls = "";
......@@ -386,12 +387,14 @@ sync_test("init_event", function() {
ok(e.type === "", "type = " + e.type);
ok(e.cancelable === false, "cancelable = " + e.cancelable);
ok(e.bubbles === false, "bubbles = " + e.bubbles);
ok(e.isTrusted === false, "isTrusted = " + e.isTrusted);
e.initEvent("test", true, false);
ok(e.type === "test", "type = " + e.type);
ok(e.cancelable === false, "cancelable = " + e.cancelable);
ok(e.bubbles === true, "bubbles = " + e.bubbles);
ok(e.defaultPrevented === false, "defaultPrevented = " + e.defaultPrevented);
ok(e.isTrusted === false, "isTrusted = " + e.isTrusted);
e.preventDefault();
ok(e.defaultPrevented === false, "defaultPrevented = " + e.defaultPrevented);
......@@ -406,6 +409,7 @@ sync_test("init_event", function() {
elem.addEventListener("NewTest", function(event) {
ok(e === event, "e != event");
ok(e.isTrusted === false, "isTrusted = " + e.isTrusted);
e.preventDefault();
ok(e.defaultPrevented === true, "defaultPrevented = " + e.defaultPrevented);
......
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