1 /*
   2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #undef IMPL
  27 
  28 #include "config.h"
  29 
  30 #include <WebCore/Attr.h>
  31 #include <WebCore/CDATASection.h>
  32 #include <WebCore/CSSStyleDeclaration.h>
  33 #include <WebCore/Comment.h>
  34 #include "DOMException.h"
  35 #include <WebCore/DOMImplementation.h>
  36 #include <WebCore/DOMWindow.h>
  37 #include <WebCore/Document.h>
  38 #include <WebCore/DocumentFragment.h>
  39 #include <WebCore/DocumentType.h>
  40 #include <WebCore/Element.h>
  41 #include <WebCore/Event.h>
  42 #include <WebCore/EventListener.h>
  43 #include <WebCore/HTMLCollection.h>
  44 #include <WebCore/HTMLElement.h>
  45 #include <WebCore/HTMLHeadElement.h>
  46 #include <WebCore/HTMLScriptElement.h>
  47 #include <WebCore/Node.h>
  48 #include <WebCore/NodeFilter.h>
  49 #include <WebCore/NodeIterator.h>
  50 #include <WebCore/NodeList.h>
  51 #include <WebCore/ProcessingInstruction.h>
  52 #include <WebCore/Range.h>
  53 #include <WebCore/StyleSheetList.h>
  54 #include <WebCore/Text.h>
  55 #include <WebCore/TreeWalker.h>
  56 #include <WebCore/XPathExpression.h>
  57 #include <WebCore/XPathNSResolver.h>
  58 #include <WebCore/XPathResult.h>
  59 #include <WebCore/EventNames.h>
  60 #include <WebCore/JSMainThreadExecState.h>
  61 
  62 #include <wtf/RefPtr.h>
  63 #include <wtf/GetPtr.h>
  64 
  65 #include "JavaDOMUtils.h"
  66 #include <wtf/java/JavaEnv.h>
  67 
  68 using namespace WebCore;
  69 
  70 extern "C" {
  71 
  72 #define IMPL (static_cast<Document*>(jlong_to_ptr(peer)))
  73 
  74 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_isHTMLDocumentImpl(JNIEnv*, jclass, jlong peer)
  75 {
  76     return IMPL->isHTMLDocument() || IMPL->isXHTMLDocument();
  77 }
  78 
  79 
  80 // Attributes
  81 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getDoctypeImpl(JNIEnv* env, jclass, jlong peer)
  82 {
  83     WebCore::JSMainThreadNullState state;
  84     return JavaReturn<DocumentType>(env, WTF::getPtr(IMPL->doctype()));
  85 }
  86 
  87 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getImplementationImpl(JNIEnv* env, jclass, jlong peer)
  88 {
  89     WebCore::JSMainThreadNullState state;
  90     return JavaReturn<DOMImplementation>(env, WTF::getPtr(IMPL->implementation()));
  91 }
  92 
  93 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getDocumentElementImpl(JNIEnv* env, jclass, jlong peer)
  94 {
  95     WebCore::JSMainThreadNullState state;
  96     return JavaReturn<Element>(env, WTF::getPtr(IMPL->documentElement()));
  97 }
  98 
  99 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getInputEncodingImpl(JNIEnv* env, jclass, jlong peer)
 100 {
 101     WebCore::JSMainThreadNullState state;
 102     return JavaReturn<String>(env, IMPL->characterSetWithUTF8Fallback());
 103 }
 104 
 105 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getXmlEncodingImpl(JNIEnv* env, jclass, jlong peer)
 106 {
 107     WebCore::JSMainThreadNullState state;
 108     return JavaReturn<String>(env, IMPL->xmlEncoding());
 109 }
 110 
 111 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getXmlVersionImpl(JNIEnv* env, jclass, jlong peer)
 112 {
 113     WebCore::JSMainThreadNullState state;
 114     return JavaReturn<String>(env, IMPL->xmlVersion());
 115 }
 116 
 117 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setXmlVersionImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 118 {
 119     WebCore::JSMainThreadNullState state;
 120     IMPL->setXMLVersion(String(env, value));
 121 }
 122 
 123 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_getXmlStandaloneImpl(JNIEnv*, jclass, jlong peer)
 124 {
 125     WebCore::JSMainThreadNullState state;
 126     return IMPL->xmlStandalone();
 127 }
 128 
 129 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setXmlStandaloneImpl(JNIEnv*, jclass, jlong peer, jboolean value)
 130 {
 131     WebCore::JSMainThreadNullState state;
 132     IMPL->setXMLStandalone(value);
 133 }
 134 
 135 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getDocumentURIImpl(JNIEnv* env, jclass, jlong peer)
 136 {
 137     WebCore::JSMainThreadNullState state;
 138     return JavaReturn<String>(env, IMPL->documentURI());
 139 }
 140 
 141 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setDocumentURIImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 142 {
 143     WebCore::JSMainThreadNullState state;
 144     IMPL->setDocumentURI(String(env, value));
 145 }
 146 
 147 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getDefaultViewImpl(JNIEnv* env, jclass, jlong peer)
 148 {
 149     WebCore::JSMainThreadNullState state;
 150     return JavaReturn<DOMWindow>(env, WTF::getPtr(IMPL->defaultView()));
 151 }
 152 
 153 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getStyleSheetsImpl(JNIEnv* env, jclass, jlong peer)
 154 {
 155     WebCore::JSMainThreadNullState state;
 156     return JavaReturn<StyleSheetList>(env, WTF::getPtr(IMPL->styleSheets()));
 157 }
 158 
 159 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getContentTypeImpl(JNIEnv* env, jclass, jlong peer)
 160 {
 161     WebCore::JSMainThreadNullState state;
 162     return JavaReturn<String>(env, IMPL->contentType());
 163 }
 164 
 165 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getTitleImpl(JNIEnv* env, jclass, jlong peer)
 166 {
 167     WebCore::JSMainThreadNullState state;
 168     return JavaReturn<String>(env, IMPL->title());
 169 }
 170 
 171 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setTitleImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 172 {
 173     WebCore::JSMainThreadNullState state;
 174     IMPL->setTitle(String(env, value));
 175 }
 176 
 177 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getReferrerImpl(JNIEnv* env, jclass, jlong peer)
 178 {
 179     WebCore::JSMainThreadNullState state;
 180     return JavaReturn<String>(env, IMPL->referrer());
 181 }
 182 
 183 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getDomainImpl(JNIEnv* env, jclass, jlong peer)
 184 {
 185     WebCore::JSMainThreadNullState state;
 186     return JavaReturn<String>(env, IMPL->domain());
 187 }
 188 
 189 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getURLImpl(JNIEnv* env, jclass, jlong peer)
 190 {
 191     WebCore::JSMainThreadNullState state;
 192     return JavaReturn<String>(env, IMPL->urlForBindings());
 193 }
 194 
 195 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getCookieImpl(JNIEnv* env, jclass, jlong peer)
 196 {
 197     WebCore::JSMainThreadNullState state;
 198     return JavaReturn<String>(env, raiseOnDOMError(env, IMPL->cookie()));
 199 }
 200 
 201 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setCookieImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 202 {
 203     WebCore::JSMainThreadNullState state;
 204     IMPL->setCookie(String(env, value));
 205 }
 206 
 207 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getBodyImpl(JNIEnv* env, jclass, jlong peer)
 208 {
 209     WebCore::JSMainThreadNullState state;
 210     return JavaReturn<HTMLElement>(env, WTF::getPtr(IMPL->bodyOrFrameset()));
 211 }
 212 
 213 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setBodyImpl(JNIEnv*, jclass, jlong peer, jlong value)
 214 {
 215     WebCore::JSMainThreadNullState state;
 216     IMPL->setBodyOrFrameset(static_cast<HTMLElement*>(jlong_to_ptr(value)));
 217 }
 218 
 219 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getHeadImpl(JNIEnv* env, jclass, jlong peer)
 220 {
 221     WebCore::JSMainThreadNullState state;
 222     return JavaReturn<HTMLHeadElement>(env, WTF::getPtr(IMPL->head()));
 223 }
 224 
 225 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getImagesImpl(JNIEnv* env, jclass, jlong peer)
 226 {
 227     WebCore::JSMainThreadNullState state;
 228     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->images()));
 229 }
 230 
 231 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getAppletsImpl(JNIEnv* env, jclass, jlong peer)
 232 {
 233     WebCore::JSMainThreadNullState state;
 234     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->applets()));
 235 }
 236 
 237 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getLinksImpl(JNIEnv* env, jclass, jlong peer)
 238 {
 239     WebCore::JSMainThreadNullState state;
 240     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->links()));
 241 }
 242 
 243 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getFormsImpl(JNIEnv* env, jclass, jlong peer)
 244 {
 245     WebCore::JSMainThreadNullState state;
 246     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->forms()));
 247 }
 248 
 249 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getAnchorsImpl(JNIEnv* env, jclass, jlong peer)
 250 {
 251     WebCore::JSMainThreadNullState state;
 252     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->anchors()));
 253 }
 254 
 255 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getLastModifiedImpl(JNIEnv* env, jclass, jlong peer)
 256 {
 257     WebCore::JSMainThreadNullState state;
 258     return JavaReturn<String>(env, IMPL->lastModified());
 259 }
 260 
 261 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getCharsetImpl(JNIEnv* env, jclass, jlong peer)
 262 {
 263     WebCore::JSMainThreadNullState state;
 264     return JavaReturn<String>(env, IMPL->characterSetWithUTF8Fallback());
 265 }
 266 
 267 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getDefaultCharsetImpl(JNIEnv* env, jclass, jlong peer)
 268 {
 269     WebCore::JSMainThreadNullState state;
 270     return JavaReturn<String>(env, IMPL->defaultCharsetForLegacyBindings());
 271 }
 272 
 273 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getReadyStateImpl(JNIEnv* env, jclass, jlong peer)
 274 {
 275     WebCore::JSMainThreadNullState state;
 276     auto readyState = IMPL->readyState();
 277     const char* readyStateStr;
 278     switch (readyState) {
 279     case WebCore::Document::Loading:
 280         readyStateStr = "loading";
 281         break;
 282     case WebCore::Document::Interactive:
 283         readyStateStr = "interactive";
 284         break;
 285     case WebCore::Document::Complete:
 286         readyStateStr = "complete";
 287         break;
 288     default:
 289         ASSERT_NOT_REACHED();
 290     }
 291     return JavaReturn<String>(env, String(readyStateStr));
 292 }
 293 
 294 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getCharacterSetImpl(JNIEnv* env, jclass, jlong peer)
 295 {
 296     WebCore::JSMainThreadNullState state;
 297     return JavaReturn<String>(env, IMPL->characterSetWithUTF8Fallback());
 298 }
 299 
 300 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getPreferredStylesheetSetImpl(JNIEnv* env, jclass, jlong peer)
 301 {
 302     WebCore::JSMainThreadNullState state;
 303     return JavaReturn<String>(env, IMPL->preferredStylesheetSet());
 304 }
 305 
 306 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getSelectedStylesheetSetImpl(JNIEnv* env, jclass, jlong peer)
 307 {
 308     WebCore::JSMainThreadNullState state;
 309     return JavaReturn<String>(env, IMPL->selectedStylesheetSet());
 310 }
 311 
 312 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setSelectedStylesheetSetImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 313 {
 314     WebCore::JSMainThreadNullState state;
 315     IMPL->setSelectedStylesheetSet(String(env, value));
 316 }
 317 
 318 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getActiveElementImpl(JNIEnv* env, jclass, jlong peer)
 319 {
 320     WebCore::JSMainThreadNullState state;
 321     return JavaReturn<Element>(env, WTF::getPtr(IMPL->activeElement()));
 322 }
 323 
 324 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getCompatModeImpl(JNIEnv* env, jclass, jlong peer)
 325 {
 326     WebCore::JSMainThreadNullState state;
 327     return JavaReturn<String>(env, IMPL->compatMode());
 328 }
 329 
 330 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_getWebkitIsFullScreenImpl(JNIEnv*, jclass, jlong peer)
 331 {
 332     WebCore::JSMainThreadNullState state;
 333     return IMPL->webkitIsFullScreen();
 334 }
 335 
 336 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_getWebkitFullScreenKeyboardInputAllowedImpl(JNIEnv*, jclass, jlong peer)
 337 {
 338     WebCore::JSMainThreadNullState state;
 339     return IMPL->webkitFullScreenKeyboardInputAllowed();
 340 }
 341 
 342 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getWebkitCurrentFullScreenElementImpl(JNIEnv* env, jclass, jlong peer)
 343 {
 344     WebCore::JSMainThreadNullState state;
 345     return JavaReturn<Element>(env, WTF::getPtr(IMPL->webkitCurrentFullScreenElement()));
 346 }
 347 
 348 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_getWebkitFullscreenEnabledImpl(JNIEnv*, jclass, jlong peer)
 349 {
 350     WebCore::JSMainThreadNullState state;
 351     return IMPL->webkitFullscreenEnabled();
 352 }
 353 
 354 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getWebkitFullscreenElementImpl(JNIEnv* env, jclass, jlong peer)
 355 {
 356     WebCore::JSMainThreadNullState state;
 357     return JavaReturn<Element>(env, WTF::getPtr(IMPL->webkitFullscreenElement()));
 358 }
 359 
 360 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getVisibilityStateImpl(JNIEnv* env, jclass, jlong peer)
 361 {
 362     const char* visibility {};
 363     switch (IMPL->visibilityState()) {
 364     case WebCore::VisibilityState::Hidden:
 365         visibility = "hidden";
 366         break;
 367     case WebCore::VisibilityState::Visible:
 368         visibility = "visible";
 369         break;
 370     case WebCore::VisibilityState::Prerender:
 371         visibility = "prerender";
 372         break;
 373     }
 374     return JavaReturn<String>(env, String(visibility));
 375 }
 376 
 377 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_getHiddenImpl(JNIEnv*, jclass, jlong peer)
 378 {
 379     WebCore::JSMainThreadNullState state;
 380     return IMPL->hidden();
 381 }
 382 
 383 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getCurrentScriptImpl(JNIEnv* env, jclass, jlong peer)
 384 {
 385     WebCore::JSMainThreadNullState state;
 386     return JavaReturn<HTMLScriptElement>(env, WTF::getPtr(IMPL->currentScript()));
 387 }
 388 
 389 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOriginImpl(JNIEnv* env, jclass, jlong peer)
 390 {
 391     WebCore::JSMainThreadNullState state;
 392     return JavaReturn<String>(env, IMPL->origin());
 393 }
 394 
 395 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getScrollingElementImpl(JNIEnv* env, jclass, jlong peer)
 396 {
 397     WebCore::JSMainThreadNullState state;
 398     return JavaReturn<Element>(env, WTF::getPtr(IMPL->scrollingElement()));
 399 }
 400 
 401 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnbeforecopyImpl(JNIEnv* env, jclass, jlong peer)
 402 {
 403     WebCore::JSMainThreadNullState state;
 404     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().beforecopyEvent, mainThreadNormalWorld())));
 405 }
 406 
 407 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnbeforecopyImpl(JNIEnv*, jclass, jlong peer, jlong value)
 408 {
 409     WebCore::JSMainThreadNullState state;
 410     IMPL->setAttributeEventListener(eventNames().beforecopyEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 411 }
 412 
 413 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnbeforecutImpl(JNIEnv* env, jclass, jlong peer)
 414 {
 415     WebCore::JSMainThreadNullState state;
 416     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().beforecutEvent, mainThreadNormalWorld())));
 417 }
 418 
 419 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnbeforecutImpl(JNIEnv*, jclass, jlong peer, jlong value)
 420 {
 421     WebCore::JSMainThreadNullState state;
 422     IMPL->setAttributeEventListener(eventNames().beforecutEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 423 }
 424 
 425 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnbeforepasteImpl(JNIEnv* env, jclass, jlong peer)
 426 {
 427     WebCore::JSMainThreadNullState state;
 428     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().beforepasteEvent, mainThreadNormalWorld())));
 429 }
 430 
 431 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnbeforepasteImpl(JNIEnv*, jclass, jlong peer, jlong value)
 432 {
 433     WebCore::JSMainThreadNullState state;
 434     IMPL->setAttributeEventListener(eventNames().beforepasteEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 435 }
 436 
 437 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOncopyImpl(JNIEnv* env, jclass, jlong peer)
 438 {
 439     WebCore::JSMainThreadNullState state;
 440     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().copyEvent, mainThreadNormalWorld())));
 441 }
 442 
 443 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOncopyImpl(JNIEnv*, jclass, jlong peer, jlong value)
 444 {
 445     WebCore::JSMainThreadNullState state;
 446     IMPL->setAttributeEventListener(eventNames().copyEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 447 }
 448 
 449 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOncutImpl(JNIEnv* env, jclass, jlong peer)
 450 {
 451     WebCore::JSMainThreadNullState state;
 452     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().cutEvent, mainThreadNormalWorld())));
 453 }
 454 
 455 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOncutImpl(JNIEnv*, jclass, jlong peer, jlong value)
 456 {
 457     WebCore::JSMainThreadNullState state;
 458     IMPL->setAttributeEventListener(eventNames().cutEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 459 }
 460 
 461 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnpasteImpl(JNIEnv* env, jclass, jlong peer)
 462 {
 463     WebCore::JSMainThreadNullState state;
 464     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().pasteEvent, mainThreadNormalWorld())));
 465 }
 466 
 467 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnpasteImpl(JNIEnv*, jclass, jlong peer, jlong value)
 468 {
 469     WebCore::JSMainThreadNullState state;
 470     IMPL->setAttributeEventListener(eventNames().pasteEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 471 }
 472 
 473 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnselectstartImpl(JNIEnv* env, jclass, jlong peer)
 474 {
 475     WebCore::JSMainThreadNullState state;
 476     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().selectstartEvent, mainThreadNormalWorld())));
 477 }
 478 
 479 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnselectstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 480 {
 481     WebCore::JSMainThreadNullState state;
 482     IMPL->setAttributeEventListener(eventNames().selectstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 483 }
 484 
 485 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnselectionchangeImpl(JNIEnv* env, jclass, jlong peer)
 486 {
 487     WebCore::JSMainThreadNullState state;
 488     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().selectionchangeEvent, mainThreadNormalWorld())));
 489 }
 490 
 491 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnselectionchangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 492 {
 493     WebCore::JSMainThreadNullState state;
 494     IMPL->setAttributeEventListener(eventNames().selectionchangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 495 }
 496 
 497 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnreadystatechangeImpl(JNIEnv* env, jclass, jlong peer)
 498 {
 499     WebCore::JSMainThreadNullState state;
 500     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().readystatechangeEvent, mainThreadNormalWorld())));
 501 }
 502 
 503 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnreadystatechangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 504 {
 505     WebCore::JSMainThreadNullState state;
 506     IMPL->setAttributeEventListener(eventNames().readystatechangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 507 }
 508 
 509 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnabortImpl(JNIEnv* env, jclass, jlong peer)
 510 {
 511     WebCore::JSMainThreadNullState state;
 512     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().abortEvent, mainThreadNormalWorld())));
 513 }
 514 
 515 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnabortImpl(JNIEnv*, jclass, jlong peer, jlong value)
 516 {
 517     WebCore::JSMainThreadNullState state;
 518     IMPL->setAttributeEventListener(eventNames().abortEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 519 }
 520 
 521 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnblurImpl(JNIEnv* env, jclass, jlong peer)
 522 {
 523     WebCore::JSMainThreadNullState state;
 524     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().blurEvent, mainThreadNormalWorld())));
 525 }
 526 
 527 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnblurImpl(JNIEnv*, jclass, jlong peer, jlong value)
 528 {
 529     WebCore::JSMainThreadNullState state;
 530     IMPL->setAttributeEventListener(eventNames().blurEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 531 }
 532 
 533 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOncanplayImpl(JNIEnv* env, jclass, jlong peer)
 534 {
 535     WebCore::JSMainThreadNullState state;
 536     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().canplayEvent, mainThreadNormalWorld())));
 537 }
 538 
 539 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOncanplayImpl(JNIEnv*, jclass, jlong peer, jlong value)
 540 {
 541     WebCore::JSMainThreadNullState state;
 542     IMPL->setAttributeEventListener(eventNames().canplayEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 543 }
 544 
 545 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOncanplaythroughImpl(JNIEnv* env, jclass, jlong peer)
 546 {
 547     WebCore::JSMainThreadNullState state;
 548     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().canplaythroughEvent, mainThreadNormalWorld())));
 549 }
 550 
 551 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOncanplaythroughImpl(JNIEnv*, jclass, jlong peer, jlong value)
 552 {
 553     WebCore::JSMainThreadNullState state;
 554     IMPL->setAttributeEventListener(eventNames().canplaythroughEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 555 }
 556 
 557 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnchangeImpl(JNIEnv* env, jclass, jlong peer)
 558 {
 559     WebCore::JSMainThreadNullState state;
 560     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().changeEvent, mainThreadNormalWorld())));
 561 }
 562 
 563 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnchangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 564 {
 565     WebCore::JSMainThreadNullState state;
 566     IMPL->setAttributeEventListener(eventNames().changeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 567 }
 568 
 569 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnclickImpl(JNIEnv* env, jclass, jlong peer)
 570 {
 571     WebCore::JSMainThreadNullState state;
 572     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().clickEvent, mainThreadNormalWorld())));
 573 }
 574 
 575 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnclickImpl(JNIEnv*, jclass, jlong peer, jlong value)
 576 {
 577     WebCore::JSMainThreadNullState state;
 578     IMPL->setAttributeEventListener(eventNames().clickEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 579 }
 580 
 581 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOncontextmenuImpl(JNIEnv* env, jclass, jlong peer)
 582 {
 583     WebCore::JSMainThreadNullState state;
 584     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().contextmenuEvent, mainThreadNormalWorld())));
 585 }
 586 
 587 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOncontextmenuImpl(JNIEnv*, jclass, jlong peer, jlong value)
 588 {
 589     WebCore::JSMainThreadNullState state;
 590     IMPL->setAttributeEventListener(eventNames().contextmenuEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 591 }
 592 
 593 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndblclickImpl(JNIEnv* env, jclass, jlong peer)
 594 {
 595     WebCore::JSMainThreadNullState state;
 596     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dblclickEvent, mainThreadNormalWorld())));
 597 }
 598 
 599 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndblclickImpl(JNIEnv*, jclass, jlong peer, jlong value)
 600 {
 601     WebCore::JSMainThreadNullState state;
 602     IMPL->setAttributeEventListener(eventNames().dblclickEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 603 }
 604 
 605 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndragImpl(JNIEnv* env, jclass, jlong peer)
 606 {
 607     WebCore::JSMainThreadNullState state;
 608     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragEvent, mainThreadNormalWorld())));
 609 }
 610 
 611 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndragImpl(JNIEnv*, jclass, jlong peer, jlong value)
 612 {
 613     WebCore::JSMainThreadNullState state;
 614     IMPL->setAttributeEventListener(eventNames().dragEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 615 }
 616 
 617 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndragendImpl(JNIEnv* env, jclass, jlong peer)
 618 {
 619     WebCore::JSMainThreadNullState state;
 620     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragendEvent, mainThreadNormalWorld())));
 621 }
 622 
 623 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndragendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 624 {
 625     WebCore::JSMainThreadNullState state;
 626     IMPL->setAttributeEventListener(eventNames().dragendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 627 }
 628 
 629 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndragenterImpl(JNIEnv* env, jclass, jlong peer)
 630 {
 631     WebCore::JSMainThreadNullState state;
 632     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragenterEvent, mainThreadNormalWorld())));
 633 }
 634 
 635 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndragenterImpl(JNIEnv*, jclass, jlong peer, jlong value)
 636 {
 637     WebCore::JSMainThreadNullState state;
 638     IMPL->setAttributeEventListener(eventNames().dragenterEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 639 }
 640 
 641 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndragleaveImpl(JNIEnv* env, jclass, jlong peer)
 642 {
 643     WebCore::JSMainThreadNullState state;
 644     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragleaveEvent, mainThreadNormalWorld())));
 645 }
 646 
 647 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndragleaveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 648 {
 649     WebCore::JSMainThreadNullState state;
 650     IMPL->setAttributeEventListener(eventNames().dragleaveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 651 }
 652 
 653 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndragoverImpl(JNIEnv* env, jclass, jlong peer)
 654 {
 655     WebCore::JSMainThreadNullState state;
 656     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragoverEvent, mainThreadNormalWorld())));
 657 }
 658 
 659 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndragoverImpl(JNIEnv*, jclass, jlong peer, jlong value)
 660 {
 661     WebCore::JSMainThreadNullState state;
 662     IMPL->setAttributeEventListener(eventNames().dragoverEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 663 }
 664 
 665 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndragstartImpl(JNIEnv* env, jclass, jlong peer)
 666 {
 667     WebCore::JSMainThreadNullState state;
 668     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragstartEvent, mainThreadNormalWorld())));
 669 }
 670 
 671 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndragstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 672 {
 673     WebCore::JSMainThreadNullState state;
 674     IMPL->setAttributeEventListener(eventNames().dragstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 675 }
 676 
 677 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndropImpl(JNIEnv* env, jclass, jlong peer)
 678 {
 679     WebCore::JSMainThreadNullState state;
 680     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dropEvent, mainThreadNormalWorld())));
 681 }
 682 
 683 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndropImpl(JNIEnv*, jclass, jlong peer, jlong value)
 684 {
 685     WebCore::JSMainThreadNullState state;
 686     IMPL->setAttributeEventListener(eventNames().dropEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 687 }
 688 
 689 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOndurationchangeImpl(JNIEnv* env, jclass, jlong peer)
 690 {
 691     WebCore::JSMainThreadNullState state;
 692     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().durationchangeEvent, mainThreadNormalWorld())));
 693 }
 694 
 695 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOndurationchangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 696 {
 697     WebCore::JSMainThreadNullState state;
 698     IMPL->setAttributeEventListener(eventNames().durationchangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 699 }
 700 
 701 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnemptiedImpl(JNIEnv* env, jclass, jlong peer)
 702 {
 703     WebCore::JSMainThreadNullState state;
 704     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().emptiedEvent, mainThreadNormalWorld())));
 705 }
 706 
 707 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnemptiedImpl(JNIEnv*, jclass, jlong peer, jlong value)
 708 {
 709     WebCore::JSMainThreadNullState state;
 710     IMPL->setAttributeEventListener(eventNames().emptiedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 711 }
 712 
 713 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnendedImpl(JNIEnv* env, jclass, jlong peer)
 714 {
 715     WebCore::JSMainThreadNullState state;
 716     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().endedEvent, mainThreadNormalWorld())));
 717 }
 718 
 719 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnendedImpl(JNIEnv*, jclass, jlong peer, jlong value)
 720 {
 721     WebCore::JSMainThreadNullState state;
 722     IMPL->setAttributeEventListener(eventNames().endedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 723 }
 724 
 725 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnerrorImpl(JNIEnv* env, jclass, jlong peer)
 726 {
 727     WebCore::JSMainThreadNullState state;
 728     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().errorEvent, mainThreadNormalWorld())));
 729 }
 730 
 731 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnerrorImpl(JNIEnv*, jclass, jlong peer, jlong value)
 732 {
 733     WebCore::JSMainThreadNullState state;
 734     IMPL->setAttributeEventListener(eventNames().errorEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 735 }
 736 
 737 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnfocusImpl(JNIEnv* env, jclass, jlong peer)
 738 {
 739     WebCore::JSMainThreadNullState state;
 740     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().focusEvent, mainThreadNormalWorld())));
 741 }
 742 
 743 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnfocusImpl(JNIEnv*, jclass, jlong peer, jlong value)
 744 {
 745     WebCore::JSMainThreadNullState state;
 746     IMPL->setAttributeEventListener(eventNames().focusEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 747 }
 748 
 749 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOninputImpl(JNIEnv* env, jclass, jlong peer)
 750 {
 751     WebCore::JSMainThreadNullState state;
 752     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().inputEvent, mainThreadNormalWorld())));
 753 }
 754 
 755 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOninputImpl(JNIEnv*, jclass, jlong peer, jlong value)
 756 {
 757     WebCore::JSMainThreadNullState state;
 758     IMPL->setAttributeEventListener(eventNames().inputEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 759 }
 760 
 761 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOninvalidImpl(JNIEnv* env, jclass, jlong peer)
 762 {
 763     WebCore::JSMainThreadNullState state;
 764     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().invalidEvent, mainThreadNormalWorld())));
 765 }
 766 
 767 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOninvalidImpl(JNIEnv*, jclass, jlong peer, jlong value)
 768 {
 769     WebCore::JSMainThreadNullState state;
 770     IMPL->setAttributeEventListener(eventNames().invalidEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 771 }
 772 
 773 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnkeydownImpl(JNIEnv* env, jclass, jlong peer)
 774 {
 775     WebCore::JSMainThreadNullState state;
 776     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keydownEvent, mainThreadNormalWorld())));
 777 }
 778 
 779 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnkeydownImpl(JNIEnv*, jclass, jlong peer, jlong value)
 780 {
 781     WebCore::JSMainThreadNullState state;
 782     IMPL->setAttributeEventListener(eventNames().keydownEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 783 }
 784 
 785 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnkeypressImpl(JNIEnv* env, jclass, jlong peer)
 786 {
 787     WebCore::JSMainThreadNullState state;
 788     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keypressEvent, mainThreadNormalWorld())));
 789 }
 790 
 791 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnkeypressImpl(JNIEnv*, jclass, jlong peer, jlong value)
 792 {
 793     WebCore::JSMainThreadNullState state;
 794     IMPL->setAttributeEventListener(eventNames().keypressEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 795 }
 796 
 797 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnkeyupImpl(JNIEnv* env, jclass, jlong peer)
 798 {
 799     WebCore::JSMainThreadNullState state;
 800     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keyupEvent, mainThreadNormalWorld())));
 801 }
 802 
 803 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnkeyupImpl(JNIEnv*, jclass, jlong peer, jlong value)
 804 {
 805     WebCore::JSMainThreadNullState state;
 806     IMPL->setAttributeEventListener(eventNames().keyupEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 807 }
 808 
 809 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnloadImpl(JNIEnv* env, jclass, jlong peer)
 810 {
 811     WebCore::JSMainThreadNullState state;
 812     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadEvent, mainThreadNormalWorld())));
 813 }
 814 
 815 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnloadImpl(JNIEnv*, jclass, jlong peer, jlong value)
 816 {
 817     WebCore::JSMainThreadNullState state;
 818     IMPL->setAttributeEventListener(eventNames().loadEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 819 }
 820 
 821 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnloadeddataImpl(JNIEnv* env, jclass, jlong peer)
 822 {
 823     WebCore::JSMainThreadNullState state;
 824     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadeddataEvent, mainThreadNormalWorld())));
 825 }
 826 
 827 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnloadeddataImpl(JNIEnv*, jclass, jlong peer, jlong value)
 828 {
 829     WebCore::JSMainThreadNullState state;
 830     IMPL->setAttributeEventListener(eventNames().loadeddataEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 831 }
 832 
 833 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnloadedmetadataImpl(JNIEnv* env, jclass, jlong peer)
 834 {
 835     WebCore::JSMainThreadNullState state;
 836     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadedmetadataEvent, mainThreadNormalWorld())));
 837 }
 838 
 839 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnloadedmetadataImpl(JNIEnv*, jclass, jlong peer, jlong value)
 840 {
 841     WebCore::JSMainThreadNullState state;
 842     IMPL->setAttributeEventListener(eventNames().loadedmetadataEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 843 }
 844 
 845 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnloadstartImpl(JNIEnv* env, jclass, jlong peer)
 846 {
 847     WebCore::JSMainThreadNullState state;
 848     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadstartEvent, mainThreadNormalWorld())));
 849 }
 850 
 851 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnloadstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 852 {
 853     WebCore::JSMainThreadNullState state;
 854     IMPL->setAttributeEventListener(eventNames().loadstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 855 }
 856 
 857 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnmousedownImpl(JNIEnv* env, jclass, jlong peer)
 858 {
 859     WebCore::JSMainThreadNullState state;
 860     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousedownEvent, mainThreadNormalWorld())));
 861 }
 862 
 863 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnmousedownImpl(JNIEnv*, jclass, jlong peer, jlong value)
 864 {
 865     WebCore::JSMainThreadNullState state;
 866     IMPL->setAttributeEventListener(eventNames().mousedownEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 867 }
 868 
 869 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnmouseenterImpl(JNIEnv* env, jclass, jlong peer)
 870 {
 871     WebCore::JSMainThreadNullState state;
 872     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseenterEvent, mainThreadNormalWorld())));
 873 }
 874 
 875 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnmouseenterImpl(JNIEnv*, jclass, jlong peer, jlong value)
 876 {
 877     WebCore::JSMainThreadNullState state;
 878     IMPL->setAttributeEventListener(eventNames().mouseenterEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 879 }
 880 
 881 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnmouseleaveImpl(JNIEnv* env, jclass, jlong peer)
 882 {
 883     WebCore::JSMainThreadNullState state;
 884     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseleaveEvent, mainThreadNormalWorld())));
 885 }
 886 
 887 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnmouseleaveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 888 {
 889     WebCore::JSMainThreadNullState state;
 890     IMPL->setAttributeEventListener(eventNames().mouseleaveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 891 }
 892 
 893 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnmousemoveImpl(JNIEnv* env, jclass, jlong peer)
 894 {
 895     WebCore::JSMainThreadNullState state;
 896     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousemoveEvent, mainThreadNormalWorld())));
 897 }
 898 
 899 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnmousemoveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 900 {
 901     WebCore::JSMainThreadNullState state;
 902     IMPL->setAttributeEventListener(eventNames().mousemoveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 903 }
 904 
 905 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnmouseoutImpl(JNIEnv* env, jclass, jlong peer)
 906 {
 907     WebCore::JSMainThreadNullState state;
 908     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseoutEvent, mainThreadNormalWorld())));
 909 }
 910 
 911 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnmouseoutImpl(JNIEnv*, jclass, jlong peer, jlong value)
 912 {
 913     WebCore::JSMainThreadNullState state;
 914     IMPL->setAttributeEventListener(eventNames().mouseoutEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 915 }
 916 
 917 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnmouseoverImpl(JNIEnv* env, jclass, jlong peer)
 918 {
 919     WebCore::JSMainThreadNullState state;
 920     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseoverEvent, mainThreadNormalWorld())));
 921 }
 922 
 923 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnmouseoverImpl(JNIEnv*, jclass, jlong peer, jlong value)
 924 {
 925     WebCore::JSMainThreadNullState state;
 926     IMPL->setAttributeEventListener(eventNames().mouseoverEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 927 }
 928 
 929 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnmouseupImpl(JNIEnv* env, jclass, jlong peer)
 930 {
 931     WebCore::JSMainThreadNullState state;
 932     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseupEvent, mainThreadNormalWorld())));
 933 }
 934 
 935 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnmouseupImpl(JNIEnv*, jclass, jlong peer, jlong value)
 936 {
 937     WebCore::JSMainThreadNullState state;
 938     IMPL->setAttributeEventListener(eventNames().mouseupEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 939 }
 940 
 941 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnmousewheelImpl(JNIEnv* env, jclass, jlong peer)
 942 {
 943     WebCore::JSMainThreadNullState state;
 944     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousewheelEvent, mainThreadNormalWorld())));
 945 }
 946 
 947 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnmousewheelImpl(JNIEnv*, jclass, jlong peer, jlong value)
 948 {
 949     WebCore::JSMainThreadNullState state;
 950     IMPL->setAttributeEventListener(eventNames().mousewheelEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 951 }
 952 
 953 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnpauseImpl(JNIEnv* env, jclass, jlong peer)
 954 {
 955     WebCore::JSMainThreadNullState state;
 956     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().pauseEvent, mainThreadNormalWorld())));
 957 }
 958 
 959 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnpauseImpl(JNIEnv*, jclass, jlong peer, jlong value)
 960 {
 961     WebCore::JSMainThreadNullState state;
 962     IMPL->setAttributeEventListener(eventNames().pauseEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 963 }
 964 
 965 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnplayImpl(JNIEnv* env, jclass, jlong peer)
 966 {
 967     WebCore::JSMainThreadNullState state;
 968     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().playEvent, mainThreadNormalWorld())));
 969 }
 970 
 971 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnplayImpl(JNIEnv*, jclass, jlong peer, jlong value)
 972 {
 973     WebCore::JSMainThreadNullState state;
 974     IMPL->setAttributeEventListener(eventNames().playEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 975 }
 976 
 977 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnplayingImpl(JNIEnv* env, jclass, jlong peer)
 978 {
 979     WebCore::JSMainThreadNullState state;
 980     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().playingEvent, mainThreadNormalWorld())));
 981 }
 982 
 983 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnplayingImpl(JNIEnv*, jclass, jlong peer, jlong value)
 984 {
 985     WebCore::JSMainThreadNullState state;
 986     IMPL->setAttributeEventListener(eventNames().playingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 987 }
 988 
 989 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnprogressImpl(JNIEnv* env, jclass, jlong peer)
 990 {
 991     WebCore::JSMainThreadNullState state;
 992     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().progressEvent, mainThreadNormalWorld())));
 993 }
 994 
 995 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnprogressImpl(JNIEnv*, jclass, jlong peer, jlong value)
 996 {
 997     WebCore::JSMainThreadNullState state;
 998     IMPL->setAttributeEventListener(eventNames().progressEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 999 }
1000 
1001 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnratechangeImpl(JNIEnv* env, jclass, jlong peer)
1002 {
1003     WebCore::JSMainThreadNullState state;
1004     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().ratechangeEvent, mainThreadNormalWorld())));
1005 }
1006 
1007 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnratechangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
1008 {
1009     WebCore::JSMainThreadNullState state;
1010     IMPL->setAttributeEventListener(eventNames().ratechangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1011 }
1012 
1013 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnresetImpl(JNIEnv* env, jclass, jlong peer)
1014 {
1015     WebCore::JSMainThreadNullState state;
1016     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().resetEvent, mainThreadNormalWorld())));
1017 }
1018 
1019 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnresetImpl(JNIEnv*, jclass, jlong peer, jlong value)
1020 {
1021     WebCore::JSMainThreadNullState state;
1022     IMPL->setAttributeEventListener(eventNames().resetEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1023 }
1024 
1025 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnresizeImpl(JNIEnv* env, jclass, jlong peer)
1026 {
1027     WebCore::JSMainThreadNullState state;
1028     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().resizeEvent, mainThreadNormalWorld())));
1029 }
1030 
1031 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnresizeImpl(JNIEnv*, jclass, jlong peer, jlong value)
1032 {
1033     WebCore::JSMainThreadNullState state;
1034     IMPL->setAttributeEventListener(eventNames().resizeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1035 }
1036 
1037 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnscrollImpl(JNIEnv* env, jclass, jlong peer)
1038 {
1039     WebCore::JSMainThreadNullState state;
1040     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().scrollEvent, mainThreadNormalWorld())));
1041 }
1042 
1043 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnscrollImpl(JNIEnv*, jclass, jlong peer, jlong value)
1044 {
1045     WebCore::JSMainThreadNullState state;
1046     IMPL->setAttributeEventListener(eventNames().scrollEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1047 }
1048 
1049 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnseekedImpl(JNIEnv* env, jclass, jlong peer)
1050 {
1051     WebCore::JSMainThreadNullState state;
1052     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().seekedEvent, mainThreadNormalWorld())));
1053 }
1054 
1055 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnseekedImpl(JNIEnv*, jclass, jlong peer, jlong value)
1056 {
1057     WebCore::JSMainThreadNullState state;
1058     IMPL->setAttributeEventListener(eventNames().seekedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1059 }
1060 
1061 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnseekingImpl(JNIEnv* env, jclass, jlong peer)
1062 {
1063     WebCore::JSMainThreadNullState state;
1064     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().seekingEvent, mainThreadNormalWorld())));
1065 }
1066 
1067 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnseekingImpl(JNIEnv*, jclass, jlong peer, jlong value)
1068 {
1069     WebCore::JSMainThreadNullState state;
1070     IMPL->setAttributeEventListener(eventNames().seekingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1071 }
1072 
1073 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnselectImpl(JNIEnv* env, jclass, jlong peer)
1074 {
1075     WebCore::JSMainThreadNullState state;
1076     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().selectEvent, mainThreadNormalWorld())));
1077 }
1078 
1079 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnselectImpl(JNIEnv*, jclass, jlong peer, jlong value)
1080 {
1081     WebCore::JSMainThreadNullState state;
1082     IMPL->setAttributeEventListener(eventNames().selectEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1083 }
1084 
1085 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnstalledImpl(JNIEnv* env, jclass, jlong peer)
1086 {
1087     WebCore::JSMainThreadNullState state;
1088     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().stalledEvent, mainThreadNormalWorld())));
1089 }
1090 
1091 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnstalledImpl(JNIEnv*, jclass, jlong peer, jlong value)
1092 {
1093     WebCore::JSMainThreadNullState state;
1094     IMPL->setAttributeEventListener(eventNames().stalledEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1095 }
1096 
1097 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnsubmitImpl(JNIEnv* env, jclass, jlong peer)
1098 {
1099     WebCore::JSMainThreadNullState state;
1100     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().submitEvent, mainThreadNormalWorld())));
1101 }
1102 
1103 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnsubmitImpl(JNIEnv*, jclass, jlong peer, jlong value)
1104 {
1105     WebCore::JSMainThreadNullState state;
1106     IMPL->setAttributeEventListener(eventNames().submitEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1107 }
1108 
1109 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnsuspendImpl(JNIEnv* env, jclass, jlong peer)
1110 {
1111     WebCore::JSMainThreadNullState state;
1112     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().suspendEvent, mainThreadNormalWorld())));
1113 }
1114 
1115 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnsuspendImpl(JNIEnv*, jclass, jlong peer, jlong value)
1116 {
1117     WebCore::JSMainThreadNullState state;
1118     IMPL->setAttributeEventListener(eventNames().suspendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1119 }
1120 
1121 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOntimeupdateImpl(JNIEnv* env, jclass, jlong peer)
1122 {
1123     WebCore::JSMainThreadNullState state;
1124     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().timeupdateEvent, mainThreadNormalWorld())));
1125 }
1126 
1127 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOntimeupdateImpl(JNIEnv*, jclass, jlong peer, jlong value)
1128 {
1129     WebCore::JSMainThreadNullState state;
1130     IMPL->setAttributeEventListener(eventNames().timeupdateEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1131 }
1132 
1133 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnvolumechangeImpl(JNIEnv* env, jclass, jlong peer)
1134 {
1135     WebCore::JSMainThreadNullState state;
1136     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().volumechangeEvent, mainThreadNormalWorld())));
1137 }
1138 
1139 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnvolumechangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
1140 {
1141     WebCore::JSMainThreadNullState state;
1142     IMPL->setAttributeEventListener(eventNames().volumechangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1143 }
1144 
1145 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnwaitingImpl(JNIEnv* env, jclass, jlong peer)
1146 {
1147     WebCore::JSMainThreadNullState state;
1148     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().waitingEvent, mainThreadNormalWorld())));
1149 }
1150 
1151 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnwaitingImpl(JNIEnv*, jclass, jlong peer, jlong value)
1152 {
1153     WebCore::JSMainThreadNullState state;
1154     IMPL->setAttributeEventListener(eventNames().waitingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1155 }
1156 
1157 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnsearchImpl(JNIEnv* env, jclass, jlong peer)
1158 {
1159     WebCore::JSMainThreadNullState state;
1160     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().searchEvent, mainThreadNormalWorld())));
1161 }
1162 
1163 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnsearchImpl(JNIEnv*, jclass, jlong peer, jlong value)
1164 {
1165     WebCore::JSMainThreadNullState state;
1166     IMPL->setAttributeEventListener(eventNames().searchEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1167 }
1168 
1169 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOnwheelImpl(JNIEnv* env, jclass, jlong peer)
1170 {
1171     WebCore::JSMainThreadNullState state;
1172     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().wheelEvent, mainThreadNormalWorld())));
1173 }
1174 
1175 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_setOnwheelImpl(JNIEnv*, jclass, jlong peer, jlong value)
1176 {
1177     WebCore::JSMainThreadNullState state;
1178     IMPL->setAttributeEventListener(eventNames().wheelEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1179 }
1180 
1181 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getChildrenImpl(JNIEnv* env, jclass, jlong peer)
1182 {
1183     WebCore::JSMainThreadNullState state;
1184     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->children()));
1185 }
1186 
1187 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getFirstElementChildImpl(JNIEnv* env, jclass, jlong peer)
1188 {
1189     WebCore::JSMainThreadNullState state;
1190     return JavaReturn<Element>(env, WTF::getPtr(IMPL->firstElementChild()));
1191 }
1192 
1193 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getLastElementChildImpl(JNIEnv* env, jclass, jlong peer)
1194 {
1195     WebCore::JSMainThreadNullState state;
1196     return JavaReturn<Element>(env, WTF::getPtr(IMPL->lastElementChild()));
1197 }
1198 
1199 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DocumentImpl_getChildElementCountImpl(JNIEnv*, jclass, jlong peer)
1200 {
1201     WebCore::JSMainThreadNullState state;
1202     return IMPL->childElementCount();
1203 }
1204 
1205 
1206 // Functions
1207 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createElementImpl(JNIEnv* env, jclass, jlong peer
1208     , jstring tagName)
1209 {
1210     WebCore::JSMainThreadNullState state;
1211     return JavaReturn<Element>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createElementForBindings(String(env, tagName)))));
1212 }
1213 
1214 
1215 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createDocumentFragmentImpl(JNIEnv* env, jclass, jlong peer)
1216 {
1217     WebCore::JSMainThreadNullState state;
1218     return JavaReturn<DocumentFragment>(env, WTF::getPtr(IMPL->createDocumentFragment()));
1219 }
1220 
1221 
1222 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createTextNodeImpl(JNIEnv* env, jclass, jlong peer
1223     , jstring data)
1224 {
1225     WebCore::JSMainThreadNullState state;
1226     return JavaReturn<Text>(env, WTF::getPtr(IMPL->createTextNode(String(env, data))));
1227 }
1228 
1229 
1230 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createCommentImpl(JNIEnv* env, jclass, jlong peer
1231     , jstring data)
1232 {
1233     WebCore::JSMainThreadNullState state;
1234     return JavaReturn<Comment>(env, WTF::getPtr(IMPL->createComment(String(env, data))));
1235 }
1236 
1237 
1238 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createCDATASectionImpl(JNIEnv* env, jclass, jlong peer
1239     , jstring data)
1240 {
1241     WebCore::JSMainThreadNullState state;
1242     return JavaReturn<CDATASection>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createCDATASection(String(env, data)))));
1243 }
1244 
1245 
1246 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createProcessingInstructionImpl(JNIEnv* env, jclass, jlong peer
1247     , jstring target
1248     , jstring data)
1249 {
1250     WebCore::JSMainThreadNullState state;
1251     return JavaReturn<ProcessingInstruction>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createProcessingInstruction(String(env, target)
1252             , String(env, data)))));
1253 }
1254 
1255 
1256 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createAttributeImpl(JNIEnv* env, jclass, jlong peer
1257     , jstring name)
1258 {
1259     WebCore::JSMainThreadNullState state;
1260     return JavaReturn<Attr>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createAttribute(String(env, name)))));
1261 }
1262 
1263 
1264 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createEntityReferenceImpl(JNIEnv* env, jclass, jlong, jstring)
1265 {
1266     raiseNotSupportedErrorException(env);
1267     return {};
1268 }
1269 
1270 
1271 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getElementsByTagNameImpl(JNIEnv* env, jclass, jlong peer
1272     , jstring tagname)
1273 {
1274     WebCore::JSMainThreadNullState state;
1275     return JavaReturn<NodeList>(env, WTF::getPtr(IMPL->getElementsByTagName(String(env, tagname))));
1276 }
1277 
1278 
1279 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_importNodeImpl(JNIEnv* env, jclass, jlong peer
1280     , jlong importedNode
1281     , jboolean deep)
1282 {
1283     WebCore::JSMainThreadNullState state;
1284     if (!importedNode) {
1285         raiseTypeErrorException(env);
1286         return 0;
1287     }
1288 
1289     return JavaReturn<Node>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->importNode(*static_cast<Node*>(jlong_to_ptr(importedNode))
1290             , deep))));
1291 }
1292 
1293 
1294 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createElementNSImpl(JNIEnv* env, jclass, jlong peer
1295     , jstring namespaceURI
1296     , jstring qualifiedName)
1297 {
1298     WebCore::JSMainThreadNullState state;
1299     return JavaReturn<Element>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createElementNS(String(env, namespaceURI)
1300             , String(env, qualifiedName)))));
1301 }
1302 
1303 
1304 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createAttributeNSImpl(JNIEnv* env, jclass, jlong peer
1305     , jstring namespaceURI
1306     , jstring qualifiedName)
1307 {
1308     WebCore::JSMainThreadNullState state;
1309     return JavaReturn<Attr>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createAttributeNS(String(env, namespaceURI)
1310             , String(env, qualifiedName)))));
1311 }
1312 
1313 
1314 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getElementsByTagNameNSImpl(JNIEnv* env, jclass, jlong peer
1315     , jstring namespaceURI
1316     , jstring localName)
1317 {
1318     WebCore::JSMainThreadNullState state;
1319     return JavaReturn<NodeList>(env, WTF::getPtr(IMPL->getElementsByTagNameNS(String(env, namespaceURI)
1320             , String(env, localName))));
1321 }
1322 
1323 
1324 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_adoptNodeImpl(JNIEnv* env, jclass, jlong peer
1325     , jlong source)
1326 {
1327     WebCore::JSMainThreadNullState state;
1328     if (!source) {
1329         raiseTypeErrorException(env);
1330         return 0;
1331     }
1332 
1333     return JavaReturn<Node>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->adoptNode(*static_cast<Node*>(jlong_to_ptr(source))))));
1334 }
1335 
1336 
1337 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createEventImpl(JNIEnv* env, jclass, jlong peer
1338     , jstring eventType)
1339 {
1340     WebCore::JSMainThreadNullState state;
1341     return JavaReturn<Event>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createEvent(String(env, eventType)))));
1342 }
1343 
1344 
1345 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createRangeImpl(JNIEnv* env, jclass, jlong peer)
1346 {
1347     WebCore::JSMainThreadNullState state;
1348     return JavaReturn<Range>(env, WTF::getPtr(IMPL->createRange()));
1349 }
1350 
1351 
1352 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createNodeIteratorImpl(JNIEnv*, jclass, jlong
1353     , jlong
1354     , jint
1355     , jlong
1356     , jboolean)
1357 {
1358 #if 0
1359     WebCore::JSMainThreadNullState state;
1360     return JavaReturn<NodeIterator>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createNodeIterator(static_cast<Node*>(jlong_to_ptr(root))
1361             , whatToShow
1362             , static_cast<NodeFilter*>(jlong_to_ptr(filter))
1363             , expandEntityReferences))));
1364 #endif
1365     return 0L;
1366 }
1367 
1368 
1369 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createTreeWalkerImpl(JNIEnv*, jclass, jlong
1370     , jlong
1371     , jint
1372     , jlong
1373     , jboolean)
1374 {
1375 #if 0
1376     WebCore::JSMainThreadNullState state;
1377     if (!root) {
1378         raiseTypeErrorException(env);
1379         return 0;
1380     }
1381 
1382     RefPtr<WebCore::NodeFilter> nativeNodeFilter;
1383     if (filter)
1384         nativeNodeFilter = WebCore::NativeNodeFilter::create(WebCore::ObjCNodeFilterCondition::create(filter));
1385     return JavaReturn<TreeWalker>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createTreeWalker(static_cast<Node*>(jlong_to_ptr(root))
1386             , whatToShow
1387             , static_cast<NodeFilter*>(jlong_to_ptr(filter))
1388             , expandEntityReferences))));
1389 #endif
1390     return 0L;
1391 }
1392 
1393 
1394 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getOverrideStyleImpl(JNIEnv*, jclass, jlong
1395     , jlong
1396     , jstring)
1397 {
1398 #if 0
1399     WebCore::JSMainThreadNullState state;
1400     return JavaReturn<CSSStyleDeclaration>(env, WTF::getPtr(IMPL->getOverrideStyle(static_cast<Element*>(jlong_to_ptr(element))
1401             , String(env, pseudoElement))));
1402 #endif
1403     return 0L;
1404 }
1405 
1406 
1407 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createExpressionImpl(JNIEnv* env, jclass, jlong peer
1408     , jstring expression
1409     , jlong resolver)
1410 {
1411     WebCore::JSMainThreadNullState state;
1412     return JavaReturn<XPathExpression>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->createExpression(String(env, expression)
1413             , static_cast<XPathNSResolver*>(jlong_to_ptr(resolver))))));
1414 }
1415 
1416 
1417 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createNSResolverImpl(JNIEnv* env, jclass, jlong peer
1418     , jlong nodeResolver)
1419 {
1420     WebCore::JSMainThreadNullState state;
1421     return JavaReturn<XPathNSResolver>(env, WTF::getPtr(IMPL->createNSResolver(static_cast<Node*>(jlong_to_ptr(nodeResolver)))));
1422 }
1423 
1424 
1425 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_evaluateImpl(JNIEnv* env, jclass, jlong peer
1426     , jstring expression
1427     , jlong contextNode
1428     , jlong resolver
1429     , jshort type
1430     , jlong inResult)
1431 {
1432     WebCore::JSMainThreadNullState state;
1433     return JavaReturn<XPathResult>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->evaluate(String(env, expression)
1434             , static_cast<Node*>(jlong_to_ptr(contextNode))
1435             , static_cast<XPathNSResolver*>(jlong_to_ptr(resolver))
1436             , type
1437             , static_cast<XPathResult*>(jlong_to_ptr(inResult))))));
1438 }
1439 
1440 
1441 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_execCommandImpl(JNIEnv* env, jclass, jlong peer
1442     , jstring command
1443     , jboolean userInterface
1444     , jstring value)
1445 {
1446     WebCore::JSMainThreadNullState state;
1447     return IMPL->execCommand(String(env, command)
1448             , userInterface
1449             , String(env, value));
1450 }
1451 
1452 
1453 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_queryCommandEnabledImpl(JNIEnv* env, jclass, jlong peer
1454     , jstring command)
1455 {
1456     WebCore::JSMainThreadNullState state;
1457     return IMPL->queryCommandEnabled(String(env, command));
1458 }
1459 
1460 
1461 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_queryCommandIndetermImpl(JNIEnv* env, jclass, jlong peer
1462     , jstring command)
1463 {
1464     WebCore::JSMainThreadNullState state;
1465     return IMPL->queryCommandIndeterm(String(env, command));
1466 }
1467 
1468 
1469 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_queryCommandStateImpl(JNIEnv* env, jclass, jlong peer
1470     , jstring command)
1471 {
1472     WebCore::JSMainThreadNullState state;
1473     return IMPL->queryCommandState(String(env, command));
1474 }
1475 
1476 
1477 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_queryCommandSupportedImpl(JNIEnv* env, jclass, jlong peer
1478     , jstring command)
1479 {
1480     WebCore::JSMainThreadNullState state;
1481     return IMPL->queryCommandSupported(String(env, command));
1482 }
1483 
1484 
1485 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DocumentImpl_queryCommandValueImpl(JNIEnv* env, jclass, jlong peer
1486     , jstring command)
1487 {
1488     WebCore::JSMainThreadNullState state;
1489     return JavaReturn<String>(env, IMPL->queryCommandValue(String(env, command)));
1490 }
1491 
1492 
1493 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getElementsByNameImpl(JNIEnv* env, jclass, jlong peer
1494     , jstring elementName)
1495 {
1496     WebCore::JSMainThreadNullState state;
1497     return JavaReturn<NodeList>(env, WTF::getPtr(IMPL->getElementsByName(String(env, elementName))));
1498 }
1499 
1500 
1501 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_elementFromPointImpl(JNIEnv* env, jclass, jlong peer
1502     , jint x
1503     , jint y)
1504 {
1505     WebCore::JSMainThreadNullState state;
1506     return JavaReturn<Element>(env, WTF::getPtr(IMPL->elementFromPoint(x
1507             , y)));
1508 }
1509 
1510 
1511 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_caretRangeFromPointImpl(JNIEnv* env, jclass, jlong peer
1512     , jint x
1513     , jint y)
1514 {
1515     WebCore::JSMainThreadNullState state;
1516     return JavaReturn<Range>(env, WTF::getPtr(IMPL->caretRangeFromPoint(x
1517             , y)));
1518 }
1519 
1520 
1521 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_createCSSStyleDeclarationImpl(JNIEnv* env, jclass, jlong peer)
1522 {
1523     WebCore::JSMainThreadNullState state;
1524     return JavaReturn<CSSStyleDeclaration>(env, WTF::getPtr(IMPL->createCSSStyleDeclaration()));
1525 }
1526 
1527 
1528 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getElementsByClassNameImpl(JNIEnv* env, jclass, jlong peer
1529     , jstring classNames)
1530 {
1531     WebCore::JSMainThreadNullState state;
1532     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->getElementsByClassName(String(env, classNames))));
1533 }
1534 
1535 
1536 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DocumentImpl_hasFocusImpl(JNIEnv*, jclass, jlong peer)
1537 {
1538     WebCore::JSMainThreadNullState state;
1539     return IMPL->hasFocus();
1540 }
1541 
1542 
1543 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_webkitCancelFullScreenImpl(JNIEnv*, jclass, jlong peer)
1544 {
1545     WebCore::JSMainThreadNullState state;
1546     IMPL->webkitCancelFullScreen();
1547 }
1548 
1549 
1550 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DocumentImpl_webkitExitFullscreenImpl(JNIEnv*, jclass, jlong peer)
1551 {
1552     WebCore::JSMainThreadNullState state;
1553     IMPL->webkitExitFullscreen();
1554 }
1555 
1556 
1557 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_getElementByIdImpl(JNIEnv* env, jclass, jlong peer
1558     , jstring elementId)
1559 {
1560     WebCore::JSMainThreadNullState state;
1561     return JavaReturn<Element>(env, WTF::getPtr(IMPL->getElementById(String(env, elementId))));
1562 }
1563 
1564 
1565 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_querySelectorImpl(JNIEnv* env, jclass, jlong peer
1566     , jstring selectors)
1567 {
1568     WebCore::JSMainThreadNullState state;
1569     return JavaReturn<Element>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->querySelector(String(env, selectors)))));
1570 }
1571 
1572 
1573 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DocumentImpl_querySelectorAllImpl(JNIEnv* env, jclass, jlong peer
1574     , jstring selectors)
1575 {
1576     WebCore::JSMainThreadNullState state;
1577     return JavaReturn<NodeList>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->querySelectorAll(String(env, selectors)))));
1578 }
1579 
1580 
1581 }