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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 m_next->setPreviousSibling(0); | 417 m_next->setPreviousSibling(0); |
418 | 418 |
419 m_treeScope->guardDeref(); | 419 m_treeScope->guardDeref(); |
420 | 420 |
421 InspectorCounters::decrementCounter(InspectorCounters::NodeCounter); | 421 InspectorCounters::decrementCounter(InspectorCounters::NodeCounter); |
422 } | 422 } |
423 | 423 |
424 void Node::willBeDeletedFrom(Document* document) | 424 void Node::willBeDeletedFrom(Document* document) |
425 { | 425 { |
426 if (hasEventTargetData()) { | 426 if (hasEventTargetData()) { |
427 #if ENABLE(TOUCH_EVENT_TRACKING) | |
428 if (document) | 427 if (document) |
429 document->didRemoveEventTargetNode(this); | 428 document->didRemoveEventTargetNode(this); |
430 #endif | |
431 clearEventTargetData(); | 429 clearEventTargetData(); |
432 } | 430 } |
433 | 431 |
434 if (document) { | 432 if (document) { |
435 if (AXObjectCache* cache = document->existingAXObjectCache()) | 433 if (AXObjectCache* cache = document->existingAXObjectCache()) |
436 cache->remove(this); | 434 cache->remove(this); |
437 } | 435 } |
438 } | 436 } |
439 | 437 |
440 NodeRareData* Node::rareData() const | 438 NodeRareData* Node::rareData() const |
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2348 | 2346 |
2349 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator>
eventDispatchMediator) | 2347 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator>
eventDispatchMediator) |
2350 { | 2348 { |
2351 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); | 2349 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); |
2352 } | 2350 } |
2353 | 2351 |
2354 bool Node::dispatchEvent(PassRefPtr<Event> event) | 2352 bool Node::dispatchEvent(PassRefPtr<Event> event) |
2355 { | 2353 { |
2356 if (event->isMouseEvent()) | 2354 if (event->isMouseEvent()) |
2357 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::
create(adoptRef(toMouseEvent(event.leakRef())), MouseEventDispatchMediator::Synt
heticMouseEvent)); | 2355 return EventDispatcher::dispatchEvent(this, MouseEventDispatchMediator::
create(adoptRef(toMouseEvent(event.leakRef())), MouseEventDispatchMediator::Synt
heticMouseEvent)); |
2358 #if ENABLE(TOUCH_EVENTS) | |
2359 if (event->isTouchEvent()) | 2356 if (event->isTouchEvent()) |
2360 return dispatchTouchEvent(adoptRef(toTouchEvent(event.leakRef()))); | 2357 return dispatchTouchEvent(adoptRef(toTouchEvent(event.leakRef()))); |
2361 #endif | |
2362 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev
ent)); | 2358 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev
ent)); |
2363 } | 2359 } |
2364 | 2360 |
2365 void Node::dispatchSubtreeModifiedEvent() | 2361 void Node::dispatchSubtreeModifiedEvent() |
2366 { | 2362 { |
2367 if (isInShadowTree()) | 2363 if (isInShadowTree()) |
2368 return; | 2364 return; |
2369 | 2365 |
2370 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); | 2366 ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden()); |
2371 | 2367 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2410 } | 2406 } |
2411 | 2407 |
2412 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) | 2408 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) |
2413 { | 2409 { |
2414 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document()->default
View(), event); | 2410 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document()->default
View(), event); |
2415 if (!gestureEvent.get()) | 2411 if (!gestureEvent.get()) |
2416 return false; | 2412 return false; |
2417 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr
eate(gestureEvent)); | 2413 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr
eate(gestureEvent)); |
2418 } | 2414 } |
2419 | 2415 |
2420 #if ENABLE(TOUCH_EVENTS) | |
2421 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event) | 2416 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event) |
2422 { | 2417 { |
2423 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea
te(event)); | 2418 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea
te(event)); |
2424 } | 2419 } |
2425 #endif | |
2426 | 2420 |
2427 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve
ntOptions eventOptions, SimulatedClickVisualOptions visualOptions) | 2421 void Node::dispatchSimulatedClick(Event* underlyingEvent, SimulatedClickMouseEve
ntOptions eventOptions, SimulatedClickVisualOptions visualOptions) |
2428 { | 2422 { |
2429 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions,
visualOptions); | 2423 EventDispatcher::dispatchSimulatedClick(this, underlyingEvent, eventOptions,
visualOptions); |
2430 } | 2424 } |
2431 | 2425 |
2432 bool Node::dispatchBeforeLoadEvent(const String& sourceURL) | 2426 bool Node::dispatchBeforeLoadEvent(const String& sourceURL) |
2433 { | 2427 { |
2434 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) | 2428 if (!document()->hasListenerType(Document::BEFORELOAD_LISTENER)) |
2435 return true; | 2429 return true; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2539 | 2533 |
2540 bool Node::willRespondToMouseClickEvents() | 2534 bool Node::willRespondToMouseClickEvents() |
2541 { | 2535 { |
2542 if (isDisabledFormControl(this)) | 2536 if (isDisabledFormControl(this)) |
2543 return false; | 2537 return false; |
2544 return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListen
ers(eventNames().mouseupEvent) || hasEventListeners(eventNames().mousedownEvent)
|| hasEventListeners(eventNames().clickEvent) || hasEventListeners(eventNames()
.DOMActivateEvent); | 2538 return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListen
ers(eventNames().mouseupEvent) || hasEventListeners(eventNames().mousedownEvent)
|| hasEventListeners(eventNames().clickEvent) || hasEventListeners(eventNames()
.DOMActivateEvent); |
2545 } | 2539 } |
2546 | 2540 |
2547 bool Node::willRespondToTouchEvents() | 2541 bool Node::willRespondToTouchEvents() |
2548 { | 2542 { |
2549 #if ENABLE(TOUCH_EVENTS) | |
2550 if (isDisabledFormControl(this)) | 2543 if (isDisabledFormControl(this)) |
2551 return false; | 2544 return false; |
2552 return hasEventListeners(eventNames().touchstartEvent) || hasEventListeners(
eventNames().touchmoveEvent) || hasEventListeners(eventNames().touchcancelEvent)
|| hasEventListeners(eventNames().touchendEvent); | 2545 return hasEventListeners(eventNames().touchstartEvent) || hasEventListeners(
eventNames().touchmoveEvent) || hasEventListeners(eventNames().touchcancelEvent)
|| hasEventListeners(eventNames().touchendEvent); |
2553 #else | |
2554 return false; | |
2555 #endif | |
2556 } | 2546 } |
2557 | 2547 |
2558 // This is here for inlining | 2548 // This is here for inlining |
2559 inline void TreeScope::removedLastRefToScope() | 2549 inline void TreeScope::removedLastRefToScope() |
2560 { | 2550 { |
2561 ASSERT(!deletionHasBegun()); | 2551 ASSERT(!deletionHasBegun()); |
2562 if (m_guardRefCount) { | 2552 if (m_guardRefCount) { |
2563 // If removing a child removes the last self-only ref, we don't | 2553 // If removing a child removes the last self-only ref, we don't |
2564 // want the scope to be destructed until after | 2554 // want the scope to be destructed until after |
2565 // removeDetachedChildren returns, so we guard ourselves with an | 2555 // removeDetachedChildren returns, so we guard ourselves with an |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2734 node->showTreeForThis(); | 2724 node->showTreeForThis(); |
2735 } | 2725 } |
2736 | 2726 |
2737 void showNodePath(const WebCore::Node* node) | 2727 void showNodePath(const WebCore::Node* node) |
2738 { | 2728 { |
2739 if (node) | 2729 if (node) |
2740 node->showNodePathForThis(); | 2730 node->showNodePathForThis(); |
2741 } | 2731 } |
2742 | 2732 |
2743 #endif | 2733 #endif |
OLD | NEW |