OLD | NEW |
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 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 frame->eventHandler()->defaultKeyboardEventHandler(toKeyboardEve
nt(event)); | 2357 frame->eventHandler()->defaultKeyboardEventHandler(toKeyboardEve
nt(event)); |
2358 } | 2358 } |
2359 } else if (eventType == EventNames::click) { | 2359 } else if (eventType == EventNames::click) { |
2360 int detail = event->isUIEvent() ? static_cast<UIEvent*>(event)->detail()
: 0; | 2360 int detail = event->isUIEvent() ? static_cast<UIEvent*>(event)->detail()
: 0; |
2361 if (dispatchDOMActivateEvent(detail, event)) | 2361 if (dispatchDOMActivateEvent(detail, event)) |
2362 event->setDefaultHandled(); | 2362 event->setDefaultHandled(); |
2363 } else if (eventType == EventNames::contextmenu) { | 2363 } else if (eventType == EventNames::contextmenu) { |
2364 if (Page* page = document().page()) | 2364 if (Page* page = document().page()) |
2365 page->contextMenuController().handleContextMenuEvent(event); | 2365 page->contextMenuController().handleContextMenuEvent(event); |
2366 } else if (eventType == EventNames::textInput) { | 2366 } else if (eventType == EventNames::textInput) { |
2367 if (event->hasInterface(eventNames().interfaceForTextEvent)) | 2367 if (event->hasInterface(eventNames().interfaceForTextEvent)) { |
2368 if (Frame* frame = document().frame()) | 2368 if (Frame* frame = document().frame()) |
2369 frame->eventHandler()->defaultTextInputEventHandler(static_cast<
TextEvent*>(event)); | 2369 frame->eventHandler()->defaultTextInputEventHandler(toTextEvent(
event)); |
| 2370 } |
2370 #if OS(WIN) | 2371 #if OS(WIN) |
2371 } else if (eventType == EventNames::mousedown && event->isMouseEvent()) { | 2372 } else if (eventType == EventNames::mousedown && event->isMouseEvent()) { |
2372 MouseEvent* mouseEvent = toMouseEvent(event); | 2373 MouseEvent* mouseEvent = toMouseEvent(event); |
2373 if (mouseEvent->button() == MiddleButton) { | 2374 if (mouseEvent->button() == MiddleButton) { |
2374 if (enclosingLinkEventParentOrSelf()) | 2375 if (enclosingLinkEventParentOrSelf()) |
2375 return; | 2376 return; |
2376 | 2377 |
2377 RenderObject* renderer = this->renderer(); | 2378 RenderObject* renderer = this->renderer(); |
2378 while (renderer && (!renderer->isBox() || !toRenderBox(renderer)->ca
nBeScrolledAndHasScrollableArea())) | 2379 while (renderer && (!renderer->isBox() || !toRenderBox(renderer)->ca
nBeScrolledAndHasScrollableArea())) |
2379 renderer = renderer->parent(); | 2380 renderer = renderer->parent(); |
2380 | 2381 |
2381 if (renderer) { | 2382 if (renderer) { |
2382 if (Frame* frame = document().frame()) | 2383 if (Frame* frame = document().frame()) |
2383 frame->eventHandler()->startPanScrolling(renderer); | 2384 frame->eventHandler()->startPanScrolling(renderer); |
2384 } | 2385 } |
2385 } | 2386 } |
2386 #endif | 2387 #endif |
2387 } else if ((eventType == EventNames::wheel || eventType == EventNames::mouse
wheel) && event->hasInterface(eventNames().interfaceForWheelEvent)) { | 2388 } else if ((eventType == EventNames::wheel || eventType == EventNames::mouse
wheel) && event->hasInterface(eventNames().interfaceForWheelEvent)) { |
2388 WheelEvent* wheelEvent = static_cast<WheelEvent*>(event); | 2389 WheelEvent* wheelEvent = toWheelEvent(event); |
2389 | 2390 |
2390 // If we don't have a renderer, send the wheel event to the first node w
e find with a renderer. | 2391 // If we don't have a renderer, send the wheel event to the first node w
e find with a renderer. |
2391 // This is needed for <option> and <optgroup> elements so that <select>s
get a wheel scroll. | 2392 // This is needed for <option> and <optgroup> elements so that <select>s
get a wheel scroll. |
2392 Node* startNode = this; | 2393 Node* startNode = this; |
2393 while (startNode && !startNode->renderer()) | 2394 while (startNode && !startNode->renderer()) |
2394 startNode = startNode->parentOrShadowHostNode(); | 2395 startNode = startNode->parentOrShadowHostNode(); |
2395 | 2396 |
2396 if (startNode && startNode->renderer()) | 2397 if (startNode && startNode->renderer()) |
2397 if (Frame* frame = document().frame()) | 2398 if (Frame* frame = document().frame()) |
2398 frame->eventHandler()->defaultWheelEventHandler(startNode, wheel
Event); | 2399 frame->eventHandler()->defaultWheelEventHandler(startNode, wheel
Event); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2630 node->showTreeForThis(); | 2631 node->showTreeForThis(); |
2631 } | 2632 } |
2632 | 2633 |
2633 void showNodePath(const WebCore::Node* node) | 2634 void showNodePath(const WebCore::Node* node) |
2634 { | 2635 { |
2635 if (node) | 2636 if (node) |
2636 node->showNodePathForThis(); | 2637 node->showNodePathForThis(); |
2637 } | 2638 } |
2638 | 2639 |
2639 #endif | 2640 #endif |
OLD | NEW |