static void webkit_dom_test_event_target_dispatch_event(WebKitDOMEventTarget* target, WebKitDOMEvent* event, GError** error) { WebCore::Event* coreEvent = WebKit::core(event); WebCore::TestEventTarget* coreTarget = static_cast<WebCore::TestEventTarget*>(WEBKIT_DOM_OBJECT(target)->coreObject); WebCore::ExceptionCode ec = 0; coreTarget->dispatchEvent(coreEvent, ec); if (ec) { WebCore::ExceptionCodeDescription description(ec); g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), description.code, description.name); } }
gboolean webkit_dom_test_event_target_dispatch_event(WebKitDOMTestEventTarget* self, WebKitDOMEvent* evt, GError** error) { WebCore::JSMainThreadNullState state; g_return_val_if_fail(WEBKIT_DOM_IS_TEST_EVENT_TARGET(self), FALSE); g_return_val_if_fail(WEBKIT_DOM_IS_EVENT(evt), FALSE); g_return_val_if_fail(!error || !*error, FALSE); WebCore::TestEventTarget* item = WebKit::core(self); WebCore::Event* convertedEvt = WebKit::core(evt); WebCore::ExceptionCode ec = 0; gboolean result = item->dispatchEvent(convertedEvt, ec); if (ec) { WebCore::ExceptionCodeDescription ecdesc(ec); g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name); } return result; }