00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "kjs_window.h"
00022 #include "kjs_events.h"
00023 #include "kjs_events.lut.h"
00024 #include "kjs_views.h"
00025 #include "kjs_proxy.h"
00026 #include "xml/dom_nodeimpl.h"
00027 #include "xml/dom_docimpl.h"
00028 #include "xml/dom2_eventsimpl.h"
00029 #include "rendering/render_object.h"
00030
00031 #include <kdebug.h>
00032
00033 using namespace KJS;
00034
00035
00036
00037 JSEventListener::JSEventListener(Object _listener, const Object &_win, bool _html)
00038 : listener( _listener ), html( _html ), win( _win )
00039 {
00040
00041 static_cast<Window*>(win.imp())->jsEventListeners.append(this);
00042 }
00043
00044 JSEventListener::~JSEventListener()
00045 {
00046 static_cast<Window*>(win.imp())->jsEventListeners.removeRef(this);
00047
00048 }
00049
00050 void JSEventListener::handleEvent(DOM::Event &evt)
00051 {
00052 #ifdef KJS_DEBUGGER
00053 if (KJSDebugWin::instance() && KJSDebugWin::instance()->inSession())
00054 return;
00055 #endif
00056 KHTMLPart *part = static_cast<Window*>(win.imp())->part();
00057 KJSProxy *proxy = 0L;
00058 if (part)
00059 proxy = KJSProxy::proxy( part );
00060
00061 if (proxy && listener.implementsCall()) {
00062 ref();
00063
00064 KJS::ScriptInterpreter *interpreter = static_cast<KJS::ScriptInterpreter *>(proxy->interpreter());
00065 ExecState *exec = interpreter->globalExec();
00066
00067 List args;
00068 args.append(getDOMEvent(exec,evt));
00069
00070
00071
00072 Object thisObj = Object::dynamicCast(getDOMNode(exec,evt.currentTarget()));
00073 List scope;
00074 List oldScope = listener.scope();
00075 if ( thisObj.isValid() ) {
00076 scope = static_cast<DOMNode*>(thisObj.imp())->eventHandlerScope(exec);
00077 if ( !scope.isEmpty() ) {
00078 List curScope = oldScope.copy();
00079 curScope.prependList( scope );
00080 listener.setScope( curScope );
00081 }
00082 }
00083 else {
00084 if ( m_hackThisObj.isValid() )
00085 thisObj = m_hackThisObj;
00086 else
00087 kdWarning() << "Null 'this' object! evt=" << evt.type().string() << " currentTarget==" << evt.currentTarget().handle() << endl;
00088 }
00089
00090 Window *window = static_cast<Window*>(win.imp());
00091
00092 window->setCurrentEvent( &evt );
00093
00094 interpreter->setCurrentEvent( &evt );
00095
00096 KJSCPUGuard guard;
00097 guard.start();
00098 Value retval = listener.call(exec, thisObj, args);
00099 guard.stop();
00100
00101 if ( !scope.isEmpty() ) {
00102 listener.setScope( oldScope );
00103 }
00104
00105 window->setCurrentEvent( 0 );
00106 interpreter->setCurrentEvent( 0 );
00107 if ( exec->hadException() )
00108 exec->clearException();
00109 else
00110 {
00111 QVariant ret = ValueToVariant(exec, retval);
00112 if (ret.type() == QVariant::Bool && ret.toBool() == false)
00113 evt.preventDefault();
00114 }
00115 window->afterScriptExecution();
00116 deref();
00117 }
00118 }
00119
00120 DOM::DOMString JSEventListener::eventListenerType()
00121 {
00122 if (html)
00123 return "_khtml_HTMLEventListener";
00124 else
00125 return "_khtml_JSEventListener";
00126 }
00127
00128 Value KJS::getNodeEventListener(DOM::Node n, int eventId)
00129 {
00130 DOM::EventListener *listener = n.handle()->getHTMLEventListener(eventId);
00131 if (listener)
00132 return static_cast<JSEventListener*>(listener)->listenerObj();
00133 else
00134 return Null();
00135 }
00136
00137
00138
00139 const ClassInfo EventConstructor::info = { "EventConstructor", 0, &EventConstructorTable, 0 };
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165 EventConstructor::EventConstructor(ExecState *exec)
00166 : DOMObject(exec->interpreter()->builtinObjectPrototype())
00167 {
00168 }
00169
00170 Value EventConstructor::tryGet(ExecState *exec, const UString &p) const
00171 {
00172 return DOMObjectLookupGetValue<EventConstructor, DOMObject>(exec,p,&EventConstructorTable,this);
00173 }
00174
00175 Value EventConstructor::getValueProperty(ExecState *, int token) const
00176 {
00177
00178 return Number(token);
00179 }
00180
00181 Value KJS::getEventConstructor(ExecState *exec)
00182 {
00183 return cacheGlobalObject<EventConstructor>(exec, "[[event.constructor]]");
00184 }
00185
00186
00187
00188 const ClassInfo DOMEvent::info = { "Event", 0, &DOMEventTable, 0 };
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 DEFINE_PROTOTYPE("DOMEvent", DOMEventProto)
00209 IMPLEMENT_PROTOFUNC_DOM(DOMEventProtoFunc)
00210 IMPLEMENT_PROTOTYPE(DOMEventProto, DOMEventProtoFunc)
00211
00212 DOMEvent::DOMEvent(ExecState *exec, DOM::Event e)
00213 : DOMObject(DOMEventProto::self(exec)), event(e) { }
00214
00215 DOMEvent::~DOMEvent()
00216 {
00217 ScriptInterpreter::forgetDOMObject(event.handle());
00218 }
00219
00220 Value DOMEvent::tryGet(ExecState *exec, const UString &p) const
00221 {
00222 #ifdef KJS_VERBOSE
00223 kdDebug() << "KJS::DOMEvent::tryGet " << p.qstring() << endl;
00224 #endif
00225 return DOMObjectLookupGetValue<DOMEvent,DOMObject>(exec, p, &DOMEventTable, this );
00226 }
00227
00228 Value DOMEvent::getValueProperty(ExecState *exec, int token) const
00229 {
00230 switch (token) {
00231 case Type:
00232 return String(event.type());
00233 case Target:
00234 case SrcElement:
00235 return getDOMNode(exec,event.target());
00236 case CurrentTarget:
00237 return getDOMNode(exec,event.currentTarget());
00238 case EventPhase:
00239 return Number((unsigned int)event.eventPhase());
00240 case Bubbles:
00241 return Boolean(event.bubbles());
00242 case Cancelable:
00243 return Boolean(event.cancelable());
00244 case TimeStamp:
00245 return Number((long unsigned int)event.timeStamp());
00246 case ReturnValue:
00247 return Boolean(event.handle()->defaultPrevented());
00248 case CancelBubble:
00249 return Boolean(event.handle()->propagationStopped());
00250 default:
00251 kdWarning() << "Unhandled token in DOMEvent::getValueProperty : " << token << endl;
00252 return Value();
00253 }
00254 }
00255
00256 void DOMEvent::tryPut(ExecState *exec, const UString &propertyName,
00257 const Value& value, int attr)
00258 {
00259 DOMObjectLookupPut<DOMEvent, DOMObject>(exec, propertyName, value, attr,
00260 &DOMEventTable, this);
00261 }
00262
00263 void DOMEvent::putValueProperty(ExecState *exec, int token, const Value& value, int)
00264 {
00265 switch (token) {
00266 case ReturnValue:
00267
00268
00269 event.handle()->preventDefault(!value.toBoolean(exec));
00270 break;
00271 case CancelBubble:
00272 event.handle()->stopPropagation(value.toBoolean(exec));
00273 break;
00274 default:
00275 break;
00276 }
00277 }
00278
00279 Value DOMEventProtoFunc::tryCall(ExecState *exec, Object & thisObj, const List &args)
00280 {
00281 KJS_CHECK_THIS( KJS::DOMEvent, thisObj );
00282 DOM::Event event = static_cast<DOMEvent *>( thisObj.imp() )->toEvent();
00283 switch (id) {
00284 case DOMEvent::StopPropagation:
00285 event.stopPropagation();
00286 case DOMEvent::PreventDefault:
00287 event.preventDefault();
00288 return Undefined();
00289 case DOMEvent::InitEvent:
00290 event.initEvent(args[0].toString(exec).string(),args[1].toBoolean(exec),args[2].toBoolean(exec));
00291 return Undefined();
00292 };
00293 return Undefined();
00294 }
00295
00296 Value KJS::getDOMEvent(ExecState *exec, DOM::Event e)
00297 {
00298 DOMObject *ret;
00299 if (e.isNull())
00300 return Null();
00301 ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->interpreter());
00302 if ((ret = interp->getDOMObject(e.handle())))
00303 return Value(ret);
00304
00305 DOM::DOMString module = e.eventModuleName();
00306 if (module == "UIEvents")
00307 ret = new DOMUIEvent(exec, static_cast<DOM::UIEvent>(e));
00308 else if (module == "MouseEvents")
00309 ret = new DOMMouseEvent(exec, static_cast<DOM::MouseEvent>(e));
00310 else if (module == "TextEvents")
00311 ret = new DOMTextEvent(exec, static_cast<DOM::TextEvent>(e));
00312 else if (module == "MutationEvents")
00313 ret = new DOMMutationEvent(exec, static_cast<DOM::MutationEvent>(e));
00314 else
00315 ret = new DOMEvent(exec, e);
00316
00317 interp->putDOMObject(e.handle(),ret);
00318 return Value(ret);
00319 }
00320
00321 DOM::Event KJS::toEvent(const Value& val)
00322 {
00323 Object obj = Object::dynamicCast(val);
00324 if (obj.isNull() || !obj.inherits(&DOMEvent::info))
00325 return DOM::Event();
00326
00327 const DOMEvent *dobj = static_cast<const DOMEvent*>(obj.imp());
00328 return dobj->toEvent();
00329 }
00330
00331
00332
00333
00334 const ClassInfo EventExceptionConstructor::info = { "EventExceptionConstructor", 0, &EventExceptionConstructorTable, 0 };
00335
00336
00337
00338
00339
00340 EventExceptionConstructor::EventExceptionConstructor(ExecState *exec)
00341 : DOMObject(exec->interpreter()->builtinObjectPrototype())
00342 {
00343 }
00344
00345 Value EventExceptionConstructor::tryGet(ExecState *exec, const UString &p) const
00346 {
00347 return DOMObjectLookupGetValue<EventExceptionConstructor, DOMObject>(exec,p,&EventExceptionConstructorTable,this);
00348 }
00349
00350 Value EventExceptionConstructor::getValueProperty(ExecState *, int token) const
00351 {
00352
00353 return Number(token);
00354 }
00355
00356 Value KJS::getEventExceptionConstructor(ExecState *exec)
00357 {
00358 return cacheGlobalObject<EventExceptionConstructor>(exec, "[[eventException.constructor]]");
00359 }
00360
00361
00362
00363 const ClassInfo DOMUIEvent::info = { "UIEvent", &DOMEvent::info, &DOMUIEventTable, 0 };
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373 DEFINE_PROTOTYPE("DOMUIEvent",DOMUIEventProto)
00374 IMPLEMENT_PROTOFUNC_DOM(DOMUIEventProtoFunc)
00375 IMPLEMENT_PROTOTYPE_WITH_PARENT(DOMUIEventProto,DOMUIEventProtoFunc,DOMEventProto)
00376
00377 DOMUIEvent::~DOMUIEvent()
00378 {
00379 }
00380
00381 Value DOMUIEvent::tryGet(ExecState *exec, const UString &p) const
00382 {
00383 return DOMObjectLookupGetValue<DOMUIEvent,DOMEvent>(exec,p,&DOMUIEventTable,this);
00384 }
00385
00386 Value DOMUIEvent::getValueProperty(ExecState *exec, int token) const
00387 {
00388 switch (token) {
00389 case View:
00390 return getDOMAbstractView(exec,static_cast<DOM::UIEvent>(event).view());
00391 case Detail:
00392 return Number(static_cast<DOM::UIEvent>(event).detail());
00393 default:
00394 kdWarning() << "Unhandled token in DOMUIEvent::getValueProperty : " << token << endl;
00395 return Value();
00396 }
00397 }
00398
00399 Value DOMUIEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
00400 {
00401 KJS_CHECK_THIS( KJS::DOMUIEvent, thisObj );
00402 DOM::UIEvent uiEvent = static_cast<DOMUIEvent *>(thisObj.imp())->toUIEvent();
00403 switch (id) {
00404 case DOMUIEvent::InitUIEvent: {
00405 DOM::AbstractView v = toAbstractView(args[3]);
00406 static_cast<DOM::UIEvent>(uiEvent).initUIEvent(args[0].toString(exec).string(),
00407 args[1].toBoolean(exec),
00408 args[2].toBoolean(exec),
00409 v,
00410 args[4].toInteger(exec));
00411 }
00412 return Undefined();
00413 }
00414 return Undefined();
00415 }
00416
00417
00418
00419 const ClassInfo DOMMouseEvent::info = { "MouseEvent", &DOMUIEvent::info, &DOMMouseEventTable, 0 };
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444 DEFINE_PROTOTYPE("DOMMouseEvent",DOMMouseEventProto)
00445 IMPLEMENT_PROTOFUNC_DOM(DOMMouseEventProtoFunc)
00446 IMPLEMENT_PROTOTYPE_WITH_PARENT(DOMMouseEventProto,DOMMouseEventProtoFunc,DOMUIEventProto)
00447
00448 DOMMouseEvent::~DOMMouseEvent()
00449 {
00450 }
00451
00452 Value DOMMouseEvent::tryGet(ExecState *exec, const UString &p) const
00453 {
00454 #ifdef KJS_VERBOSE
00455 kdDebug(6070) << "DOMMouseEvent::tryGet " << p.qstring() << endl;
00456 #endif
00457 return DOMObjectLookupGetValue<DOMMouseEvent,DOMUIEvent>(exec,p,&DOMMouseEventTable,this);
00458 }
00459
00460 Value DOMMouseEvent::getValueProperty(ExecState *exec, int token) const
00461 {
00462 switch (token) {
00463 case ScreenX:
00464 return Number(static_cast<DOM::MouseEvent>(event).screenX());
00465 case ScreenY:
00466 return Number(static_cast<DOM::MouseEvent>(event).screenY());
00467 case ClientX:
00468 case X:
00469 return Number(static_cast<DOM::MouseEvent>(event).clientX());
00470 case ClientY:
00471 case Y:
00472 return Number(static_cast<DOM::MouseEvent>(event).clientY());
00473 case OffsetX:
00474 case OffsetY:
00475 {
00476 DOM::Node node = event.target();
00477 node.handle()->getDocument()->updateRendering();
00478 khtml::RenderObject *rend = node.handle() ? node.handle()->renderer() : 0L;
00479 int x = static_cast<DOM::MouseEvent>(event).clientX();
00480 int y = static_cast<DOM::MouseEvent>(event).clientY();
00481 if ( rend ) {
00482 int xPos, yPos;
00483 if ( rend->absolutePosition( xPos, yPos ) ) {
00484 kdDebug() << "DOMMouseEvent::getValueProperty rend=" << rend << " xPos=" << xPos << " yPos=" << yPos << endl;
00485 x -= xPos;
00486 y -= yPos;
00487 }
00488 }
00489 return Number( token == OffsetX ? x : y );
00490 }
00491 case CtrlKey:
00492 return Boolean(static_cast<DOM::MouseEvent>(event).ctrlKey());
00493 case ShiftKey:
00494 return Boolean(static_cast<DOM::MouseEvent>(event).shiftKey());
00495 case AltKey:
00496 return Boolean(static_cast<DOM::MouseEvent>(event).altKey());
00497 case MetaKey:
00498 return Boolean(static_cast<DOM::MouseEvent>(event).metaKey());
00499 case Button:
00500 {
00501
00502
00503 int domButton = static_cast<DOM::MouseEvent>(event).button();
00504 int button = domButton==0 ? 1 : domButton==1 ? 4 : domButton==2 ? 2 : 0;
00505 return Number( (unsigned int)button );
00506 }
00507 case ToElement:
00508
00509 if (event.handle()->id() == DOM::EventImpl::MOUSEOUT_EVENT)
00510 return getDOMNode(exec,static_cast<DOM::MouseEvent>(event).relatedTarget());
00511 return getDOMNode(exec,static_cast<DOM::MouseEvent>(event).target());
00512 case FromElement:
00513
00514
00515 if (event.handle()->id() == DOM::EventImpl::MOUSEOUT_EVENT)
00516 return getDOMNode(exec,static_cast<DOM::MouseEvent>(event).target());
00517
00518 case RelatedTarget:
00519 return getDOMNode(exec,static_cast<DOM::MouseEvent>(event).relatedTarget());
00520 default:
00521 kdWarning() << "Unhandled token in DOMMouseEvent::getValueProperty : " << token << endl;
00522 return Value();
00523 }
00524 }
00525
00526 Value DOMMouseEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
00527 {
00528 KJS_CHECK_THIS( KJS::DOMMouseEvent, thisObj );
00529 DOM::MouseEvent mouseEvent = static_cast<DOMMouseEvent *>(thisObj.imp())->toMouseEvent();
00530 switch (id) {
00531 case DOMMouseEvent::InitMouseEvent:
00532 mouseEvent.initMouseEvent(args[0].toString(exec).string(),
00533 args[1].toBoolean(exec),
00534 args[2].toBoolean(exec),
00535 toAbstractView(args[3]),
00536 args[4].toInteger(exec),
00537 args[5].toInteger(exec),
00538 args[6].toInteger(exec),
00539 args[7].toInteger(exec),
00540 args[8].toInteger(exec),
00541 args[9].toBoolean(exec),
00542 args[10].toBoolean(exec),
00543 args[11].toBoolean(exec),
00544 args[12].toBoolean(exec),
00545 args[13].toInteger(exec),
00546 toNode(args[14]));
00547 return Undefined();
00548 }
00549 return Undefined();
00550 }
00551
00552
00553
00554 const ClassInfo DOMTextEvent::info = { "TextEvent", &DOMUIEvent::info, &DOMTextEventTable, 0 };
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571 DEFINE_PROTOTYPE("DOMTextEvent",DOMTextEventProto)
00572 IMPLEMENT_PROTOFUNC_DOM(DOMTextEventProtoFunc)
00573 IMPLEMENT_PROTOTYPE_WITH_PARENT(DOMTextEventProto,DOMTextEventProtoFunc,DOMUIEventProto)
00574
00575 DOMTextEvent::~DOMTextEvent()
00576 {
00577 }
00578
00579 Value DOMTextEvent::tryGet(ExecState *exec, const UString &p) const
00580 {
00581 #ifdef KJS_VERBOSE
00582 kdDebug(6070) << "DOMTextEvent::tryGet " << p.qstring() << endl;
00583 #endif
00584 return DOMObjectLookupGetValue<DOMTextEvent,DOMUIEvent>(exec,p,&DOMTextEventTable,this);
00585 }
00586
00587 Value DOMTextEvent::getValueProperty(ExecState *, int token) const
00588 {
00589 switch (token) {
00590 case Key:
00591 return Number(static_cast<DOM::TextEvent>(event).keyVal());
00592 case VirtKey:
00593 return Number(static_cast<DOM::TextEvent>(event).virtKeyVal());
00594 case OutputString:
00595 return String(static_cast<DOM::TextEvent>(event).outputString());
00596 case InputGenerated:
00597 return Boolean(static_cast<DOM::TextEvent>(event).inputGenerated());
00598 case NumPad:
00599 return Boolean(static_cast<DOM::TextEvent>(event).numPad());
00600 default:
00601 kdWarning() << "Unhandled token in DOMTextEvent::getValueProperty : " << token << endl;
00602 return Value();
00603 }
00604 }
00605
00606 Value DOMTextEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
00607 {
00608 KJS_CHECK_THIS( KJS::DOMTextEvent, thisObj );
00609 DOM::TextEvent keyEvent = static_cast<DOMTextEvent *>(thisObj.imp())->toTextEvent();
00610 switch (id) {
00611 case DOMTextEvent::InitTextEvent:
00612 keyEvent.initTextEvent(args[0].toString(exec).string(),
00613 args[1].toBoolean(exec),
00614 args[2].toBoolean(exec),
00615 toAbstractView(args[3]),
00616 args[4].toInteger(exec),
00617 args[5].toString(exec).string(),
00618 args[6].toInteger(exec),
00619 args[7].toInteger(exec),
00620 args[8].toBoolean(exec),
00621 args[9].toBoolean(exec));
00622
00623 return Undefined();
00624 }
00625 return Undefined();
00626 }
00627
00628
00629
00630 const ClassInfo MutationEventConstructor::info = { "MutationEventConstructor", 0, &MutationEventConstructorTable, 0 };
00631
00632
00633
00634
00635
00636
00637
00638 MutationEventConstructor::MutationEventConstructor(ExecState* exec)
00639 : DOMObject(exec->interpreter()->builtinObjectPrototype())
00640 {
00641 }
00642
00643 Value MutationEventConstructor::tryGet(ExecState *exec, const UString &p) const
00644 {
00645 return DOMObjectLookupGetValue<MutationEventConstructor,DOMObject>(exec,p,&MutationEventConstructorTable,this);
00646 }
00647
00648 Value MutationEventConstructor::getValueProperty(ExecState *, int token) const
00649 {
00650
00651 return Number(token);
00652 }
00653
00654 Value KJS::getMutationEventConstructor(ExecState *exec)
00655 {
00656 return cacheGlobalObject<MutationEventConstructor>(exec, "[[mutationEvent.constructor]]");
00657 }
00658
00659
00660
00661 const ClassInfo DOMMutationEvent::info = { "MutationEvent", &DOMEvent::info, &DOMMutationEventTable, 0 };
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674 DEFINE_PROTOTYPE("DOMMutationEvent",DOMMutationEventProto)
00675 IMPLEMENT_PROTOFUNC_DOM(DOMMutationEventProtoFunc)
00676 IMPLEMENT_PROTOTYPE_WITH_PARENT(DOMMutationEventProto,DOMMutationEventProtoFunc,DOMEventProto)
00677
00678 DOMMutationEvent::~DOMMutationEvent()
00679 {
00680 }
00681
00682 Value DOMMutationEvent::tryGet(ExecState *exec, const UString &p) const
00683 {
00684 return DOMObjectLookupGetValue<DOMMutationEvent,DOMEvent>(exec,p,&DOMMutationEventTable,this);
00685 }
00686
00687 Value DOMMutationEvent::getValueProperty(ExecState *exec, int token) const
00688 {
00689 switch (token) {
00690 case RelatedNode:
00691 return getDOMNode(exec,static_cast<DOM::MutationEvent>(event).relatedNode());
00692 case PrevValue:
00693 return String(static_cast<DOM::MutationEvent>(event).prevValue());
00694 case NewValue:
00695 return String(static_cast<DOM::MutationEvent>(event).newValue());
00696 case AttrName:
00697 return String(static_cast<DOM::MutationEvent>(event).attrName());
00698 case AttrChange:
00699 return Number((unsigned int)static_cast<DOM::MutationEvent>(event).attrChange());
00700 default:
00701 kdWarning() << "Unhandled token in DOMMutationEvent::getValueProperty : " << token << endl;
00702 return Value();
00703 }
00704 }
00705
00706 Value DOMMutationEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
00707 {
00708 KJS_CHECK_THIS( KJS::DOMMutationEvent, thisObj );
00709 DOM::MutationEvent mutationEvent = static_cast<DOMMutationEvent *>(thisObj.imp())->toMutationEvent();
00710 switch (id) {
00711 case DOMMutationEvent::InitMutationEvent:
00712 mutationEvent.initMutationEvent(args[0].toString(exec).string(),
00713 args[1].toBoolean(exec),
00714 args[2].toBoolean(exec),
00715 toNode(args[3]),
00716 args[4].toString(exec).string(),
00717 args[5].toString(exec).string(),
00718 args[6].toString(exec).string(),
00719 args[7].toInteger(exec));
00720 return Undefined();
00721 }
00722 return Undefined();
00723 }