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 <JavaScriptCore/APICast.h>
  31 #include <WebCore/CSSStyleDeclaration.h>
  32 #include "DOMException.h"
  33 #include <WebCore/DOMSelection.h>
  34 #include <WebCore/DOMWindow.h>
  35 #include <WebCore/Document.h>
  36 #include <WebCore/Element.h>
  37 #include <WebCore/Event.h>
  38 #include <WebCore/EventListener.h>
  39 #include <WebCore/EventTarget.h>
  40 #include <WebCore/EventNames.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 #include "com_sun_webkit_dom_JSObject.h"
  49 
  50 using namespace WebCore;
  51 
  52 extern "C" {
  53 
  54 #define IMPL (static_cast<DOMWindow*>(jlong_to_ptr(peer)))
  55 
  56 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_dispose(JNIEnv*, jclass, jlong peer)
  57 {
  58     IMPL->deref();
  59 }
  60 
  61 
  62 // Attributes
  63 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getFrameElementImpl(JNIEnv* env, jclass, jlong peer)
  64 {
  65     WebCore::JSMainThreadNullState state;
  66     return JavaReturn<Element>(env, WTF::getPtr(IMPL->frameElement()));
  67 }
  68 
  69 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOffscreenBufferingImpl(JNIEnv*, jclass, jlong peer)
  70 {
  71     WebCore::JSMainThreadNullState state;
  72     return IMPL->offscreenBuffering();
  73 }
  74 
  75 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOuterHeightImpl(JNIEnv*, jclass, jlong peer)
  76 {
  77     WebCore::JSMainThreadNullState state;
  78     return IMPL->outerHeight();
  79 }
  80 
  81 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOuterWidthImpl(JNIEnv*, jclass, jlong peer)
  82 {
  83     WebCore::JSMainThreadNullState state;
  84     return IMPL->outerWidth();
  85 }
  86 
  87 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getInnerHeightImpl(JNIEnv*, jclass, jlong peer)
  88 {
  89     WebCore::JSMainThreadNullState state;
  90     return IMPL->innerHeight();
  91 }
  92 
  93 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getInnerWidthImpl(JNIEnv*, jclass, jlong peer)
  94 {
  95     WebCore::JSMainThreadNullState state;
  96     return IMPL->innerWidth();
  97 }
  98 
  99 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getScreenXImpl(JNIEnv*, jclass, jlong peer)
 100 {
 101     WebCore::JSMainThreadNullState state;
 102     return IMPL->screenX();
 103 }
 104 
 105 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getScreenYImpl(JNIEnv*, jclass, jlong peer)
 106 {
 107     WebCore::JSMainThreadNullState state;
 108     return IMPL->screenY();
 109 }
 110 
 111 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getScreenLeftImpl(JNIEnv*, jclass, jlong peer)
 112 {
 113     WebCore::JSMainThreadNullState state;
 114     return IMPL->screenLeft();
 115 }
 116 
 117 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getScreenTopImpl(JNIEnv*, jclass, jlong peer)
 118 {
 119     WebCore::JSMainThreadNullState state;
 120     return IMPL->screenTop();
 121 }
 122 
 123 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getScrollXImpl(JNIEnv*, jclass, jlong peer)
 124 {
 125     WebCore::JSMainThreadNullState state;
 126     return IMPL->scrollX();
 127 }
 128 
 129 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getScrollYImpl(JNIEnv*, jclass, jlong peer)
 130 {
 131     WebCore::JSMainThreadNullState state;
 132     return IMPL->scrollY();
 133 }
 134 
 135 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getPageXOffsetImpl(JNIEnv*, jclass, jlong)
 136 {
 137     WebCore::JSMainThreadNullState state;
 138     return {};
 139 }
 140 
 141 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getPageYOffsetImpl(JNIEnv*, jclass, jlong)
 142 {
 143     WebCore::JSMainThreadNullState state;
 144     return {};
 145 }
 146 
 147 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getClosedImpl(JNIEnv*, jclass, jlong peer)
 148 {
 149     WebCore::JSMainThreadNullState state;
 150     return IMPL->closed();
 151 }
 152 
 153 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getLengthImpl(JNIEnv*, jclass, jlong peer)
 154 {
 155     WebCore::JSMainThreadNullState state;
 156     return IMPL->length();
 157 }
 158 
 159 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getNameImpl(JNIEnv* env, jclass, jlong peer)
 160 {
 161     WebCore::JSMainThreadNullState state;
 162     return JavaReturn<String>(env, IMPL->name());
 163 }
 164 
 165 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setNameImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 166 {
 167     WebCore::JSMainThreadNullState state;
 168     IMPL->setName(String(env, value));
 169 }
 170 
 171 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getStatusImpl(JNIEnv* env, jclass, jlong peer)
 172 {
 173     WebCore::JSMainThreadNullState state;
 174     return JavaReturn<String>(env, IMPL->status());
 175 }
 176 
 177 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setStatusImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 178 {
 179     WebCore::JSMainThreadNullState state;
 180     IMPL->setStatus(String(env, value));
 181 }
 182 
 183 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getDefaultStatusImpl(JNIEnv* env, jclass, jlong peer)
 184 {
 185     WebCore::JSMainThreadNullState state;
 186     return JavaReturn<String>(env, IMPL->defaultStatus());
 187 }
 188 
 189 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setDefaultStatusImpl(JNIEnv* env, jclass, jlong peer, jstring value)
 190 {
 191     WebCore::JSMainThreadNullState state;
 192     IMPL->setDefaultStatus(String(env, value));
 193 }
 194 
 195 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getSelfImpl(JNIEnv* env, jclass, jlong peer)
 196 {
 197     WebCore::JSMainThreadNullState state;
 198     return JavaReturn<DOMWindow>(env, WTF::getPtr(IMPL->self()));
 199 }
 200 
 201 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getWindowImpl(JNIEnv* env, jclass, jlong peer)
 202 {
 203     WebCore::JSMainThreadNullState state;
 204     return JavaReturn<DOMWindow>(env, WTF::getPtr(IMPL->window()));
 205 }
 206 
 207 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getFramesImpl(JNIEnv* env, jclass, jlong peer)
 208 {
 209     WebCore::JSMainThreadNullState state;
 210     return JavaReturn<DOMWindow>(env, WTF::getPtr(IMPL->frames()));
 211 }
 212 
 213 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOpenerImpl(JNIEnv* env, jclass, jlong peer)
 214 {
 215     WebCore::JSMainThreadNullState state;
 216     return JavaReturn<DOMWindow>(env, WTF::getPtr(IMPL->opener()));
 217 }
 218 
 219 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getParentImpl(JNIEnv* env, jclass, jlong peer)
 220 {
 221     WebCore::JSMainThreadNullState state;
 222     return JavaReturn<DOMWindow>(env, WTF::getPtr(IMPL->parent()));
 223 }
 224 
 225 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getTopImpl(JNIEnv* env, jclass, jlong peer)
 226 {
 227     WebCore::JSMainThreadNullState state;
 228     return JavaReturn<DOMWindow>(env, WTF::getPtr(IMPL->top()));
 229 }
 230 
 231 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getDocumentExImpl(JNIEnv* env, jclass, jlong peer)
 232 {
 233     WebCore::JSMainThreadNullState state;
 234     return JavaReturn<Document>(env, WTF::getPtr(IMPL->document()));
 235 }
 236 
 237 JNIEXPORT jdouble JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getDevicePixelRatioImpl(JNIEnv*, jclass, jlong peer)
 238 {
 239     WebCore::JSMainThreadNullState state;
 240     return IMPL->devicePixelRatio();
 241 }
 242 
 243 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnanimationendImpl(JNIEnv* env, jclass, jlong peer)
 244 {
 245     WebCore::JSMainThreadNullState state;
 246     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().animationendEvent, mainThreadNormalWorld())));
 247 }
 248 
 249 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnanimationendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 250 {
 251     WebCore::JSMainThreadNullState state;
 252     IMPL->setAttributeEventListener(eventNames().animationendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 253 }
 254 
 255 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnanimationiterationImpl(JNIEnv* env, jclass, jlong peer)
 256 {
 257     WebCore::JSMainThreadNullState state;
 258     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().animationiterationEvent, mainThreadNormalWorld())));
 259 }
 260 
 261 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnanimationiterationImpl(JNIEnv*, jclass, jlong peer, jlong value)
 262 {
 263     WebCore::JSMainThreadNullState state;
 264     IMPL->setAttributeEventListener(eventNames().animationiterationEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 265 }
 266 
 267 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnanimationstartImpl(JNIEnv* env, jclass, jlong peer)
 268 {
 269     WebCore::JSMainThreadNullState state;
 270     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().animationstartEvent, mainThreadNormalWorld())));
 271 }
 272 
 273 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnanimationstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 274 {
 275     WebCore::JSMainThreadNullState state;
 276     IMPL->setAttributeEventListener(eventNames().animationstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 277 }
 278 
 279 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOntransitionendImpl(JNIEnv* env, jclass, jlong peer)
 280 {
 281     WebCore::JSMainThreadNullState state;
 282     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().transitionendEvent, mainThreadNormalWorld())));
 283 }
 284 
 285 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOntransitionendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 286 {
 287     WebCore::JSMainThreadNullState state;
 288     IMPL->setAttributeEventListener(eventNames().transitionendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 289 }
 290 
 291 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnwebkitanimationendImpl(JNIEnv* env, jclass, jlong peer)
 292 {
 293     WebCore::JSMainThreadNullState state;
 294     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().webkitAnimationEndEvent, mainThreadNormalWorld())));
 295 }
 296 
 297 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnwebkitanimationendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 298 {
 299     WebCore::JSMainThreadNullState state;
 300     IMPL->setAttributeEventListener(eventNames().webkitAnimationEndEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 301 }
 302 
 303 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnwebkitanimationiterationImpl(JNIEnv* env, jclass, jlong peer)
 304 {
 305     WebCore::JSMainThreadNullState state;
 306     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().webkitAnimationIterationEvent, mainThreadNormalWorld())));
 307 }
 308 
 309 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnwebkitanimationiterationImpl(JNIEnv*, jclass, jlong peer, jlong value)
 310 {
 311     WebCore::JSMainThreadNullState state;
 312     IMPL->setAttributeEventListener(eventNames().webkitAnimationIterationEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 313 }
 314 
 315 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnwebkitanimationstartImpl(JNIEnv* env, jclass, jlong peer)
 316 {
 317     WebCore::JSMainThreadNullState state;
 318     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().webkitAnimationStartEvent, mainThreadNormalWorld())));
 319 }
 320 
 321 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnwebkitanimationstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 322 {
 323     WebCore::JSMainThreadNullState state;
 324     IMPL->setAttributeEventListener(eventNames().webkitAnimationStartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 325 }
 326 
 327 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnwebkittransitionendImpl(JNIEnv* env, jclass, jlong peer)
 328 {
 329     WebCore::JSMainThreadNullState state;
 330     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().webkitTransitionEndEvent, mainThreadNormalWorld())));
 331 }
 332 
 333 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnwebkittransitionendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 334 {
 335     WebCore::JSMainThreadNullState state;
 336     IMPL->setAttributeEventListener(eventNames().webkitTransitionEndEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 337 }
 338 
 339 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnabortImpl(JNIEnv* env, jclass, jlong peer)
 340 {
 341     WebCore::JSMainThreadNullState state;
 342     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().abortEvent, mainThreadNormalWorld())));
 343 }
 344 
 345 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnabortImpl(JNIEnv*, jclass, jlong peer, jlong value)
 346 {
 347     WebCore::JSMainThreadNullState state;
 348     IMPL->setAttributeEventListener(eventNames().abortEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 349 }
 350 
 351 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnblurImpl(JNIEnv* env, jclass, jlong peer)
 352 {
 353     WebCore::JSMainThreadNullState state;
 354     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().blurEvent, mainThreadNormalWorld())));
 355 }
 356 
 357 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnblurImpl(JNIEnv*, jclass, jlong peer, jlong value)
 358 {
 359     WebCore::JSMainThreadNullState state;
 360     IMPL->setAttributeEventListener(eventNames().blurEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 361 }
 362 
 363 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOncanplayImpl(JNIEnv* env, jclass, jlong peer)
 364 {
 365     WebCore::JSMainThreadNullState state;
 366     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().canplayEvent, mainThreadNormalWorld())));
 367 }
 368 
 369 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOncanplayImpl(JNIEnv*, jclass, jlong peer, jlong value)
 370 {
 371     WebCore::JSMainThreadNullState state;
 372     IMPL->setAttributeEventListener(eventNames().canplayEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 373 }
 374 
 375 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOncanplaythroughImpl(JNIEnv* env, jclass, jlong peer)
 376 {
 377     WebCore::JSMainThreadNullState state;
 378     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().canplaythroughEvent, mainThreadNormalWorld())));
 379 }
 380 
 381 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOncanplaythroughImpl(JNIEnv*, jclass, jlong peer, jlong value)
 382 {
 383     WebCore::JSMainThreadNullState state;
 384     IMPL->setAttributeEventListener(eventNames().canplaythroughEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 385 }
 386 
 387 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnchangeImpl(JNIEnv* env, jclass, jlong peer)
 388 {
 389     WebCore::JSMainThreadNullState state;
 390     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().changeEvent, mainThreadNormalWorld())));
 391 }
 392 
 393 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnchangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 394 {
 395     WebCore::JSMainThreadNullState state;
 396     IMPL->setAttributeEventListener(eventNames().changeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 397 }
 398 
 399 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnclickImpl(JNIEnv* env, jclass, jlong peer)
 400 {
 401     WebCore::JSMainThreadNullState state;
 402     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().clickEvent, mainThreadNormalWorld())));
 403 }
 404 
 405 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnclickImpl(JNIEnv*, jclass, jlong peer, jlong value)
 406 {
 407     WebCore::JSMainThreadNullState state;
 408     IMPL->setAttributeEventListener(eventNames().clickEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 409 }
 410 
 411 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOncontextmenuImpl(JNIEnv* env, jclass, jlong peer)
 412 {
 413     WebCore::JSMainThreadNullState state;
 414     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().contextmenuEvent, mainThreadNormalWorld())));
 415 }
 416 
 417 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOncontextmenuImpl(JNIEnv*, jclass, jlong peer, jlong value)
 418 {
 419     WebCore::JSMainThreadNullState state;
 420     IMPL->setAttributeEventListener(eventNames().contextmenuEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 421 }
 422 
 423 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndblclickImpl(JNIEnv* env, jclass, jlong peer)
 424 {
 425     WebCore::JSMainThreadNullState state;
 426     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dblclickEvent, mainThreadNormalWorld())));
 427 }
 428 
 429 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndblclickImpl(JNIEnv*, jclass, jlong peer, jlong value)
 430 {
 431     WebCore::JSMainThreadNullState state;
 432     IMPL->setAttributeEventListener(eventNames().dblclickEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 433 }
 434 
 435 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndragImpl(JNIEnv* env, jclass, jlong peer)
 436 {
 437     WebCore::JSMainThreadNullState state;
 438     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragEvent, mainThreadNormalWorld())));
 439 }
 440 
 441 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndragImpl(JNIEnv*, jclass, jlong peer, jlong value)
 442 {
 443     WebCore::JSMainThreadNullState state;
 444     IMPL->setAttributeEventListener(eventNames().dragEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 445 }
 446 
 447 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndragendImpl(JNIEnv* env, jclass, jlong peer)
 448 {
 449     WebCore::JSMainThreadNullState state;
 450     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragendEvent, mainThreadNormalWorld())));
 451 }
 452 
 453 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndragendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 454 {
 455     WebCore::JSMainThreadNullState state;
 456     IMPL->setAttributeEventListener(eventNames().dragendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 457 }
 458 
 459 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndragenterImpl(JNIEnv* env, jclass, jlong peer)
 460 {
 461     WebCore::JSMainThreadNullState state;
 462     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragenterEvent, mainThreadNormalWorld())));
 463 }
 464 
 465 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndragenterImpl(JNIEnv*, jclass, jlong peer, jlong value)
 466 {
 467     WebCore::JSMainThreadNullState state;
 468     IMPL->setAttributeEventListener(eventNames().dragenterEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 469 }
 470 
 471 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndragleaveImpl(JNIEnv* env, jclass, jlong peer)
 472 {
 473     WebCore::JSMainThreadNullState state;
 474     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragleaveEvent, mainThreadNormalWorld())));
 475 }
 476 
 477 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndragleaveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 478 {
 479     WebCore::JSMainThreadNullState state;
 480     IMPL->setAttributeEventListener(eventNames().dragleaveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 481 }
 482 
 483 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndragoverImpl(JNIEnv* env, jclass, jlong peer)
 484 {
 485     WebCore::JSMainThreadNullState state;
 486     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragoverEvent, mainThreadNormalWorld())));
 487 }
 488 
 489 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndragoverImpl(JNIEnv*, jclass, jlong peer, jlong value)
 490 {
 491     WebCore::JSMainThreadNullState state;
 492     IMPL->setAttributeEventListener(eventNames().dragoverEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 493 }
 494 
 495 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndragstartImpl(JNIEnv* env, jclass, jlong peer)
 496 {
 497     WebCore::JSMainThreadNullState state;
 498     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dragstartEvent, mainThreadNormalWorld())));
 499 }
 500 
 501 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndragstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 502 {
 503     WebCore::JSMainThreadNullState state;
 504     IMPL->setAttributeEventListener(eventNames().dragstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 505 }
 506 
 507 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndropImpl(JNIEnv* env, jclass, jlong peer)
 508 {
 509     WebCore::JSMainThreadNullState state;
 510     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().dropEvent, mainThreadNormalWorld())));
 511 }
 512 
 513 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndropImpl(JNIEnv*, jclass, jlong peer, jlong value)
 514 {
 515     WebCore::JSMainThreadNullState state;
 516     IMPL->setAttributeEventListener(eventNames().dropEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 517 }
 518 
 519 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOndurationchangeImpl(JNIEnv* env, jclass, jlong peer)
 520 {
 521     WebCore::JSMainThreadNullState state;
 522     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().durationchangeEvent, mainThreadNormalWorld())));
 523 }
 524 
 525 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOndurationchangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 526 {
 527     WebCore::JSMainThreadNullState state;
 528     IMPL->setAttributeEventListener(eventNames().durationchangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 529 }
 530 
 531 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnemptiedImpl(JNIEnv* env, jclass, jlong peer)
 532 {
 533     WebCore::JSMainThreadNullState state;
 534     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().emptiedEvent, mainThreadNormalWorld())));
 535 }
 536 
 537 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnemptiedImpl(JNIEnv*, jclass, jlong peer, jlong value)
 538 {
 539     WebCore::JSMainThreadNullState state;
 540     IMPL->setAttributeEventListener(eventNames().emptiedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 541 }
 542 
 543 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnendedImpl(JNIEnv* env, jclass, jlong peer)
 544 {
 545     WebCore::JSMainThreadNullState state;
 546     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().endedEvent, mainThreadNormalWorld())));
 547 }
 548 
 549 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnendedImpl(JNIEnv*, jclass, jlong peer, jlong value)
 550 {
 551     WebCore::JSMainThreadNullState state;
 552     IMPL->setAttributeEventListener(eventNames().endedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 553 }
 554 
 555 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnerrorImpl(JNIEnv* env, jclass, jlong peer)
 556 {
 557     WebCore::JSMainThreadNullState state;
 558     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().errorEvent, mainThreadNormalWorld())));
 559 }
 560 
 561 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnerrorImpl(JNIEnv*, jclass, jlong peer, jlong value)
 562 {
 563     WebCore::JSMainThreadNullState state;
 564     IMPL->setAttributeEventListener(eventNames().errorEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 565 }
 566 
 567 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnfocusImpl(JNIEnv* env, jclass, jlong peer)
 568 {
 569     WebCore::JSMainThreadNullState state;
 570     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().focusEvent, mainThreadNormalWorld())));
 571 }
 572 
 573 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnfocusImpl(JNIEnv*, jclass, jlong peer, jlong value)
 574 {
 575     WebCore::JSMainThreadNullState state;
 576     IMPL->setAttributeEventListener(eventNames().focusEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 577 }
 578 
 579 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOninputImpl(JNIEnv* env, jclass, jlong peer)
 580 {
 581     WebCore::JSMainThreadNullState state;
 582     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().inputEvent, mainThreadNormalWorld())));
 583 }
 584 
 585 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOninputImpl(JNIEnv*, jclass, jlong peer, jlong value)
 586 {
 587     WebCore::JSMainThreadNullState state;
 588     IMPL->setAttributeEventListener(eventNames().inputEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 589 }
 590 
 591 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOninvalidImpl(JNIEnv* env, jclass, jlong peer)
 592 {
 593     WebCore::JSMainThreadNullState state;
 594     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().invalidEvent, mainThreadNormalWorld())));
 595 }
 596 
 597 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOninvalidImpl(JNIEnv*, jclass, jlong peer, jlong value)
 598 {
 599     WebCore::JSMainThreadNullState state;
 600     IMPL->setAttributeEventListener(eventNames().invalidEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 601 }
 602 
 603 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnkeydownImpl(JNIEnv* env, jclass, jlong peer)
 604 {
 605     WebCore::JSMainThreadNullState state;
 606     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keydownEvent, mainThreadNormalWorld())));
 607 }
 608 
 609 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnkeydownImpl(JNIEnv*, jclass, jlong peer, jlong value)
 610 {
 611     WebCore::JSMainThreadNullState state;
 612     IMPL->setAttributeEventListener(eventNames().keydownEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 613 }
 614 
 615 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnkeypressImpl(JNIEnv* env, jclass, jlong peer)
 616 {
 617     WebCore::JSMainThreadNullState state;
 618     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keypressEvent, mainThreadNormalWorld())));
 619 }
 620 
 621 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnkeypressImpl(JNIEnv*, jclass, jlong peer, jlong value)
 622 {
 623     WebCore::JSMainThreadNullState state;
 624     IMPL->setAttributeEventListener(eventNames().keypressEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 625 }
 626 
 627 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnkeyupImpl(JNIEnv* env, jclass, jlong peer)
 628 {
 629     WebCore::JSMainThreadNullState state;
 630     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().keyupEvent, mainThreadNormalWorld())));
 631 }
 632 
 633 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnkeyupImpl(JNIEnv*, jclass, jlong peer, jlong value)
 634 {
 635     WebCore::JSMainThreadNullState state;
 636     IMPL->setAttributeEventListener(eventNames().keyupEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 637 }
 638 
 639 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnloadImpl(JNIEnv* env, jclass, jlong peer)
 640 {
 641     WebCore::JSMainThreadNullState state;
 642     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadEvent, mainThreadNormalWorld())));
 643 }
 644 
 645 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnloadImpl(JNIEnv*, jclass, jlong peer, jlong value)
 646 {
 647     WebCore::JSMainThreadNullState state;
 648     IMPL->setAttributeEventListener(eventNames().loadEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 649 }
 650 
 651 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnloadeddataImpl(JNIEnv* env, jclass, jlong peer)
 652 {
 653     WebCore::JSMainThreadNullState state;
 654     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadeddataEvent, mainThreadNormalWorld())));
 655 }
 656 
 657 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnloadeddataImpl(JNIEnv*, jclass, jlong peer, jlong value)
 658 {
 659     WebCore::JSMainThreadNullState state;
 660     IMPL->setAttributeEventListener(eventNames().loadeddataEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 661 }
 662 
 663 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnloadedmetadataImpl(JNIEnv* env, jclass, jlong peer)
 664 {
 665     WebCore::JSMainThreadNullState state;
 666     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadedmetadataEvent, mainThreadNormalWorld())));
 667 }
 668 
 669 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnloadedmetadataImpl(JNIEnv*, jclass, jlong peer, jlong value)
 670 {
 671     WebCore::JSMainThreadNullState state;
 672     IMPL->setAttributeEventListener(eventNames().loadedmetadataEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 673 }
 674 
 675 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnloadstartImpl(JNIEnv* env, jclass, jlong peer)
 676 {
 677     WebCore::JSMainThreadNullState state;
 678     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().loadstartEvent, mainThreadNormalWorld())));
 679 }
 680 
 681 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnloadstartImpl(JNIEnv*, jclass, jlong peer, jlong value)
 682 {
 683     WebCore::JSMainThreadNullState state;
 684     IMPL->setAttributeEventListener(eventNames().loadstartEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 685 }
 686 
 687 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmousedownImpl(JNIEnv* env, jclass, jlong peer)
 688 {
 689     WebCore::JSMainThreadNullState state;
 690     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousedownEvent, mainThreadNormalWorld())));
 691 }
 692 
 693 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmousedownImpl(JNIEnv*, jclass, jlong peer, jlong value)
 694 {
 695     WebCore::JSMainThreadNullState state;
 696     IMPL->setAttributeEventListener(eventNames().mousedownEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 697 }
 698 
 699 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmouseenterImpl(JNIEnv* env, jclass, jlong peer)
 700 {
 701     WebCore::JSMainThreadNullState state;
 702     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseenterEvent, mainThreadNormalWorld())));
 703 }
 704 
 705 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmouseenterImpl(JNIEnv*, jclass, jlong peer, jlong value)
 706 {
 707     WebCore::JSMainThreadNullState state;
 708     IMPL->setAttributeEventListener(eventNames().mouseenterEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 709 }
 710 
 711 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmouseleaveImpl(JNIEnv* env, jclass, jlong peer)
 712 {
 713     WebCore::JSMainThreadNullState state;
 714     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseleaveEvent, mainThreadNormalWorld())));
 715 }
 716 
 717 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmouseleaveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 718 {
 719     WebCore::JSMainThreadNullState state;
 720     IMPL->setAttributeEventListener(eventNames().mouseleaveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 721 }
 722 
 723 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmousemoveImpl(JNIEnv* env, jclass, jlong peer)
 724 {
 725     WebCore::JSMainThreadNullState state;
 726     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousemoveEvent, mainThreadNormalWorld())));
 727 }
 728 
 729 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmousemoveImpl(JNIEnv*, jclass, jlong peer, jlong value)
 730 {
 731     WebCore::JSMainThreadNullState state;
 732     IMPL->setAttributeEventListener(eventNames().mousemoveEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 733 }
 734 
 735 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmouseoutImpl(JNIEnv* env, jclass, jlong peer)
 736 {
 737     WebCore::JSMainThreadNullState state;
 738     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseoutEvent, mainThreadNormalWorld())));
 739 }
 740 
 741 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmouseoutImpl(JNIEnv*, jclass, jlong peer, jlong value)
 742 {
 743     WebCore::JSMainThreadNullState state;
 744     IMPL->setAttributeEventListener(eventNames().mouseoutEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 745 }
 746 
 747 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmouseoverImpl(JNIEnv* env, jclass, jlong peer)
 748 {
 749     WebCore::JSMainThreadNullState state;
 750     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseoverEvent, mainThreadNormalWorld())));
 751 }
 752 
 753 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmouseoverImpl(JNIEnv*, jclass, jlong peer, jlong value)
 754 {
 755     WebCore::JSMainThreadNullState state;
 756     IMPL->setAttributeEventListener(eventNames().mouseoverEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 757 }
 758 
 759 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmouseupImpl(JNIEnv* env, jclass, jlong peer)
 760 {
 761     WebCore::JSMainThreadNullState state;
 762     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mouseupEvent, mainThreadNormalWorld())));
 763 }
 764 
 765 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmouseupImpl(JNIEnv*, jclass, jlong peer, jlong value)
 766 {
 767     WebCore::JSMainThreadNullState state;
 768     IMPL->setAttributeEventListener(eventNames().mouseupEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 769 }
 770 
 771 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmousewheelImpl(JNIEnv* env, jclass, jlong peer)
 772 {
 773     WebCore::JSMainThreadNullState state;
 774     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().mousewheelEvent, mainThreadNormalWorld())));
 775 }
 776 
 777 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmousewheelImpl(JNIEnv*, jclass, jlong peer, jlong value)
 778 {
 779     WebCore::JSMainThreadNullState state;
 780     IMPL->setAttributeEventListener(eventNames().mousewheelEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 781 }
 782 
 783 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnpauseImpl(JNIEnv* env, jclass, jlong peer)
 784 {
 785     WebCore::JSMainThreadNullState state;
 786     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().pauseEvent, mainThreadNormalWorld())));
 787 }
 788 
 789 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnpauseImpl(JNIEnv*, jclass, jlong peer, jlong value)
 790 {
 791     WebCore::JSMainThreadNullState state;
 792     IMPL->setAttributeEventListener(eventNames().pauseEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 793 }
 794 
 795 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnplayImpl(JNIEnv* env, jclass, jlong peer)
 796 {
 797     WebCore::JSMainThreadNullState state;
 798     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().playEvent, mainThreadNormalWorld())));
 799 }
 800 
 801 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnplayImpl(JNIEnv*, jclass, jlong peer, jlong value)
 802 {
 803     WebCore::JSMainThreadNullState state;
 804     IMPL->setAttributeEventListener(eventNames().playEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 805 }
 806 
 807 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnplayingImpl(JNIEnv* env, jclass, jlong peer)
 808 {
 809     WebCore::JSMainThreadNullState state;
 810     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().playingEvent, mainThreadNormalWorld())));
 811 }
 812 
 813 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnplayingImpl(JNIEnv*, jclass, jlong peer, jlong value)
 814 {
 815     WebCore::JSMainThreadNullState state;
 816     IMPL->setAttributeEventListener(eventNames().playingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 817 }
 818 
 819 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnprogressImpl(JNIEnv* env, jclass, jlong peer)
 820 {
 821     WebCore::JSMainThreadNullState state;
 822     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().progressEvent, mainThreadNormalWorld())));
 823 }
 824 
 825 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnprogressImpl(JNIEnv*, jclass, jlong peer, jlong value)
 826 {
 827     WebCore::JSMainThreadNullState state;
 828     IMPL->setAttributeEventListener(eventNames().progressEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 829 }
 830 
 831 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnratechangeImpl(JNIEnv* env, jclass, jlong peer)
 832 {
 833     WebCore::JSMainThreadNullState state;
 834     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().ratechangeEvent, mainThreadNormalWorld())));
 835 }
 836 
 837 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnratechangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 838 {
 839     WebCore::JSMainThreadNullState state;
 840     IMPL->setAttributeEventListener(eventNames().ratechangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 841 }
 842 
 843 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnresetImpl(JNIEnv* env, jclass, jlong peer)
 844 {
 845     WebCore::JSMainThreadNullState state;
 846     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().resetEvent, mainThreadNormalWorld())));
 847 }
 848 
 849 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnresetImpl(JNIEnv*, jclass, jlong peer, jlong value)
 850 {
 851     WebCore::JSMainThreadNullState state;
 852     IMPL->setAttributeEventListener(eventNames().resetEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 853 }
 854 
 855 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnresizeImpl(JNIEnv* env, jclass, jlong peer)
 856 {
 857     WebCore::JSMainThreadNullState state;
 858     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().resizeEvent, mainThreadNormalWorld())));
 859 }
 860 
 861 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnresizeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 862 {
 863     WebCore::JSMainThreadNullState state;
 864     IMPL->setAttributeEventListener(eventNames().resizeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 865 }
 866 
 867 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnscrollImpl(JNIEnv* env, jclass, jlong peer)
 868 {
 869     WebCore::JSMainThreadNullState state;
 870     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().scrollEvent, mainThreadNormalWorld())));
 871 }
 872 
 873 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnscrollImpl(JNIEnv*, jclass, jlong peer, jlong value)
 874 {
 875     WebCore::JSMainThreadNullState state;
 876     IMPL->setAttributeEventListener(eventNames().scrollEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 877 }
 878 
 879 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnseekedImpl(JNIEnv* env, jclass, jlong peer)
 880 {
 881     WebCore::JSMainThreadNullState state;
 882     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().seekedEvent, mainThreadNormalWorld())));
 883 }
 884 
 885 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnseekedImpl(JNIEnv*, jclass, jlong peer, jlong value)
 886 {
 887     WebCore::JSMainThreadNullState state;
 888     IMPL->setAttributeEventListener(eventNames().seekedEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 889 }
 890 
 891 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnseekingImpl(JNIEnv* env, jclass, jlong peer)
 892 {
 893     WebCore::JSMainThreadNullState state;
 894     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().seekingEvent, mainThreadNormalWorld())));
 895 }
 896 
 897 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnseekingImpl(JNIEnv*, jclass, jlong peer, jlong value)
 898 {
 899     WebCore::JSMainThreadNullState state;
 900     IMPL->setAttributeEventListener(eventNames().seekingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 901 }
 902 
 903 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnselectImpl(JNIEnv* env, jclass, jlong peer)
 904 {
 905     WebCore::JSMainThreadNullState state;
 906     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().selectEvent, mainThreadNormalWorld())));
 907 }
 908 
 909 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnselectImpl(JNIEnv*, jclass, jlong peer, jlong value)
 910 {
 911     WebCore::JSMainThreadNullState state;
 912     IMPL->setAttributeEventListener(eventNames().selectEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 913 }
 914 
 915 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnstalledImpl(JNIEnv* env, jclass, jlong peer)
 916 {
 917     WebCore::JSMainThreadNullState state;
 918     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().stalledEvent, mainThreadNormalWorld())));
 919 }
 920 
 921 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnstalledImpl(JNIEnv*, jclass, jlong peer, jlong value)
 922 {
 923     WebCore::JSMainThreadNullState state;
 924     IMPL->setAttributeEventListener(eventNames().stalledEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 925 }
 926 
 927 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnsubmitImpl(JNIEnv* env, jclass, jlong peer)
 928 {
 929     WebCore::JSMainThreadNullState state;
 930     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().submitEvent, mainThreadNormalWorld())));
 931 }
 932 
 933 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnsubmitImpl(JNIEnv*, jclass, jlong peer, jlong value)
 934 {
 935     WebCore::JSMainThreadNullState state;
 936     IMPL->setAttributeEventListener(eventNames().submitEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 937 }
 938 
 939 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnsuspendImpl(JNIEnv* env, jclass, jlong peer)
 940 {
 941     WebCore::JSMainThreadNullState state;
 942     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().suspendEvent, mainThreadNormalWorld())));
 943 }
 944 
 945 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnsuspendImpl(JNIEnv*, jclass, jlong peer, jlong value)
 946 {
 947     WebCore::JSMainThreadNullState state;
 948     IMPL->setAttributeEventListener(eventNames().suspendEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 949 }
 950 
 951 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOntimeupdateImpl(JNIEnv* env, jclass, jlong peer)
 952 {
 953     WebCore::JSMainThreadNullState state;
 954     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().timeupdateEvent, mainThreadNormalWorld())));
 955 }
 956 
 957 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOntimeupdateImpl(JNIEnv*, jclass, jlong peer, jlong value)
 958 {
 959     WebCore::JSMainThreadNullState state;
 960     IMPL->setAttributeEventListener(eventNames().timeupdateEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 961 }
 962 
 963 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnvolumechangeImpl(JNIEnv* env, jclass, jlong peer)
 964 {
 965     WebCore::JSMainThreadNullState state;
 966     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().volumechangeEvent, mainThreadNormalWorld())));
 967 }
 968 
 969 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnvolumechangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
 970 {
 971     WebCore::JSMainThreadNullState state;
 972     IMPL->setAttributeEventListener(eventNames().volumechangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 973 }
 974 
 975 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnwaitingImpl(JNIEnv* env, jclass, jlong peer)
 976 {
 977     WebCore::JSMainThreadNullState state;
 978     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().waitingEvent, mainThreadNormalWorld())));
 979 }
 980 
 981 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnwaitingImpl(JNIEnv*, jclass, jlong peer, jlong value)
 982 {
 983     WebCore::JSMainThreadNullState state;
 984     IMPL->setAttributeEventListener(eventNames().waitingEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 985 }
 986 
 987 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnsearchImpl(JNIEnv* env, jclass, jlong peer)
 988 {
 989     WebCore::JSMainThreadNullState state;
 990     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().searchEvent, mainThreadNormalWorld())));
 991 }
 992 
 993 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnsearchImpl(JNIEnv*, jclass, jlong peer, jlong value)
 994 {
 995     WebCore::JSMainThreadNullState state;
 996     IMPL->setAttributeEventListener(eventNames().searchEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
 997 }
 998 
 999 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnwheelImpl(JNIEnv* env, jclass, jlong peer)
1000 {
1001     WebCore::JSMainThreadNullState state;
1002     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().wheelEvent, mainThreadNormalWorld())));
1003 }
1004 
1005 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnwheelImpl(JNIEnv*, jclass, jlong peer, jlong value)
1006 {
1007     WebCore::JSMainThreadNullState state;
1008     IMPL->setAttributeEventListener(eventNames().wheelEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1009 }
1010 
1011 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnbeforeunloadImpl(JNIEnv* env, jclass, jlong peer)
1012 {
1013     WebCore::JSMainThreadNullState state;
1014     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().beforeunloadEvent, mainThreadNormalWorld())));
1015 }
1016 
1017 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnbeforeunloadImpl(JNIEnv*, jclass, jlong peer, jlong value)
1018 {
1019     WebCore::JSMainThreadNullState state;
1020     IMPL->setAttributeEventListener(eventNames().beforeunloadEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1021 }
1022 
1023 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnhashchangeImpl(JNIEnv* env, jclass, jlong peer)
1024 {
1025     WebCore::JSMainThreadNullState state;
1026     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().hashchangeEvent, mainThreadNormalWorld())));
1027 }
1028 
1029 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnhashchangeImpl(JNIEnv*, jclass, jlong peer, jlong value)
1030 {
1031     WebCore::JSMainThreadNullState state;
1032     IMPL->setAttributeEventListener(eventNames().hashchangeEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1033 }
1034 
1035 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnmessageImpl(JNIEnv* env, jclass, jlong peer)
1036 {
1037     WebCore::JSMainThreadNullState state;
1038     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().messageEvent, mainThreadNormalWorld())));
1039 }
1040 
1041 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnmessageImpl(JNIEnv*, jclass, jlong peer, jlong value)
1042 {
1043     WebCore::JSMainThreadNullState state;
1044     IMPL->setAttributeEventListener(eventNames().messageEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1045 }
1046 
1047 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnofflineImpl(JNIEnv* env, jclass, jlong peer)
1048 {
1049     WebCore::JSMainThreadNullState state;
1050     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().offlineEvent, mainThreadNormalWorld())));
1051 }
1052 
1053 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnofflineImpl(JNIEnv*, jclass, jlong peer, jlong value)
1054 {
1055     WebCore::JSMainThreadNullState state;
1056     IMPL->setAttributeEventListener(eventNames().offlineEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1057 }
1058 
1059 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnonlineImpl(JNIEnv* env, jclass, jlong peer)
1060 {
1061     WebCore::JSMainThreadNullState state;
1062     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().onlineEvent, mainThreadNormalWorld())));
1063 }
1064 
1065 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnonlineImpl(JNIEnv*, jclass, jlong peer, jlong value)
1066 {
1067     WebCore::JSMainThreadNullState state;
1068     IMPL->setAttributeEventListener(eventNames().onlineEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1069 }
1070 
1071 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnpagehideImpl(JNIEnv* env, jclass, jlong peer)
1072 {
1073     WebCore::JSMainThreadNullState state;
1074     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().pagehideEvent, mainThreadNormalWorld())));
1075 }
1076 
1077 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnpagehideImpl(JNIEnv*, jclass, jlong peer, jlong value)
1078 {
1079     WebCore::JSMainThreadNullState state;
1080     IMPL->setAttributeEventListener(eventNames().pagehideEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1081 }
1082 
1083 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnpageshowImpl(JNIEnv* env, jclass, jlong peer)
1084 {
1085     WebCore::JSMainThreadNullState state;
1086     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().pageshowEvent, mainThreadNormalWorld())));
1087 }
1088 
1089 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnpageshowImpl(JNIEnv*, jclass, jlong peer, jlong value)
1090 {
1091     WebCore::JSMainThreadNullState state;
1092     IMPL->setAttributeEventListener(eventNames().pageshowEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1093 }
1094 
1095 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnpopstateImpl(JNIEnv* env, jclass, jlong peer)
1096 {
1097     WebCore::JSMainThreadNullState state;
1098     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().popstateEvent, mainThreadNormalWorld())));
1099 }
1100 
1101 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnpopstateImpl(JNIEnv*, jclass, jlong peer, jlong value)
1102 {
1103     WebCore::JSMainThreadNullState state;
1104     IMPL->setAttributeEventListener(eventNames().popstateEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1105 }
1106 
1107 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnstorageImpl(JNIEnv* env, jclass, jlong peer)
1108 {
1109     WebCore::JSMainThreadNullState state;
1110     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().storageEvent, mainThreadNormalWorld())));
1111 }
1112 
1113 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnstorageImpl(JNIEnv*, jclass, jlong peer, jlong value)
1114 {
1115     WebCore::JSMainThreadNullState state;
1116     IMPL->setAttributeEventListener(eventNames().storageEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1117 }
1118 
1119 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getOnunloadImpl(JNIEnv* env, jclass, jlong peer)
1120 {
1121     WebCore::JSMainThreadNullState state;
1122     return JavaReturn<EventListener>(env, WTF::getPtr(IMPL->attributeEventListener(eventNames().unloadEvent, mainThreadNormalWorld())));
1123 }
1124 
1125 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_setOnunloadImpl(JNIEnv*, jclass, jlong peer, jlong value)
1126 {
1127     WebCore::JSMainThreadNullState state;
1128     IMPL->setAttributeEventListener(eventNames().unloadEvent, static_cast<EventListener*>(jlong_to_ptr(value)), mainThreadNormalWorld());
1129 }
1130 
1131 
1132 // Functions
1133 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getSelectionImpl(JNIEnv* env, jclass, jlong peer)
1134 {
1135     WebCore::JSMainThreadNullState state;
1136     return JavaReturn<DOMSelection>(env, WTF::getPtr(IMPL->getSelection()));
1137 }
1138 
1139 
1140 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_focusImpl(JNIEnv*, jclass, jlong peer)
1141 {
1142     WebCore::JSMainThreadNullState state;
1143     IMPL->focus();
1144 }
1145 
1146 
1147 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_blurImpl(JNIEnv*, jclass, jlong peer)
1148 {
1149     WebCore::JSMainThreadNullState state;
1150     IMPL->blur();
1151 }
1152 
1153 
1154 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_closeImpl(JNIEnv*, jclass, jlong peer)
1155 {
1156     WebCore::JSMainThreadNullState state;
1157     IMPL->close();
1158 }
1159 
1160 
1161 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_printImpl(JNIEnv*, jclass, jlong peer)
1162 {
1163     WebCore::JSMainThreadNullState state;
1164     IMPL->print();
1165 }
1166 
1167 
1168 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_stopImpl(JNIEnv*, jclass, jlong peer)
1169 {
1170     WebCore::JSMainThreadNullState state;
1171     IMPL->stop();
1172 }
1173 
1174 
1175 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_alertImpl(JNIEnv* env, jclass, jlong peer
1176     , jstring message)
1177 {
1178     WebCore::JSMainThreadNullState state;
1179     IMPL->alert(String(env, message));
1180 }
1181 
1182 
1183 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_confirmImpl(JNIEnv* env, jclass, jlong peer
1184     , jstring message)
1185 {
1186     WebCore::JSMainThreadNullState state;
1187     return IMPL->confirm(String(env, message));
1188 }
1189 
1190 
1191 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_promptImpl(JNIEnv* env, jclass, jlong peer
1192     , jstring message
1193     , jstring defaultValue)
1194 {
1195     WebCore::JSMainThreadNullState state;
1196     return JavaReturn<String>(env, IMPL->prompt(String(env, message)
1197             , String(env, defaultValue)));
1198 }
1199 
1200 
1201 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_findImpl(JNIEnv* env, jclass, jlong peer
1202     , jstring string
1203     , jboolean caseSensitive
1204     , jboolean backwards
1205     , jboolean wrap
1206     , jboolean wholeWord
1207     , jboolean searchInFrames
1208     , jboolean showDialog)
1209 {
1210     WebCore::JSMainThreadNullState state;
1211     return IMPL->find(String(env, string)
1212             , caseSensitive
1213             , backwards
1214             , wrap
1215             , wholeWord
1216             , searchInFrames
1217             , showDialog);
1218 }
1219 
1220 
1221 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_scrollByImpl(JNIEnv*, jclass, jlong peer
1222     , jint x
1223     , jint y)
1224 {
1225     WebCore::JSMainThreadNullState state;
1226     IMPL->scrollBy(x
1227             , y);
1228 }
1229 
1230 
1231 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_scrollToImpl(JNIEnv*, jclass, jlong peer
1232     , jint x
1233     , jint y)
1234 {
1235     WebCore::JSMainThreadNullState state;
1236     IMPL->scrollTo(x
1237             , y);
1238 }
1239 
1240 
1241 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_scrollImpl(JNIEnv*, jclass, jlong peer
1242     , jint x
1243     , jint y)
1244 {
1245     WebCore::JSMainThreadNullState state;
1246     IMPL->scrollTo(x, y);
1247 }
1248 
1249 
1250 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_moveByImpl(JNIEnv*, jclass, jlong peer
1251     , jfloat x
1252     , jfloat y)
1253 {
1254     WebCore::JSMainThreadNullState state;
1255     IMPL->moveBy(x
1256             , y);
1257 }
1258 
1259 
1260 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_moveToImpl(JNIEnv*, jclass, jlong peer
1261     , jfloat x
1262     , jfloat y)
1263 {
1264     WebCore::JSMainThreadNullState state;
1265     IMPL->moveTo(x
1266             , y);
1267 }
1268 
1269 
1270 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_resizeByImpl(JNIEnv*, jclass, jlong peer
1271     , jfloat x
1272     , jfloat y)
1273 {
1274     WebCore::JSMainThreadNullState state;
1275     IMPL->resizeBy(x
1276             , y);
1277 }
1278 
1279 
1280 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_resizeToImpl(JNIEnv*, jclass, jlong peer
1281     , jfloat width
1282     , jfloat height)
1283 {
1284     WebCore::JSMainThreadNullState state;
1285     IMPL->resizeTo(width
1286             , height);
1287 }
1288 
1289 
1290 JNIEXPORT jlong JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_getComputedStyleImpl(JNIEnv* env, jclass, jlong peer
1291     , jlong element
1292     , jstring pseudoElement)
1293 {
1294     WebCore::JSMainThreadNullState state;
1295     if (!element) {
1296         raiseTypeErrorException(env);
1297         return {};
1298     }
1299     return JavaReturn<CSSStyleDeclaration>(env, WTF::getPtr(IMPL->getComputedStyle(*static_cast<Element*>(jlong_to_ptr(element))
1300             , String(env, pseudoElement))));
1301 }
1302 
1303 
1304 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_captureEventsImpl(JNIEnv*, jclass, jlong peer)
1305 {
1306     WebCore::JSMainThreadNullState state;
1307     IMPL->captureEvents();
1308 }
1309 
1310 
1311 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_releaseEventsImpl(JNIEnv*, jclass, jlong peer)
1312 {
1313     WebCore::JSMainThreadNullState state;
1314     IMPL->releaseEvents();
1315 }
1316 
1317 
1318 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_addEventListenerImpl(JNIEnv* env, jclass, jlong peer
1319     , jstring type
1320     , jlong listener
1321     , jboolean useCapture)
1322 {
1323     WebCore::JSMainThreadNullState state;
1324     IMPL->addEventListenerForBindings(String(env, type)
1325             , static_cast<EventListener*>(jlong_to_ptr(listener))
1326             , static_cast<bool>(useCapture));
1327 }
1328 
1329 
1330 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_removeEventListenerImpl(JNIEnv* env, jclass, jlong peer
1331     , jstring type
1332     , jlong listener
1333     , jboolean useCapture)
1334 {
1335     WebCore::JSMainThreadNullState state;
1336     IMPL->removeEventListenerForBindings(String(env, type)
1337             , static_cast<EventListener*>(jlong_to_ptr(listener))
1338             , static_cast<bool>(useCapture));
1339 }
1340 
1341 
1342 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_dispatchEventImpl(JNIEnv* env, jclass, jlong peer
1343     , jlong event)
1344 {
1345     WebCore::JSMainThreadNullState state;
1346     if (!event) {
1347         raiseTypeErrorException(env);
1348         return JNI_FALSE;
1349     }
1350     return raiseOnDOMError(env, IMPL->dispatchEventForBindings(*static_cast<Event*>(jlong_to_ptr(event))));
1351 }
1352 
1353 
1354 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_atobImpl(JNIEnv* env, jclass, jlong peer
1355     , jstring string)
1356 {
1357     WebCore::JSMainThreadNullState state;
1358     return JavaReturn<String>(env, raiseOnDOMError(env, IMPL->atob(String(env, string))));
1359 }
1360 
1361 
1362 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_btoaImpl(JNIEnv* env, jclass, jlong peer
1363     , jstring string)
1364 {
1365     WebCore::JSMainThreadNullState state;
1366     return JavaReturn<String>(env, raiseOnDOMError(env, IMPL->btoa(String(env, string))));
1367 }
1368 
1369 
1370 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_clearTimeoutImpl(JNIEnv*, jclass, jlong peer
1371     , jint handle)
1372 {
1373     WebCore::JSMainThreadNullState state;
1374     IMPL->clearTimeout(handle);
1375 }
1376 
1377 
1378 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_DOMWindowImpl_clearIntervalImpl(JNIEnv*, jclass, jlong peer
1379     , jint handle)
1380 {
1381     WebCore::JSMainThreadNullState state;
1382     IMPL->clearInterval(handle);
1383 }
1384 
1385 
1386 }