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

Side by Side Diff: Source/core/dom/Node.cpp

Issue 26429003: Cleanup: Add toDeviceMotionEvent and toDeviceOrientationEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated to ToT Created 7 years, 2 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
« no previous file with comments | « no previous file | Source/core/events/GestureEvent.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after
2358 frame->eventHandler()->defaultKeyboardEventHandler(toKeyboardEve nt(event)); 2358 frame->eventHandler()->defaultKeyboardEventHandler(toKeyboardEve nt(event));
2359 } 2359 }
2360 } else if (eventType == EventTypeNames::click) { 2360 } else if (eventType == EventTypeNames::click) {
2361 int detail = event->isUIEvent() ? static_cast<UIEvent*>(event)->detail() : 0; 2361 int detail = event->isUIEvent() ? static_cast<UIEvent*>(event)->detail() : 0;
2362 if (dispatchDOMActivateEvent(detail, event)) 2362 if (dispatchDOMActivateEvent(detail, event))
2363 event->setDefaultHandled(); 2363 event->setDefaultHandled();
2364 } else if (eventType == EventTypeNames::contextmenu) { 2364 } else if (eventType == EventTypeNames::contextmenu) {
2365 if (Page* page = document().page()) 2365 if (Page* page = document().page())
2366 page->contextMenuController().handleContextMenuEvent(event); 2366 page->contextMenuController().handleContextMenuEvent(event);
2367 } else if (eventType == EventTypeNames::textInput) { 2367 } else if (eventType == EventTypeNames::textInput) {
2368 if (event->hasInterface(EventNames::TextEvent)) 2368 if (event->hasInterface(EventNames::TextEvent)) {
2369 if (Frame* frame = document().frame()) 2369 if (Frame* frame = document().frame())
2370 frame->eventHandler()->defaultTextInputEventHandler(static_cast< TextEvent*>(event)); 2370 frame->eventHandler()->defaultTextInputEventHandler(toTextEvent( event));
2371 }
2371 #if OS(WIN) 2372 #if OS(WIN)
2372 } else if (eventType == EventTypeNames::mousedown && event->isMouseEvent()) { 2373 } else if (eventType == EventTypeNames::mousedown && event->isMouseEvent()) {
2373 MouseEvent* mouseEvent = toMouseEvent(event); 2374 MouseEvent* mouseEvent = toMouseEvent(event);
2374 if (mouseEvent->button() == MiddleButton) { 2375 if (mouseEvent->button() == MiddleButton) {
2375 if (enclosingLinkEventParentOrSelf()) 2376 if (enclosingLinkEventParentOrSelf())
2376 return; 2377 return;
2377 2378
2378 RenderObject* renderer = this->renderer(); 2379 RenderObject* renderer = this->renderer();
2379 while (renderer && (!renderer->isBox() || !toRenderBox(renderer)->ca nBeScrolledAndHasScrollableArea())) 2380 while (renderer && (!renderer->isBox() || !toRenderBox(renderer)->ca nBeScrolledAndHasScrollableArea()))
2380 renderer = renderer->parent(); 2381 renderer = renderer->parent();
2381 2382
2382 if (renderer) { 2383 if (renderer) {
2383 if (Frame* frame = document().frame()) 2384 if (Frame* frame = document().frame())
2384 frame->eventHandler()->startPanScrolling(renderer); 2385 frame->eventHandler()->startPanScrolling(renderer);
2385 } 2386 }
2386 } 2387 }
2387 #endif 2388 #endif
2388 } else if ((eventType == EventTypeNames::wheel || eventType == EventTypeName s::mousewheel) && event->hasInterface(EventNames::WheelEvent)) { 2389 } else if ((eventType == EventTypeNames::wheel || eventType == EventTypeName s::mousewheel) && event->hasInterface(EventNames::WheelEvent)) {
2389 WheelEvent* wheelEvent = static_cast<WheelEvent*>(event); 2390 WheelEvent* wheelEvent = toWheelEvent(event);
2390 2391
2391 // If we don't have a renderer, send the wheel event to the first node w e find with a renderer. 2392 // If we don't have a renderer, send the wheel event to the first node w e find with a renderer.
2392 // This is needed for <option> and <optgroup> elements so that <select>s get a wheel scroll. 2393 // This is needed for <option> and <optgroup> elements so that <select>s get a wheel scroll.
2393 Node* startNode = this; 2394 Node* startNode = this;
2394 while (startNode && !startNode->renderer()) 2395 while (startNode && !startNode->renderer())
2395 startNode = startNode->parentOrShadowHostNode(); 2396 startNode = startNode->parentOrShadowHostNode();
2396 2397
2397 if (startNode && startNode->renderer()) 2398 if (startNode && startNode->renderer())
2398 if (Frame* frame = document().frame()) 2399 if (Frame* frame = document().frame())
2399 frame->eventHandler()->defaultWheelEventHandler(startNode, wheel Event); 2400 frame->eventHandler()->defaultWheelEventHandler(startNode, wheel Event);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
2633 node->showTreeForThis(); 2634 node->showTreeForThis();
2634 } 2635 }
2635 2636
2636 void showNodePath(const WebCore::Node* node) 2637 void showNodePath(const WebCore::Node* node)
2637 { 2638 {
2638 if (node) 2639 if (node)
2639 node->showNodePathForThis(); 2640 node->showNodePathForThis();
2640 } 2641 }
2641 2642
2642 #endif 2643 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/events/GestureEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698