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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 m_next->setPreviousSibling(0); | 415 m_next->setPreviousSibling(0); |
416 | 416 |
417 m_treeScope->guardDeref(); | 417 m_treeScope->guardDeref(); |
418 | 418 |
419 InspectorCounters::decrementCounter(InspectorCounters::NodeCounter); | 419 InspectorCounters::decrementCounter(InspectorCounters::NodeCounter); |
420 } | 420 } |
421 | 421 |
422 void Node::willBeDeletedFrom(Document* document) | 422 void Node::willBeDeletedFrom(Document* document) |
423 { | 423 { |
424 if (hasEventTargetData()) { | 424 if (hasEventTargetData()) { |
| 425 #if ENABLE(TOUCH_EVENT_TRACKING) |
425 if (document) | 426 if (document) |
426 document->didRemoveEventTargetNode(this); | 427 document->didRemoveEventTargetNode(this); |
| 428 #endif |
427 clearEventTargetData(); | 429 clearEventTargetData(); |
428 } | 430 } |
429 | 431 |
430 if (document) { | 432 if (document) { |
431 if (AXObjectCache* cache = document->existingAXObjectCache()) | 433 if (AXObjectCache* cache = document->existingAXObjectCache()) |
432 cache->remove(this); | 434 cache->remove(this); |
433 } | 435 } |
434 } | 436 } |
435 | 437 |
436 NodeRareData* Node::rareData() const | 438 NodeRareData* Node::rareData() const |
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2360 | 2362 |
2361 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator>
eventDispatchMediator) | 2363 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator>
eventDispatchMediator) |
2362 { | 2364 { |
2363 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); | 2365 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); |
2364 } | 2366 } |
2365 | 2367 |
2366 bool Node::dispatchEvent(PassRefPtr<Event> event) | 2368 bool Node::dispatchEvent(PassRefPtr<Event> event) |
2367 { | 2369 { |
2368 if (event->isMouseEvent()) | 2370 if (event->isMouseEvent()) |
2369 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::
create(adoptRef(toMouseEvent(event.leakRef())), MouseEventDispatchMediator::Synt
heticMouseEvent)); | 2371 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::
create(adoptRef(toMouseEvent(event.leakRef())), MouseEventDispatchMediator::Synt
heticMouseEvent)); |
| 2372 #if ENABLE(TOUCH_EVENTS) |
2370 if (event->isTouchEvent()) | 2373 if (event->isTouchEvent()) |
2371 return dispatchTouchEvent(adoptRef(toTouchEvent(event.leakRef()))); | 2374 return dispatchTouchEvent(adoptRef(toTouchEvent(event.leakRef()))); |
| 2375 #endif |
2372 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev
ent)); | 2376 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev
ent)); |
2373 } | 2377 } |
2374 | 2378 |
2375 void Node::dispatchSubtreeModifiedEvent() | 2379 void Node::dispatchSubtreeModifiedEvent() |
2376 { | 2380 { |
2377 if (isInShadowTree()) | 2381 if (isInShadowTree()) |
2378 return; | 2382 return; |
2379 | 2383 |
2380 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); | 2384 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); |
2381 | 2385 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2420 } | 2424 } |
2421 | 2425 |
2422 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) | 2426 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) |
2423 { | 2427 { |
2424 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document()->default
View(), event); | 2428 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document()->default
View(), event); |
2425 if (!gestureEvent.get()) | 2429 if (!gestureEvent.get()) |
2426 return false; | 2430 return false; |
2427 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr
eate(gestureEvent)); | 2431 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr
eate(gestureEvent)); |
2428 } | 2432 } |
2429 | 2433 |
| 2434 #if ENABLE(TOUCH_EVENTS) |
2430 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event) | 2435 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event) |
2431 { | 2436 { |
2432 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea
te(event)); | 2437 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea
te(event)); |
2433 } | 2438 } |
| 2439 #endif |
2434 | 2440 |
2435 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve
ntOptions eventOptions, SimulatedClickVisualOptions visualOptions) | 2441 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve
ntOptions eventOptions, SimulatedClickVisualOptions visualOptions) |
2436 { | 2442 { |
2437 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions,
visualOptions); | 2443 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions,
visualOptions); |
2438 } | 2444 } |
2439 | 2445 |
2440 bool Node::dispatchBeforeLoadEvent(const String& sourceURL) | 2446 bool Node::dispatchBeforeLoadEvent(const String& sourceURL) |
2441 { | 2447 { |
2442 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) | 2448 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) |
2443 return true; | 2449 return true; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2545 | 2551 |
2546 bool Node::willRespondToMouseClickEvents() | 2552 bool Node::willRespondToMouseClickEvents() |
2547 { | 2553 { |
2548 if (isDisabledFormControl(this)) | 2554 if (isDisabledFormControl(this)) |
2549 return false; | 2555 return false; |
2550 return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListen
ers(eventNames().mouseupEvent) || hasEventListeners(eventNames().mousedownEvent)
|| hasEventListeners(eventNames().clickEvent) || hasEventListeners(eventNames()
.DOMActivateEvent); | 2556 return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListen
ers(eventNames().mouseupEvent) || hasEventListeners(eventNames().mousedownEvent)
|| hasEventListeners(eventNames().clickEvent) || hasEventListeners(eventNames()
.DOMActivateEvent); |
2551 } | 2557 } |
2552 | 2558 |
2553 bool Node::willRespondToTouchEvents() | 2559 bool Node::willRespondToTouchEvents() |
2554 { | 2560 { |
| 2561 #if ENABLE(TOUCH_EVENTS) |
2555 if (isDisabledFormControl(this)) | 2562 if (isDisabledFormControl(this)) |
2556 return false; | 2563 return false; |
2557 return hasEventListeners(eventNames().touchstartEvent) || hasEventListeners(
eventNames().touchmoveEvent) || hasEventListeners(eventNames().touchcancelEvent)
|| hasEventListeners(eventNames().touchendEvent); | 2564 return hasEventListeners(eventNames().touchstartEvent) || hasEventListeners(
eventNames().touchmoveEvent) || hasEventListeners(eventNames().touchcancelEvent)
|| hasEventListeners(eventNames().touchendEvent); |
| 2565 #else |
| 2566 return false; |
| 2567 #endif |
2558 } | 2568 } |
2559 | 2569 |
2560 // This is here for inlining | 2570 // This is here for inlining |
2561 inline void TreeScope::removedLastRefToScope() | 2571 inline void TreeScope::removedLastRefToScope() |
2562 { | 2572 { |
2563 ASSERT(!deletionHasBegun()); | 2573 ASSERT(!deletionHasBegun()); |
2564 if (m_guardRefCount) { | 2574 if (m_guardRefCount) { |
2565 // If removing a child removes the last self-only ref, we don't | 2575 // If removing a child removes the last self-only ref, we don't |
2566 // want the scope to be destructed until after | 2576 // want the scope to be destructed until after |
2567 // removeDetachedChildren returns, so we guard ourselves with an | 2577 // removeDetachedChildren returns, so we guard ourselves with an |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2736 node->showTreeForThis(); | 2746 node->showTreeForThis(); |
2737 } | 2747 } |
2738 | 2748 |
2739 void showNodePath(const WebCore::Node* node) | 2749 void showNodePath(const WebCore::Node* node) |
2740 { | 2750 { |
2741 if (node) | 2751 if (node) |
2742 node->showNodePathForThis(); | 2752 node->showNodePathForThis(); |
2743 } | 2753 } |
2744 | 2754 |
2745 #endif | 2755 #endif |
OLD | NEW |