OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 window->sessionStorage(IGNORE_EXCEPTION); | 1399 window->sessionStorage(IGNORE_EXCEPTION); |
1400 } | 1400 } |
1401 | 1401 |
1402 bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
Listener> listener, bool useCapture) | 1402 bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
Listener> listener, bool useCapture) |
1403 { | 1403 { |
1404 if (!EventTarget::addEventListener(eventType, listener, useCapture)) | 1404 if (!EventTarget::addEventListener(eventType, listener, useCapture)) |
1405 return false; | 1405 return false; |
1406 | 1406 |
1407 if (Document* document = this->document()) { | 1407 if (Document* document = this->document()) { |
1408 document->addListenerTypeIfNeeded(eventType); | 1408 document->addListenerTypeIfNeeded(eventType); |
1409 if (eventType == eventNames().mousewheelEvent) | 1409 if (eventType == eventNames().wheelEvent || eventType == eventNames().mo
usewheelEvent) |
1410 document->didAddWheelEventHandler(); | 1410 document->didAddWheelEventHandler(); |
1411 else if (eventNames().isTouchEventType(eventType)) | 1411 else if (eventNames().isTouchEventType(eventType)) |
1412 document->didAddTouchEventHandler(document); | 1412 document->didAddTouchEventHandler(document); |
1413 else if (eventType == eventNames().storageEvent) | 1413 else if (eventType == eventNames().storageEvent) |
1414 didAddStorageEventListener(this); | 1414 didAddStorageEventListener(this); |
1415 } | 1415 } |
1416 | 1416 |
1417 if (eventType == eventNames().unloadEvent) { | 1417 if (eventType == eventNames().unloadEvent) { |
1418 addUnloadEventListener(this); | 1418 addUnloadEventListener(this); |
1419 } else if (eventType == eventNames().beforeunloadEvent) { | 1419 } else if (eventType == eventNames().beforeunloadEvent) { |
(...skipping 16 matching lines...) Expand all Loading... |
1436 | 1436 |
1437 return true; | 1437 return true; |
1438 } | 1438 } |
1439 | 1439 |
1440 bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
* listener, bool useCapture) | 1440 bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
* listener, bool useCapture) |
1441 { | 1441 { |
1442 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) | 1442 if (!EventTarget::removeEventListener(eventType, listener, useCapture)) |
1443 return false; | 1443 return false; |
1444 | 1444 |
1445 if (Document* document = this->document()) { | 1445 if (Document* document = this->document()) { |
1446 if (eventType == eventNames().mousewheelEvent) | 1446 if (eventType == eventNames().wheelEvent || eventType == eventNames().mo
usewheelEvent) |
1447 document->didRemoveWheelEventHandler(); | 1447 document->didRemoveWheelEventHandler(); |
1448 else if (eventNames().isTouchEventType(eventType)) | 1448 else if (eventNames().isTouchEventType(eventType)) |
1449 document->didRemoveTouchEventHandler(document); | 1449 document->didRemoveTouchEventHandler(document); |
1450 } | 1450 } |
1451 | 1451 |
1452 if (eventType == eventNames().unloadEvent) | 1452 if (eventType == eventNames().unloadEvent) |
1453 removeUnloadEventListener(this); | 1453 removeUnloadEventListener(this); |
1454 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi
steners(this)) | 1454 else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadLi
steners(this)) |
1455 removeBeforeUnloadEventListener(this); | 1455 removeBeforeUnloadEventListener(this); |
1456 else if (eventType == eventNames().devicemotionEvent) { | 1456 else if (eventType == eventNames().devicemotionEvent) { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 return static_cast<DOMWindowLifecycleNotifier*>(LifecycleContext::lifecycleN
otifier()); | 1740 return static_cast<DOMWindowLifecycleNotifier*>(LifecycleContext::lifecycleN
otifier()); |
1741 } | 1741 } |
1742 | 1742 |
1743 PassOwnPtr<LifecycleNotifier> DOMWindow::createLifecycleNotifier() | 1743 PassOwnPtr<LifecycleNotifier> DOMWindow::createLifecycleNotifier() |
1744 { | 1744 { |
1745 return DOMWindowLifecycleNotifier::create(this); | 1745 return DOMWindowLifecycleNotifier::create(this); |
1746 } | 1746 } |
1747 | 1747 |
1748 | 1748 |
1749 } // namespace WebCore | 1749 } // namespace WebCore |
OLD | NEW |