Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Side by Side Diff: Source/core/page/DOMWindow.cpp

Issue 22859012: Add support for DOM Level 3 WheelEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename prefixedType() to legacyType() Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/page/DOMWindow.h ('k') | Source/core/page/Window.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 return static_cast<DOMWindowLifecycleNotifier*>(LifecycleContext::lifecycleN otifier()); 1761 return static_cast<DOMWindowLifecycleNotifier*>(LifecycleContext::lifecycleN otifier());
1762 } 1762 }
1763 1763
1764 PassOwnPtr<LifecycleNotifier> DOMWindow::createLifecycleNotifier() 1764 PassOwnPtr<LifecycleNotifier> DOMWindow::createLifecycleNotifier()
1765 { 1765 {
1766 return DOMWindowLifecycleNotifier::create(this); 1766 return DOMWindowLifecycleNotifier::create(this);
1767 } 1767 }
1768 1768
1769 1769
1770 } // namespace WebCore 1770 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/DOMWindow.h ('k') | Source/core/page/Window.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698