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/CSSStyleDeclaration.h>
  32 #include "DOMException.h"
  33 #include <WebCore/Element.h>
  34 #include <WebCore/EventListener.h>
  35 #include <WebCore/HTMLCollection.h>
  36 #include <WebCore/HTMLNames.h>
  37 #include <WebCore/NamedNodeMap.h>
  38 #include <WebCore/NodeList.h>
  39 #include <WebCore/EventNames.h>
  40 #include <WebCore/StyledElement.h>
  41 #include <WebCore/JSMainThreadExecState.h>
  42 
  43 #include <wtf/RefPtr.h>
  44 #include <wtf/GetPtr.h>
  45 
  46 #include "JavaDOMUtils.h"
  47 #include <wtf/java/JavaEnv.h>
  48 
  49 using namespace WebCore;
  50 
  51 extern "C" {
  52 
  53 #define IMPL (static_cast<Element*>(jlong_to_ptr(peer)))
  54 
  55 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_ElementImpl_isHTMLElementImpl(JNIEnv*, jclass, jlong peer) {
  56     return IMPL->isHTMLElement();
  57 }
  58 
  59 
  60 // Attributes
  61 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_ElementImpl_getTagNameImpl(JNIEnv* env, jclass, jlong peer)
  62 {
  63     WebCore::JSMainThreadNullState state;
  64     return JavaReturn<String>(env, IMPL->tagName());
  65 }
  66 
  67 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getAttributesImpl(JNIEnv* env, jclass, jlong peer)
  68 {
  69     WebCore::JSMainThreadNullState state;
  70     return JavaReturn<NamedNodeMap>(env, WTF::getPtr(IMPL->attributes()));
  71 }
  72 
  73 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getStyleImpl(JNIEnv* env, jclass, jlong peer)
  74 {
  75     WebCore::JSMainThreadNullState state;
  76     auto ret = is<WebCore::StyledElement>(IMPL) ? WTF::getPtr(&downcast<WebCore::StyledElement>(IMPL)->cssomStyle()) : nullptr;
  77     return JavaReturn<CSSStyleDeclaration>(env, ret);
  78 }
  79 
  80 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_ElementImpl_getIdImpl(JNIEnv* env, jclass, jlong peer)
  81 {
  82     WebCore::JSMainThreadNullState state;
  83     return JavaReturn<String>(env, IMPL->getIdAttribute());
  84 }
  85 
  86 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setIdImpl(JNIEnv* env, jclass, jlong peer, jstring value)
  87 {
  88     WebCore::JSMainThreadNullState state;
  89     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::idAttr, String(env, value));
  90 }
  91 
  92 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_ElementImpl_getOffsetLeftImpl(JNIEnv*, jclass, jlong peer)
  93 {
  94     WebCore::JSMainThreadNullState state;
  95     return IMPL->offsetLeft();
  96 }
  97 
  98 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_ElementImpl_getOffsetTopImpl(JNIEnv*, jclass, jlong peer)
  99 {
 100     WebCore::JSMainThreadNullState state;
 101     return IMPL->offsetTop();
 102 }
 103 
 104 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_ElementImpl_getOffsetWidthImpl(JNIEnv*, jclass, jlong peer)
 105 {
 106     WebCore::JSMainThreadNullState state;
 107     return IMPL->offsetWidth();
 108 }
 109 
 110 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_ElementImpl_getOffsetHeightImpl(JNIEnv*, jclass, jlong peer)
 111 {
 112     WebCore::JSMainThreadNullState state;
 113     return IMPL->offsetHeight();
 114 }
 115 
 116 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_ElementImpl_getClientLeftImpl(JNIEnv*, jclass, jlong peer)
 117 {
 118     WebCore::JSMainThreadNullState state;
 119     return IMPL->clientLeft();
 120 }
 121 
 122 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_ElementImpl_getClientTopImpl(JNIEnv*, jclass, jlong peer)
 123 {
 124     WebCore::JSMainThreadNullState state;
 125     return IMPL->clientTop();
 126 }
 127 
 128 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_ElementImpl_getClientWidthImpl(JNIEnv*, jclass, jlong peer)
 129 {
 130     WebCore::JSMainThreadNullState state;
 131     return IMPL->clientWidth();
 132 }
 133 
 134 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_ElementImpl_getClientHeightImpl(JNIEnv*, jclass, jlong peer)
 135 {
 136     WebCore::JSMainThreadNullState state;
 137     return IMPL->clientHeight();
 138 }
 139 
 140 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_ElementImpl_getScrollLeftImpl(JNIEnv*, jclass, jlong peer)
 141 {
 142     WebCore::JSMainThreadNullState state;
 143     return IMPL->scrollLeft();
 144 }
 145 
 146 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setScrollLeftImpl(JNIEnv*, jclass, jlong peer, jint value)
 147 {
 148     WebCore::JSMainThreadNullState state;
 149     IMPL->setScrollLeft(value);
 150 }
 151 
 152 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_ElementImpl_getScrollTopImpl(JNIEnv*, jclass, jlong peer)
 153 {
 154     WebCore::JSMainThreadNullState state;
 155     return IMPL->scrollTop();
 156 }
 157 
 158 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setScrollTopImpl(JNIEnv*, jclass, jlong peer, jint value)
 159 {
 160     WebCore::JSMainThreadNullState state;
 161     IMPL->setScrollTop(value);
 162 }
 163 
 164 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_ElementImpl_getScrollWidthImpl(JNIEnv*, jclass, jlong peer)
 165 {
 166     WebCore::JSMainThreadNullState state;
 167     return IMPL->scrollWidth();
 168 }
 169 
 170 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_ElementImpl_getScrollHeightImpl(JNIEnv*, jclass, jlong peer)
 171 {
 172     WebCore::JSMainThreadNullState state;
 173     return IMPL->scrollHeight();
 174 }
 175 
 176 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOffsetParentImpl(JNIEnv* env, jclass, jlong peer)
 177 {
 178     WebCore::JSMainThreadNullState state;
 179     return JavaReturn<Element>(env, WTF::getPtr(IMPL->bindingsOffsetParent()));
 180 }
 181 
 182 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_ElementImpl_getInnerHTMLImpl(JNIEnv* env, jclass, jlong peer)
 183 {
 184     WebCore::JSMainThreadNullState state;
 185     return JavaReturn<String>(env, IMPL->innerHTML());
 186 }
 187 
 188 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setInnerHTMLImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 189 {
 190     WebCore::JSMainThreadNullState state;
 191     IMPL->setInnerHTML(String(env, value));
 192 }
 193 
 194 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_ElementImpl_getOuterHTMLImpl(JNIEnv* env, jclass, jlong peer)
 195 {
 196     WebCore::JSMainThreadNullState state;
 197     return JavaReturn<String>(env, IMPL->outerHTML());
 198 }
 199 
 200 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOuterHTMLImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 201 {
 202     WebCore::JSMainThreadNullState state;
 203     IMPL->setOuterHTML(String(env, value));
 204 }
 205 
 206 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_ElementImpl_getClassNameImpl(JNIEnv* env, jclass, jlong peer)
 207 {
 208     WebCore::JSMainThreadNullState state;
 209     return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::classAttr));
 210 }
 211 
 212 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setClassNameImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 213 {
 214     WebCore::JSMainThreadNullState state;
 215     IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::classAttr, String(env, value));
 216 }
 217 
 218 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnbeforecopyImpl(JNIEnv* env, jclass, jlong peer)
 219 {
 220     WebCore::JSMainThreadNullState state;
 221     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().beforecopyEvent, mainThreadNormalWorld())));
 222 }
 223 
 224 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnbeforecopyImpl(JNIEnv*, jclass, jlong peer, jlong value)
 225 {
 226     WebCore::JSMainThreadNullState state;
 227     IMPL->setAttributeEventListener(eventNames().beforecopyEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 228 }
 229 
 230 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnbeforecutImpl(JNIEnv* env, jclass, jlong peer)
 231 {
 232     WebCore::JSMainThreadNullState state;
 233     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().beforecutEvent, mainThreadNormalWorld())));
 234 }
 235 
 236 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnbeforecutImpl(JNIEnv*, jclass, jlong peer, jlong value)
 237 {
 238     WebCore::JSMainThreadNullState state;
 239     IMPL->setAttributeEventListener(eventNames().beforecutEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 240 }
 241 
 242 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnbeforepasteImpl(JNIEnv* env, jclass, jlong peer)
 243 {
 244     WebCore::JSMainThreadNullState state;
 245     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().beforepasteEvent, mainThreadNormalWorld())));
 246 }
 247 
 248 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnbeforepasteImpl(JNIEnv*, jclass, jlong peer, jlong value)
 249 {
 250     WebCore::JSMainThreadNullState state;
 251     IMPL->setAttributeEventListener(eventNames().beforepasteEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 252 }
 253 
 254 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOncopyImpl(JNIEnv* env, jclass, jlong peer)
 255 {
 256     WebCore::JSMainThreadNullState state;
 257     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().copyEvent, mainThreadNormalWorld())));
 258 }
 259 
 260 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOncopyImpl(JNIEnv*, jclass, jlong peer, jlong value)
 261 {
 262     WebCore::JSMainThreadNullState state;
 263     IMPL->setAttributeEventListener(eventNames().copyEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 264 }
 265 
 266 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOncutImpl(JNIEnv* env, jclass, jlong peer)
 267 {
 268     WebCore::JSMainThreadNullState state;
 269     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().cutEvent, mainThreadNormalWorld())));
 270 }
 271 
 272 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOncutImpl(JNIEnv*, jclass, jlong peer, jlong value)
 273 {
 274     WebCore::JSMainThreadNullState state;
 275     IMPL->setAttributeEventListener(eventNames().cutEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 276 }
 277 
 278 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnpasteImpl(JNIEnv* env, jclass, jlong peer)
 279 {
 280     WebCore::JSMainThreadNullState state;
 281     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().pasteEvent, mainThreadNormalWorld())));
 282 }
 283 
 284 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnpasteImpl(JNIEnv*, jclass, jlong peer, jlong value)
 285 {
 286     WebCore::JSMainThreadNullState state;
 287     IMPL->setAttributeEventListener(eventNames().pasteEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 288 }
 289 
 290 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnselectstartImpl(JNIEnv* env, jclass, jlong peer)
 291 {
 292     WebCore::JSMainThreadNullState state;
 293     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().selectstartEvent, mainThreadNormalWorld())));
 294 }
 295 
 296 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnselectstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 297 {
 298     WebCore::JSMainThreadNullState state;
 299     IMPL->setAttributeEventListener(eventNames().selectstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 300 }
 301 
 302 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnanimationendImpl(JNIEnv* env, jclass, jlong peer)
 303 {
 304     WebCore::JSMainThreadNullState state;
 305     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().animationendEvent, mainThreadNormalWorld())));
 306 }
 307 
 308 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnanimationendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 309 {
 310     WebCore::JSMainThreadNullState state;
 311     IMPL->setAttributeEventListener(eventNames().animationendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 312 }
 313 
 314 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnanimationiterationImpl(JNIEnv* env, jclass, jlong peer)
 315 {
 316     WebCore::JSMainThreadNullState state;
 317     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().animationiterationEvent, mainThreadNormalWorld())));
 318 }
 319 
 320 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnanimationiterationImpl(JNIEnv*, jclass, jlong peer, jlong value)
 321 {
 322     WebCore::JSMainThreadNullState state;
 323     IMPL->setAttributeEventListener(eventNames().animationiterationEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 324 }
 325 
 326 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnanimationstartImpl(JNIEnv* env, jclass, jlong peer)
 327 {
 328     WebCore::JSMainThreadNullState state;
 329     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().animationstartEvent, mainThreadNormalWorld())));
 330 }
 331 
 332 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnanimationstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 333 {
 334     WebCore::JSMainThreadNullState state;
 335     IMPL->setAttributeEventListener(eventNames().animationstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 336 }
 337 
 338 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOntransitionendImpl(JNIEnv* env, jclass, jlong peer)
 339 {
 340     WebCore::JSMainThreadNullState state;
 341     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().transitionendEvent, mainThreadNormalWorld())));
 342 }
 343 
 344 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOntransitionendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 345 {
 346     WebCore::JSMainThreadNullState state;
 347     IMPL->setAttributeEventListener(eventNames().transitionendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 348 }
 349 
 350 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnwebkitanimationendImpl(JNIEnv* env, jclass, jlong peer)
 351 {
 352     WebCore::JSMainThreadNullState state;
 353     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().webkitAnimationEndEvent, mainThreadNormalWorld())));
 354 }
 355 
 356 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnwebkitanimationendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 357 {
 358     WebCore::JSMainThreadNullState state;
 359     IMPL->setAttributeEventListener(eventNames().webkitAnimationEndEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 360 }
 361 
 362 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnwebkitanimationiterationImpl(JNIEnv* env, jclass, jlong peer)
 363 {
 364     WebCore::JSMainThreadNullState state;
 365     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().webkitAnimationIterationEvent, mainThreadNormalWorld())));
 366 }
 367 
 368 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnwebkitanimationiterationImpl(JNIEnv*, jclass, jlong peer, jlong value)
 369 {
 370     WebCore::JSMainThreadNullState state;
 371     IMPL->setAttributeEventListener(eventNames().webkitAnimationIterationEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 372 }
 373 
 374 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnwebkitanimationstartImpl(JNIEnv* env, jclass, jlong peer)
 375 {
 376     WebCore::JSMainThreadNullState state;
 377     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().webkitAnimationStartEvent, mainThreadNormalWorld())));
 378 }
 379 
 380 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnwebkitanimationstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 381 {
 382     WebCore::JSMainThreadNullState state;
 383     IMPL->setAttributeEventListener(eventNames().webkitAnimationStartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 384 }
 385 
 386 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnwebkittransitionendImpl(JNIEnv* env, jclass, jlong peer)
 387 {
 388     WebCore::JSMainThreadNullState state;
 389     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().webkitTransitionEndEvent, mainThreadNormalWorld())));
 390 }
 391 
 392 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnwebkittransitionendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 393 {
 394     WebCore::JSMainThreadNullState state;
 395     IMPL->setAttributeEventListener(eventNames().webkitTransitionEndEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 396 }
 397 
 398 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnfocusinImpl(JNIEnv* env, jclass, jlong peer)
 399 {
 400     WebCore::JSMainThreadNullState state;
 401     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().focusinEvent, mainThreadNormalWorld())));
 402 }
 403 
 404 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnfocusinImpl(JNIEnv*, jclass, jlong peer, jlong value)
 405 {
 406     WebCore::JSMainThreadNullState state;
 407     IMPL->setAttributeEventListener(eventNames().focusinEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 408 }
 409 
 410 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnfocusoutImpl(JNIEnv* env, jclass, jlong peer)
 411 {
 412     WebCore::JSMainThreadNullState state;
 413     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().focusoutEvent, mainThreadNormalWorld())));
 414 }
 415 
 416 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnfocusoutImpl(JNIEnv*, jclass, jlong peer, jlong value)
 417 {
 418     WebCore::JSMainThreadNullState state;
 419     IMPL->setAttributeEventListener(eventNames().focusoutEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 420 }
 421 
 422 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnbeforeloadImpl(JNIEnv* env, jclass, jlong peer)
 423 {
 424     WebCore::JSMainThreadNullState state;
 425     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().beforeloadEvent, mainThreadNormalWorld())));
 426 }
 427 
 428 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnbeforeloadImpl(JNIEnv*, jclass, jlong peer, jlong value)
 429 {
 430     WebCore::JSMainThreadNullState state;
 431     IMPL->setAttributeEventListener(eventNames().beforeloadEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 432 }
 433 
 434 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnabortImpl(JNIEnv* env, jclass, jlong peer)
 435 {
 436     WebCore::JSMainThreadNullState state;
 437     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().abortEvent, mainThreadNormalWorld())));
 438 }
 439 
 440 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnabortImpl(JNIEnv*, jclass, jlong peer, jlong value)
 441 {
 442     WebCore::JSMainThreadNullState state;
 443     IMPL->setAttributeEventListener(eventNames().abortEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 444 }
 445 
 446 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnblurImpl(JNIEnv* env, jclass, jlong peer)
 447 {
 448     WebCore::JSMainThreadNullState state;
 449     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().blurEvent, mainThreadNormalWorld())));
 450 }
 451 
 452 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnblurImpl(JNIEnv*, jclass, jlong peer, jlong value)
 453 {
 454     WebCore::JSMainThreadNullState state;
 455     IMPL->setAttributeEventListener(eventNames().blurEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 456 }
 457 
 458 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOncanplayImpl(JNIEnv* env, jclass, jlong peer)
 459 {
 460     WebCore::JSMainThreadNullState state;
 461     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().canplayEvent, mainThreadNormalWorld())));
 462 }
 463 
 464 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOncanplayImpl(JNIEnv*, jclass, jlong peer, jlong value)
 465 {
 466     WebCore::JSMainThreadNullState state;
 467     IMPL->setAttributeEventListener(eventNames().canplayEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 468 }
 469 
 470 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOncanplaythroughImpl(JNIEnv* env, jclass, jlong peer)
 471 {
 472     WebCore::JSMainThreadNullState state;
 473     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().canplaythroughEvent, mainThreadNormalWorld())));
 474 }
 475 
 476 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOncanplaythroughImpl(JNIEnv*, jclass, jlong peer, jlong value)
 477 {
 478     WebCore::JSMainThreadNullState state;
 479     IMPL->setAttributeEventListener(eventNames().canplaythroughEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 480 }
 481 
 482 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnchangeImpl(JNIEnv* env, jclass, jlong peer)
 483 {
 484     WebCore::JSMainThreadNullState state;
 485     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().changeEvent, mainThreadNormalWorld())));
 486 }
 487 
 488 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnchangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 489 {
 490     WebCore::JSMainThreadNullState state;
 491     IMPL->setAttributeEventListener(eventNames().changeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 492 }
 493 
 494 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnclickImpl(JNIEnv* env, jclass, jlong peer)
 495 {
 496     WebCore::JSMainThreadNullState state;
 497     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().clickEvent, mainThreadNormalWorld())));
 498 }
 499 
 500 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnclickImpl(JNIEnv*, jclass, jlong peer, jlong value)
 501 {
 502     WebCore::JSMainThreadNullState state;
 503     IMPL->setAttributeEventListener(eventNames().clickEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 504 }
 505 
 506 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOncontextmenuImpl(JNIEnv* env, jclass, jlong peer)
 507 {
 508     WebCore::JSMainThreadNullState state;
 509     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().contextmenuEvent, mainThreadNormalWorld())));
 510 }
 511 
 512 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOncontextmenuImpl(JNIEnv*, jclass, jlong peer, jlong value)
 513 {
 514     WebCore::JSMainThreadNullState state;
 515     IMPL->setAttributeEventListener(eventNames().contextmenuEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 516 }
 517 
 518 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndblclickImpl(JNIEnv* env, jclass, jlong peer)
 519 {
 520     WebCore::JSMainThreadNullState state;
 521     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dblclickEvent, mainThreadNormalWorld())));
 522 }
 523 
 524 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndblclickImpl(JNIEnv*, jclass, jlong peer, jlong value)
 525 {
 526     WebCore::JSMainThreadNullState state;
 527     IMPL->setAttributeEventListener(eventNames().dblclickEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 528 }
 529 
 530 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndragImpl(JNIEnv* env, jclass, jlong peer)
 531 {
 532     WebCore::JSMainThreadNullState state;
 533     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragEvent, mainThreadNormalWorld())));
 534 }
 535 
 536 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndragImpl(JNIEnv*, jclass, jlong peer, jlong value)
 537 {
 538     WebCore::JSMainThreadNullState state;
 539     IMPL->setAttributeEventListener(eventNames().dragEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 540 }
 541 
 542 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndragendImpl(JNIEnv* env, jclass, jlong peer)
 543 {
 544     WebCore::JSMainThreadNullState state;
 545     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragendEvent, mainThreadNormalWorld())));
 546 }
 547 
 548 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndragendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 549 {
 550     WebCore::JSMainThreadNullState state;
 551     IMPL->setAttributeEventListener(eventNames().dragendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 552 }
 553 
 554 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndragenterImpl(JNIEnv* env, jclass, jlong peer)
 555 {
 556     WebCore::JSMainThreadNullState state;
 557     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragenterEvent, mainThreadNormalWorld())));
 558 }
 559 
 560 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndragenterImpl(JNIEnv*, jclass, jlong peer, jlong value)
 561 {
 562     WebCore::JSMainThreadNullState state;
 563     IMPL->setAttributeEventListener(eventNames().dragenterEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 564 }
 565 
 566 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndragleaveImpl(JNIEnv* env, jclass, jlong peer)
 567 {
 568     WebCore::JSMainThreadNullState state;
 569     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragleaveEvent, mainThreadNormalWorld())));
 570 }
 571 
 572 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndragleaveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 573 {
 574     WebCore::JSMainThreadNullState state;
 575     IMPL->setAttributeEventListener(eventNames().dragleaveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 576 }
 577 
 578 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndragoverImpl(JNIEnv* env, jclass, jlong peer)
 579 {
 580     WebCore::JSMainThreadNullState state;
 581     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragoverEvent, mainThreadNormalWorld())));
 582 }
 583 
 584 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndragoverImpl(JNIEnv*, jclass, jlong peer, jlong value)
 585 {
 586     WebCore::JSMainThreadNullState state;
 587     IMPL->setAttributeEventListener(eventNames().dragoverEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 588 }
 589 
 590 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndragstartImpl(JNIEnv* env, jclass, jlong peer)
 591 {
 592     WebCore::JSMainThreadNullState state;
 593     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragstartEvent, mainThreadNormalWorld())));
 594 }
 595 
 596 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndragstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 597 {
 598     WebCore::JSMainThreadNullState state;
 599     IMPL->setAttributeEventListener(eventNames().dragstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 600 }
 601 
 602 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndropImpl(JNIEnv* env, jclass, jlong peer)
 603 {
 604     WebCore::JSMainThreadNullState state;
 605     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dropEvent, mainThreadNormalWorld())));
 606 }
 607 
 608 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndropImpl(JNIEnv*, jclass, jlong peer, jlong value)
 609 {
 610     WebCore::JSMainThreadNullState state;
 611     IMPL->setAttributeEventListener(eventNames().dropEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 612 }
 613 
 614 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOndurationchangeImpl(JNIEnv* env, jclass, jlong peer)
 615 {
 616     WebCore::JSMainThreadNullState state;
 617     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().durationchangeEvent, mainThreadNormalWorld())));
 618 }
 619 
 620 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOndurationchangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 621 {
 622     WebCore::JSMainThreadNullState state;
 623     IMPL->setAttributeEventListener(eventNames().durationchangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 624 }
 625 
 626 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnemptiedImpl(JNIEnv* env, jclass, jlong peer)
 627 {
 628     WebCore::JSMainThreadNullState state;
 629     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().emptiedEvent, mainThreadNormalWorld())));
 630 }
 631 
 632 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnemptiedImpl(JNIEnv*, jclass, jlong peer, jlong value)
 633 {
 634     WebCore::JSMainThreadNullState state;
 635     IMPL->setAttributeEventListener(eventNames().emptiedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 636 }
 637 
 638 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnendedImpl(JNIEnv* env, jclass, jlong peer)
 639 {
 640     WebCore::JSMainThreadNullState state;
 641     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().endedEvent, mainThreadNormalWorld())));
 642 }
 643 
 644 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnendedImpl(JNIEnv*, jclass, jlong peer, jlong value)
 645 {
 646     WebCore::JSMainThreadNullState state;
 647     IMPL->setAttributeEventListener(eventNames().endedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 648 }
 649 
 650 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnerrorImpl(JNIEnv* env, jclass, jlong peer)
 651 {
 652     WebCore::JSMainThreadNullState state;
 653     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().errorEvent, mainThreadNormalWorld())));
 654 }
 655 
 656 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnerrorImpl(JNIEnv*, jclass, jlong peer, jlong value)
 657 {
 658     WebCore::JSMainThreadNullState state;
 659     IMPL->setAttributeEventListener(eventNames().errorEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 660 }
 661 
 662 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnfocusImpl(JNIEnv* env, jclass, jlong peer)
 663 {
 664     WebCore::JSMainThreadNullState state;
 665     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().focusEvent, mainThreadNormalWorld())));
 666 }
 667 
 668 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnfocusImpl(JNIEnv*, jclass, jlong peer, jlong value)
 669 {
 670     WebCore::JSMainThreadNullState state;
 671     IMPL->setAttributeEventListener(eventNames().focusEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 672 }
 673 
 674 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOninputImpl(JNIEnv* env, jclass, jlong peer)
 675 {
 676     WebCore::JSMainThreadNullState state;
 677     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().inputEvent, mainThreadNormalWorld())));
 678 }
 679 
 680 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOninputImpl(JNIEnv*, jclass, jlong peer, jlong value)
 681 {
 682     WebCore::JSMainThreadNullState state;
 683     IMPL->setAttributeEventListener(eventNames().inputEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 684 }
 685 
 686 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOninvalidImpl(JNIEnv* env, jclass, jlong peer)
 687 {
 688     WebCore::JSMainThreadNullState state;
 689     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().invalidEvent, mainThreadNormalWorld())));
 690 }
 691 
 692 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOninvalidImpl(JNIEnv*, jclass, jlong peer, jlong value)
 693 {
 694     WebCore::JSMainThreadNullState state;
 695     IMPL->setAttributeEventListener(eventNames().invalidEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 696 }
 697 
 698 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnkeydownImpl(JNIEnv* env, jclass, jlong peer)
 699 {
 700     WebCore::JSMainThreadNullState state;
 701     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keydownEvent, mainThreadNormalWorld())));
 702 }
 703 
 704 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnkeydownImpl(JNIEnv*, jclass, jlong peer, jlong value)
 705 {
 706     WebCore::JSMainThreadNullState state;
 707     IMPL->setAttributeEventListener(eventNames().keydownEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 708 }
 709 
 710 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnkeypressImpl(JNIEnv* env, jclass, jlong peer)
 711 {
 712     WebCore::JSMainThreadNullState state;
 713     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keypressEvent, mainThreadNormalWorld())));
 714 }
 715 
 716 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnkeypressImpl(JNIEnv*, jclass, jlong peer, jlong value)
 717 {
 718     WebCore::JSMainThreadNullState state;
 719     IMPL->setAttributeEventListener(eventNames().keypressEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 720 }
 721 
 722 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnkeyupImpl(JNIEnv* env, jclass, jlong peer)
 723 {
 724     WebCore::JSMainThreadNullState state;
 725     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keyupEvent, mainThreadNormalWorld())));
 726 }
 727 
 728 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnkeyupImpl(JNIEnv*, jclass, jlong peer, jlong value)
 729 {
 730     WebCore::JSMainThreadNullState state;
 731     IMPL->setAttributeEventListener(eventNames().keyupEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 732 }
 733 
 734 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnloadImpl(JNIEnv* env, jclass, jlong peer)
 735 {
 736     WebCore::JSMainThreadNullState state;
 737     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadEvent, mainThreadNormalWorld())));
 738 }
 739 
 740 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnloadImpl(JNIEnv*, jclass, jlong peer, jlong value)
 741 {
 742     WebCore::JSMainThreadNullState state;
 743     IMPL->setAttributeEventListener(eventNames().loadEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 744 }
 745 
 746 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnloadeddataImpl(JNIEnv* env, jclass, jlong peer)
 747 {
 748     WebCore::JSMainThreadNullState state;
 749     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadeddataEvent, mainThreadNormalWorld())));
 750 }
 751 
 752 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnloadeddataImpl(JNIEnv*, jclass, jlong peer, jlong value)
 753 {
 754     WebCore::JSMainThreadNullState state;
 755     IMPL->setAttributeEventListener(eventNames().loadeddataEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 756 }
 757 
 758 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnloadedmetadataImpl(JNIEnv* env, jclass, jlong peer)
 759 {
 760     WebCore::JSMainThreadNullState state;
 761     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadedmetadataEvent, mainThreadNormalWorld())));
 762 }
 763 
 764 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnloadedmetadataImpl(JNIEnv*, jclass, jlong peer, jlong value)
 765 {
 766     WebCore::JSMainThreadNullState state;
 767     IMPL->setAttributeEventListener(eventNames().loadedmetadataEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 768 }
 769 
 770 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnloadstartImpl(JNIEnv* env, jclass, jlong peer)
 771 {
 772     WebCore::JSMainThreadNullState state;
 773     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadstartEvent, mainThreadNormalWorld())));
 774 }
 775 
 776 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnloadstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 777 {
 778     WebCore::JSMainThreadNullState state;
 779     IMPL->setAttributeEventListener(eventNames().loadstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 780 }
 781 
 782 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnmousedownImpl(JNIEnv* env, jclass, jlong peer)
 783 {
 784     WebCore::JSMainThreadNullState state;
 785     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousedownEvent, mainThreadNormalWorld())));
 786 }
 787 
 788 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnmousedownImpl(JNIEnv*, jclass, jlong peer, jlong value)
 789 {
 790     WebCore::JSMainThreadNullState state;
 791     IMPL->setAttributeEventListener(eventNames().mousedownEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 792 }
 793 
 794 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnmouseenterImpl(JNIEnv* env, jclass, jlong peer)
 795 {
 796     WebCore::JSMainThreadNullState state;
 797     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseenterEvent, mainThreadNormalWorld())));
 798 }
 799 
 800 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnmouseenterImpl(JNIEnv*, jclass, jlong peer, jlong value)
 801 {
 802     WebCore::JSMainThreadNullState state;
 803     IMPL->setAttributeEventListener(eventNames().mouseenterEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 804 }
 805 
 806 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnmouseleaveImpl(JNIEnv* env, jclass, jlong peer)
 807 {
 808     WebCore::JSMainThreadNullState state;
 809     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseleaveEvent, mainThreadNormalWorld())));
 810 }
 811 
 812 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnmouseleaveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 813 {
 814     WebCore::JSMainThreadNullState state;
 815     IMPL->setAttributeEventListener(eventNames().mouseleaveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 816 }
 817 
 818 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnmousemoveImpl(JNIEnv* env, jclass, jlong peer)
 819 {
 820     WebCore::JSMainThreadNullState state;
 821     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousemoveEvent, mainThreadNormalWorld())));
 822 }
 823 
 824 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnmousemoveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 825 {
 826     WebCore::JSMainThreadNullState state;
 827     IMPL->setAttributeEventListener(eventNames().mousemoveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 828 }
 829 
 830 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnmouseoutImpl(JNIEnv* env, jclass, jlong peer)
 831 {
 832     WebCore::JSMainThreadNullState state;
 833     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseoutEvent, mainThreadNormalWorld())));
 834 }
 835 
 836 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnmouseoutImpl(JNIEnv*, jclass, jlong peer, jlong value)
 837 {
 838     WebCore::JSMainThreadNullState state;
 839     IMPL->setAttributeEventListener(eventNames().mouseoutEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 840 }
 841 
 842 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnmouseoverImpl(JNIEnv* env, jclass, jlong peer)
 843 {
 844     WebCore::JSMainThreadNullState state;
 845     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseoverEvent, mainThreadNormalWorld())));
 846 }
 847 
 848 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnmouseoverImpl(JNIEnv*, jclass, jlong peer, jlong value)
 849 {
 850     WebCore::JSMainThreadNullState state;
 851     IMPL->setAttributeEventListener(eventNames().mouseoverEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 852 }
 853 
 854 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnmouseupImpl(JNIEnv* env, jclass, jlong peer)
 855 {
 856     WebCore::JSMainThreadNullState state;
 857     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseupEvent, mainThreadNormalWorld())));
 858 }
 859 
 860 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnmouseupImpl(JNIEnv*, jclass, jlong peer, jlong value)
 861 {
 862     WebCore::JSMainThreadNullState state;
 863     IMPL->setAttributeEventListener(eventNames().mouseupEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 864 }
 865 
 866 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnmousewheelImpl(JNIEnv* env, jclass, jlong peer)
 867 {
 868     WebCore::JSMainThreadNullState state;
 869     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousewheelEvent, mainThreadNormalWorld())));
 870 }
 871 
 872 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnmousewheelImpl(JNIEnv*, jclass, jlong peer, jlong value)
 873 {
 874     WebCore::JSMainThreadNullState state;
 875     IMPL->setAttributeEventListener(eventNames().mousewheelEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 876 }
 877 
 878 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnpauseImpl(JNIEnv* env, jclass, jlong peer)
 879 {
 880     WebCore::JSMainThreadNullState state;
 881     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().pauseEvent, mainThreadNormalWorld())));
 882 }
 883 
 884 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnpauseImpl(JNIEnv*, jclass, jlong peer, jlong value)
 885 {
 886     WebCore::JSMainThreadNullState state;
 887     IMPL->setAttributeEventListener(eventNames().pauseEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 888 }
 889 
 890 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnplayImpl(JNIEnv* env, jclass, jlong peer)
 891 {
 892     WebCore::JSMainThreadNullState state;
 893     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().playEvent, mainThreadNormalWorld())));
 894 }
 895 
 896 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnplayImpl(JNIEnv*, jclass, jlong peer, jlong value)
 897 {
 898     WebCore::JSMainThreadNullState state;
 899     IMPL->setAttributeEventListener(eventNames().playEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 900 }
 901 
 902 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnplayingImpl(JNIEnv* env, jclass, jlong peer)
 903 {
 904     WebCore::JSMainThreadNullState state;
 905     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().playingEvent, mainThreadNormalWorld())));
 906 }
 907 
 908 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnplayingImpl(JNIEnv*, jclass, jlong peer, jlong value)
 909 {
 910     WebCore::JSMainThreadNullState state;
 911     IMPL->setAttributeEventListener(eventNames().playingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 912 }
 913 
 914 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnprogressImpl(JNIEnv* env, jclass, jlong peer)
 915 {
 916     WebCore::JSMainThreadNullState state;
 917     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().progressEvent, mainThreadNormalWorld())));
 918 }
 919 
 920 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnprogressImpl(JNIEnv*, jclass, jlong peer, jlong value)
 921 {
 922     WebCore::JSMainThreadNullState state;
 923     IMPL->setAttributeEventListener(eventNames().progressEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 924 }
 925 
 926 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnratechangeImpl(JNIEnv* env, jclass, jlong peer)
 927 {
 928     WebCore::JSMainThreadNullState state;
 929     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().ratechangeEvent, mainThreadNormalWorld())));
 930 }
 931 
 932 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnratechangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 933 {
 934     WebCore::JSMainThreadNullState state;
 935     IMPL->setAttributeEventListener(eventNames().ratechangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 936 }
 937 
 938 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnresetImpl(JNIEnv* env, jclass, jlong peer)
 939 {
 940     WebCore::JSMainThreadNullState state;
 941     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().resetEvent, mainThreadNormalWorld())));
 942 }
 943 
 944 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnresetImpl(JNIEnv*, jclass, jlong peer, jlong value)
 945 {
 946     WebCore::JSMainThreadNullState state;
 947     IMPL->setAttributeEventListener(eventNames().resetEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 948 }
 949 
 950 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnresizeImpl(JNIEnv* env, jclass, jlong peer)
 951 {
 952     WebCore::JSMainThreadNullState state;
 953     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().resizeEvent, mainThreadNormalWorld())));
 954 }
 955 
 956 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnresizeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 957 {
 958     WebCore::JSMainThreadNullState state;
 959     IMPL->setAttributeEventListener(eventNames().resizeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 960 }
 961 
 962 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnscrollImpl(JNIEnv* env, jclass, jlong peer)
 963 {
 964     WebCore::JSMainThreadNullState state;
 965     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().scrollEvent, mainThreadNormalWorld())));
 966 }
 967 
 968 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnscrollImpl(JNIEnv*, jclass, jlong peer, jlong value)
 969 {
 970     WebCore::JSMainThreadNullState state;
 971     IMPL->setAttributeEventListener(eventNames().scrollEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 972 }
 973 
 974 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnseekedImpl(JNIEnv* env, jclass, jlong peer)
 975 {
 976     WebCore::JSMainThreadNullState state;
 977     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().seekedEvent, mainThreadNormalWorld())));
 978 }
 979 
 980 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnseekedImpl(JNIEnv*, jclass, jlong peer, jlong value)
 981 {
 982     WebCore::JSMainThreadNullState state;
 983     IMPL->setAttributeEventListener(eventNames().seekedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 984 }
 985 
 986 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnseekingImpl(JNIEnv* env, jclass, jlong peer)
 987 {
 988     WebCore::JSMainThreadNullState state;
 989     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().seekingEvent, mainThreadNormalWorld())));
 990 }
 991 
 992 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnseekingImpl(JNIEnv*, jclass, jlong peer, jlong value)
 993 {
 994     WebCore::JSMainThreadNullState state;
 995     IMPL->setAttributeEventListener(eventNames().seekingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 996 }
 997 
 998 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnselectImpl(JNIEnv* env, jclass, jlong peer)
 999 {
1000     WebCore::JSMainThreadNullState state;
1001     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().selectEvent, mainThreadNormalWorld())));
1002 }
1003 
1004 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnselectImpl(JNIEnv*, jclass, jlong peer, jlong value)
1005 {
1006     WebCore::JSMainThreadNullState state;
1007     IMPL->setAttributeEventListener(eventNames().selectEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1008 }
1009 
1010 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnstalledImpl(JNIEnv* env, jclass, jlong peer)
1011 {
1012     WebCore::JSMainThreadNullState state;
1013     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().stalledEvent, mainThreadNormalWorld())));
1014 }
1015 
1016 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnstalledImpl(JNIEnv*, jclass, jlong peer, jlong value)
1017 {
1018     WebCore::JSMainThreadNullState state;
1019     IMPL->setAttributeEventListener(eventNames().stalledEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1020 }
1021 
1022 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnsubmitImpl(JNIEnv* env, jclass, jlong peer)
1023 {
1024     WebCore::JSMainThreadNullState state;
1025     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().submitEvent, mainThreadNormalWorld())));
1026 }
1027 
1028 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnsubmitImpl(JNIEnv*, jclass, jlong peer, jlong value)
1029 {
1030     WebCore::JSMainThreadNullState state;
1031     IMPL->setAttributeEventListener(eventNames().submitEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1032 }
1033 
1034 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnsuspendImpl(JNIEnv* env, jclass, jlong peer)
1035 {
1036     WebCore::JSMainThreadNullState state;
1037     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().suspendEvent, mainThreadNormalWorld())));
1038 }
1039 
1040 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnsuspendImpl(JNIEnv*, jclass, jlong peer, jlong value)
1041 {
1042     WebCore::JSMainThreadNullState state;
1043     IMPL->setAttributeEventListener(eventNames().suspendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1044 }
1045 
1046 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOntimeupdateImpl(JNIEnv* env, jclass, jlong peer)
1047 {
1048     WebCore::JSMainThreadNullState state;
1049     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().timeupdateEvent, mainThreadNormalWorld())));
1050 }
1051 
1052 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOntimeupdateImpl(JNIEnv*, jclass, jlong peer, jlong value)
1053 {
1054     WebCore::JSMainThreadNullState state;
1055     IMPL->setAttributeEventListener(eventNames().timeupdateEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1056 }
1057 
1058 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnvolumechangeImpl(JNIEnv* env, jclass, jlong peer)
1059 {
1060     WebCore::JSMainThreadNullState state;
1061     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().volumechangeEvent, mainThreadNormalWorld())));
1062 }
1063 
1064 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnvolumechangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
1065 {
1066     WebCore::JSMainThreadNullState state;
1067     IMPL->setAttributeEventListener(eventNames().volumechangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1068 }
1069 
1070 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnwaitingImpl(JNIEnv* env, jclass, jlong peer)
1071 {
1072     WebCore::JSMainThreadNullState state;
1073     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().waitingEvent, mainThreadNormalWorld())));
1074 }
1075 
1076 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnwaitingImpl(JNIEnv*, jclass, jlong peer, jlong value)
1077 {
1078     WebCore::JSMainThreadNullState state;
1079     IMPL->setAttributeEventListener(eventNames().waitingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1080 }
1081 
1082 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnsearchImpl(JNIEnv* env, jclass, jlong peer)
1083 {
1084     WebCore::JSMainThreadNullState state;
1085     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().searchEvent, mainThreadNormalWorld())));
1086 }
1087 
1088 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnsearchImpl(JNIEnv*, jclass, jlong peer, jlong value)
1089 {
1090     WebCore::JSMainThreadNullState state;
1091     IMPL->setAttributeEventListener(eventNames().searchEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1092 }
1093 
1094 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getOnwheelImpl(JNIEnv* env, jclass, jlong peer)
1095 {
1096     WebCore::JSMainThreadNullState state;
1097     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().wheelEvent, mainThreadNormalWorld())));
1098 }
1099 
1100 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setOnwheelImpl(JNIEnv*, jclass, jlong peer, jlong value)
1101 {
1102     WebCore::JSMainThreadNullState state;
1103     IMPL->setAttributeEventListener(eventNames().wheelEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1104 }
1105 
1106 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getPreviousElementSiblingImpl(JNIEnv* env, jclass, jlong peer)
1107 {
1108     WebCore::JSMainThreadNullState state;
1109     return JavaReturn<Element>(env, WTF::getPtr(IMPL->previousElementSibling()));
1110 }
1111 
1112 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getNextElementSiblingImpl(JNIEnv* env, jclass, jlong peer)
1113 {
1114     WebCore::JSMainThreadNullState state;
1115     return JavaReturn<Element>(env, WTF::getPtr(IMPL->nextElementSibling()));
1116 }
1117 
1118 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getChildrenImpl(JNIEnv* env, jclass, jlong peer)
1119 {
1120     WebCore::JSMainThreadNullState state;
1121     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->children()));
1122 }
1123 
1124 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getFirstElementChildImpl(JNIEnv* env, jclass, jlong peer)
1125 {
1126     WebCore::JSMainThreadNullState state;
1127     return JavaReturn<Element>(env, WTF::getPtr(IMPL->firstElementChild()));
1128 }
1129 
1130 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getLastElementChildImpl(JNIEnv* env, jclass, jlong peer)
1131 {
1132     WebCore::JSMainThreadNullState state;
1133     return JavaReturn<Element>(env, WTF::getPtr(IMPL->lastElementChild()));
1134 }
1135 
1136 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_ElementImpl_getChildElementCountImpl(JNIEnv*, jclass, jlong peer)
1137 {
1138     WebCore::JSMainThreadNullState state;
1139     return IMPL->childElementCount();
1140 }
1141 
1142 
1143 // Functions
1144 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_ElementImpl_getAttributeImpl(JNIEnv* env, jclass, jlong peer
1145     , jstring name)
1146 {
1147     WebCore::JSMainThreadNullState state;
1148     return JavaReturn<String>(env, IMPL->getAttribute(String(env, name)));
1149 }
1150 
1151 
1152 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setAttributeImpl(JNIEnv* env, jclass, jlong peer
1153     , jstring name
1154     , jstring value)
1155 {
1156     WebCore::JSMainThreadNullState state;
1157     raiseOnDOMError(env, IMPL->setAttribute(String(env, name)
1158             , String(env, value)));
1159 }
1160 
1161 
1162 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_removeAttributeImpl(JNIEnv* env, jclass, jlong peer
1163     , jstring name)
1164 {
1165     WebCore::JSMainThreadNullState state;
1166     IMPL->removeAttribute(String(env, name));
1167 }
1168 
1169 
1170 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getAttributeNodeImpl(JNIEnv* env, jclass, jlong peer
1171     , jstring name)
1172 {
1173     WebCore::JSMainThreadNullState state;
1174     return JavaReturn<Attr>(env, WTF::getPtr(IMPL->getAttributeNode(String(env, name))));
1175 }
1176 
1177 
1178 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_setAttributeNodeImpl(JNIEnv* env, jclass, jlong peer
1179     , jlong newAttr)
1180 {
1181     WebCore::JSMainThreadNullState state;
1182     if (!newAttr) {
1183         raiseTypeErrorException(env);
1184         return 0;
1185     }
1186 
1187     return JavaReturn<Attr>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->setAttributeNode(*static_cast<Attr*>(jlong_to_ptr(newAttr))))));
1188 }
1189 
1190 
1191 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_removeAttributeNodeImpl(JNIEnv* env, jclass, jlong peer
1192     , jlong oldAttr)
1193 {
1194     WebCore::JSMainThreadNullState state;
1195     if (!oldAttr) {
1196         raiseTypeErrorException(env);
1197         return 0;
1198     }
1199 
1200     return JavaReturn<Attr>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->removeAttributeNode(*static_cast<Attr*>(jlong_to_ptr(oldAttr))))));
1201 }
1202 
1203 
1204 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getElementsByTagNameImpl(JNIEnv* env, jclass, jlong peer
1205     , jstring name)
1206 {
1207     if (!name)
1208         return 0;
1209     WebCore::JSMainThreadNullState state;
1210     return JavaReturn<NodeList>(env, WTF::getPtr(IMPL->getElementsByTagName(String(env, name))));
1211 }
1212 
1213 
1214 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_ElementImpl_hasAttributesImpl(JNIEnv*, jclass, jlong peer)
1215 {
1216     WebCore::JSMainThreadNullState state;
1217     return IMPL->hasAttributes();
1218 }
1219 
1220 
1221 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_ElementImpl_getAttributeNSImpl(JNIEnv* env, jclass, jlong peer
1222     , jstring namespaceURI
1223     , jstring localName)
1224 {
1225     WebCore::JSMainThreadNullState state;
1226     return JavaReturn<String>(env, IMPL->getAttributeNS(String(env, namespaceURI)
1227             , String(env, localName)));
1228 }
1229 
1230 
1231 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_setAttributeNSImpl(JNIEnv* env, jclass, jlong peer
1232     , jstring namespaceURI
1233     , jstring qualifiedName
1234     , jstring value)
1235 {
1236     WebCore::JSMainThreadNullState state;
1237     raiseOnDOMError(env, IMPL->setAttributeNS(String(env, namespaceURI)
1238             , String(env, qualifiedName)
1239             , String(env, value)));
1240 }
1241 
1242 
1243 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_removeAttributeNSImpl(JNIEnv* env, jclass, jlong peer
1244     , jstring namespaceURI
1245     , jstring localName)
1246 {
1247     WebCore::JSMainThreadNullState state;
1248     IMPL->removeAttributeNS(String(env, namespaceURI)
1249             , String(env, localName));
1250 }
1251 
1252 
1253 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getElementsByTagNameNSImpl(JNIEnv* env, jclass, jlong peer
1254     , jstring namespaceURI
1255     , jstring localName)
1256 {
1257     if (!localName)
1258         return 0;
1259     WebCore::JSMainThreadNullState state;
1260     return JavaReturn<NodeList>(env, WTF::getPtr(IMPL->getElementsByTagNameNS(String(env, namespaceURI)
1261             , String(env, localName))));
1262 }
1263 
1264 
1265 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getAttributeNodeNSImpl(JNIEnv* env, jclass, jlong peer
1266     , jstring namespaceURI
1267     , jstring localName)
1268 {
1269     WebCore::JSMainThreadNullState state;
1270     return JavaReturn<Attr>(env, WTF::getPtr(IMPL->getAttributeNodeNS(String(env, namespaceURI)
1271             , String(env, localName))));
1272 }
1273 
1274 
1275 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_setAttributeNodeNSImpl(JNIEnv* env, jclass, jlong peer
1276     , jlong newAttr)
1277 {
1278     WebCore::JSMainThreadNullState state;
1279     if (!newAttr) {
1280         raiseTypeErrorException(env);
1281         return 0;
1282     }
1283     return JavaReturn<Attr>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->setAttributeNodeNS(*static_cast<Attr*>(jlong_to_ptr(newAttr))))));
1284 }
1285 
1286 
1287 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_ElementImpl_hasAttributeImpl(JNIEnv* env, jclass, jlong peer
1288     , jstring name)
1289 {
1290     WebCore::JSMainThreadNullState state;
1291     return IMPL->hasAttribute(String(env, name));
1292 }
1293 
1294 
1295 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_ElementImpl_hasAttributeNSImpl(JNIEnv* env, jclass, jlong peer
1296     , jstring namespaceURI
1297     , jstring localName)
1298 {
1299     WebCore::JSMainThreadNullState state;
1300     return IMPL->hasAttributeNS(String(env, namespaceURI)
1301             , String(env, localName));
1302 }
1303 
1304 
1305 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_focusImpl(JNIEnv*, jclass, jlong peer)
1306 {
1307     WebCore::JSMainThreadNullState state;
1308     IMPL->focus();
1309 }
1310 
1311 
1312 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_blurImpl(JNIEnv*, jclass, jlong peer)
1313 {
1314     WebCore::JSMainThreadNullState state;
1315     IMPL->blur();
1316 }
1317 
1318 
1319 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_scrollIntoViewImpl(JNIEnv*, jclass, jlong peer
1320     , jboolean alignWithTop)
1321 {
1322     WebCore::JSMainThreadNullState state;
1323     IMPL->scrollIntoView(alignWithTop);
1324 }
1325 
1326 
1327 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_scrollIntoViewIfNeededImpl(JNIEnv*, jclass, jlong peer
1328     , jboolean centerIfNeeded)
1329 {
1330     WebCore::JSMainThreadNullState state;
1331     IMPL->scrollIntoViewIfNeeded(centerIfNeeded);
1332 }
1333 
1334 
1335 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_scrollByLinesImpl(JNIEnv*, jclass, jlong peer
1336     , jint lines)
1337 {
1338     WebCore::JSMainThreadNullState state;
1339     IMPL->scrollByLines(lines);
1340 }
1341 
1342 
1343 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_scrollByPagesImpl(JNIEnv*, jclass, jlong peer
1344     , jint pages)
1345 {
1346     WebCore::JSMainThreadNullState state;
1347     IMPL->scrollByPages(pages);
1348 }
1349 
1350 
1351 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_getElementsByClassNameImpl(JNIEnv* env, jclass, jlong peer
1352     , jstring name)
1353 {
1354     WebCore::JSMainThreadNullState state;
1355     return JavaReturn<HTMLCollection>(env, WTF::getPtr(IMPL->getElementsByClassName(String(env, name))));
1356 }
1357 
1358 
1359 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_ElementImpl_matchesImpl(JNIEnv* env, jclass, jlong peer
1360     , jstring selectors)
1361 {
1362     WebCore::JSMainThreadNullState state;
1363     return raiseOnDOMError(env, IMPL->matches(String(env, selectors)));
1364 }
1365 
1366 
1367 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_closestImpl(JNIEnv* env, jclass, jlong peer
1368     , jstring selectors)
1369 {
1370     WebCore::JSMainThreadNullState state;
1371     return JavaReturn<Element>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->closest(String(env, selectors)))));
1372 }
1373 
1374 
1375 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_ElementImpl_webkitMatchesSelectorImpl(JNIEnv* env, jclass, jlong peer
1376     , jstring selectors)
1377 {
1378     WebCore::JSMainThreadNullState state;
1379     return raiseOnDOMError(env, IMPL->matches(String(env, selectors)));
1380 }
1381 
1382 
1383 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_webkitRequestFullScreenImpl(JNIEnv*, jclass, jlong peer
1384     , jshort)
1385 {
1386     WebCore::JSMainThreadNullState state;
1387     IMPL->webkitRequestFullscreen();
1388 }
1389 
1390 
1391 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_webkitRequestFullscreenImpl(JNIEnv*, jclass, jlong peer)
1392 {
1393     WebCore::JSMainThreadNullState state;
1394     IMPL->webkitRequestFullscreen();
1395 }
1396 
1397 
1398 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_ElementImpl_removeImpl(JNIEnv* env, jclass, jlong peer)
1399 {
1400     WebCore::JSMainThreadNullState state;
1401     raiseOnDOMError(env, IMPL->remove());
1402 }
1403 
1404 
1405 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_querySelectorImpl(JNIEnv* env, jclass, jlong peer
1406     , jstring selectors)
1407 {
1408     WebCore::JSMainThreadNullState state;
1409     return JavaReturn<Element>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->querySelector(String(env, selectors)))));
1410 }
1411 
1412 
1413 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_ElementImpl_querySelectorAllImpl(JNIEnv* env, jclass, jlong peer
1414     , jstring selectors)
1415 {
1416     WebCore::JSMainThreadNullState state;
1417     return JavaReturn<NodeList>(env, WTF::getPtr(raiseOnDOMError(env, IMPL->querySelectorAll(String(env, selectors)))));
1418 }
1419 
1420 
1421 }