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

Side by Side Diff: sky/engine/core/dom/Node.cpp

Issue 868133003: Remove touch events from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/Touch.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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "sky/engine/core/dom/shadow/InsertionPoint.h" 55 #include "sky/engine/core/dom/shadow/InsertionPoint.h"
56 #include "sky/engine/core/dom/shadow/ShadowRoot.h" 56 #include "sky/engine/core/dom/shadow/ShadowRoot.h"
57 #include "sky/engine/core/editing/htmlediting.h" 57 #include "sky/engine/core/editing/htmlediting.h"
58 #include "sky/engine/core/events/Event.h" 58 #include "sky/engine/core/events/Event.h"
59 #include "sky/engine/core/events/EventDispatchMediator.h" 59 #include "sky/engine/core/events/EventDispatchMediator.h"
60 #include "sky/engine/core/events/EventDispatcher.h" 60 #include "sky/engine/core/events/EventDispatcher.h"
61 #include "sky/engine/core/events/EventListener.h" 61 #include "sky/engine/core/events/EventListener.h"
62 #include "sky/engine/core/events/GestureEvent.h" 62 #include "sky/engine/core/events/GestureEvent.h"
63 #include "sky/engine/core/events/KeyboardEvent.h" 63 #include "sky/engine/core/events/KeyboardEvent.h"
64 #include "sky/engine/core/events/TextEvent.h" 64 #include "sky/engine/core/events/TextEvent.h"
65 #include "sky/engine/core/events/TouchEvent.h"
66 #include "sky/engine/core/events/UIEvent.h" 65 #include "sky/engine/core/events/UIEvent.h"
67 #include "sky/engine/core/frame/LocalFrame.h" 66 #include "sky/engine/core/frame/LocalFrame.h"
68 #include "sky/engine/core/frame/Settings.h" 67 #include "sky/engine/core/frame/Settings.h"
69 #include "sky/engine/core/html/HTMLAnchorElement.h" 68 #include "sky/engine/core/html/HTMLAnchorElement.h"
70 #include "sky/engine/core/html/HTMLStyleElement.h" 69 #include "sky/engine/core/html/HTMLStyleElement.h"
71 #include "sky/engine/core/page/EventHandler.h" 70 #include "sky/engine/core/page/EventHandler.h"
72 #include "sky/engine/core/page/Page.h" 71 #include "sky/engine/core/page/Page.h"
73 #include "sky/engine/core/rendering/RenderBox.h" 72 #include "sky/engine/core/rendering/RenderBox.h"
74 #include "sky/engine/platform/EventDispatchForbiddenScope.h" 73 #include "sky/engine/platform/EventDispatchForbiddenScope.h"
75 #include "sky/engine/platform/Partitions.h" 74 #include "sky/engine/platform/Partitions.h"
(...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event)); 1445 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event));
1447 } 1446 }
1448 1447
1449 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator> eventDispatchMediator) 1448 void Node::dispatchScopedEventDispatchMediator(PassRefPtr<EventDispatchMediator> eventDispatchMediator)
1450 { 1449 {
1451 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator); 1450 EventDispatcher::dispatchScopedEvent(this, eventDispatchMediator);
1452 } 1451 }
1453 1452
1454 bool Node::dispatchEvent(PassRefPtr<Event> event) 1453 bool Node::dispatchEvent(PassRefPtr<Event> event)
1455 { 1454 {
1456 if (event->isTouchEvent())
1457 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event));
1458 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev ent)); 1455 return EventDispatcher::dispatchEvent(this, EventDispatchMediator::create(ev ent));
1459 } 1456 }
1460 1457
1461 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEven t) 1458 bool Node::dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEven t)
1462 { 1459 {
1463 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 1460 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden());
1464 RefPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActivate, true, t rue, document().domWindow(), detail); 1461 RefPtr<UIEvent> event = UIEvent::create(EventTypeNames::DOMActivate, true, t rue, document().domWindow(), detail);
1465 event->setUnderlyingEvent(underlyingEvent); 1462 event->setUnderlyingEvent(underlyingEvent);
1466 dispatchScopedEvent(event); 1463 dispatchScopedEvent(event);
1467 return event->defaultHandled(); 1464 return event->defaultHandled();
1468 } 1465 }
1469 1466
1470 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event) 1467 bool Node::dispatchKeyEvent(const PlatformKeyboardEvent& event)
1471 { 1468 {
1472 return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::c reate(KeyboardEvent::create(event, document().domWindow()))); 1469 return EventDispatcher::dispatchEvent(this, KeyboardEventDispatchMediator::c reate(KeyboardEvent::create(event, document().domWindow())));
1473 } 1470 }
1474 1471
1475 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event) 1472 bool Node::dispatchGestureEvent(const PlatformGestureEvent& event)
1476 { 1473 {
1477 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindo w(), event); 1474 RefPtr<GestureEvent> gestureEvent = GestureEvent::create(document().domWindo w(), event);
1478 if (!gestureEvent) 1475 if (!gestureEvent)
1479 return false; 1476 return false;
1480 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr eate(gestureEvent)); 1477 return EventDispatcher::dispatchEvent(this, GestureEventDispatchMediator::cr eate(gestureEvent));
1481 } 1478 }
1482 1479
1483 bool Node::dispatchTouchEvent(PassRefPtr<TouchEvent> event)
1484 {
1485 return EventDispatcher::dispatchEvent(this, TouchEventDispatchMediator::crea te(event));
1486 }
1487
1488 void Node::dispatchInputEvent() 1480 void Node::dispatchInputEvent()
1489 { 1481 {
1490 dispatchScopedEvent(Event::createBubble(EventTypeNames::input)); 1482 dispatchScopedEvent(Event::createBubble(EventTypeNames::input));
1491 } 1483 }
1492 1484
1493 void Node::defaultEventHandler(Event* event) 1485 void Node::defaultEventHandler(Event* event)
1494 { 1486 {
1495 if (event->target() != this) 1487 if (event->target() != this)
1496 return; 1488 return;
1497 const AtomicString& eventType = event->type(); 1489 const AtomicString& eventType = event->type();
(...skipping 19 matching lines...) Expand all
1517 bool Node::willRespondToMouseMoveEvents() 1509 bool Node::willRespondToMouseMoveEvents()
1518 { 1510 {
1519 return hasEventListeners(EventTypeNames::mousemove) || hasEventListeners(Eve ntTypeNames::mouseover) || hasEventListeners(EventTypeNames::mouseout); 1511 return hasEventListeners(EventTypeNames::mousemove) || hasEventListeners(Eve ntTypeNames::mouseover) || hasEventListeners(EventTypeNames::mouseout);
1520 } 1512 }
1521 1513
1522 bool Node::willRespondToMouseClickEvents() 1514 bool Node::willRespondToMouseClickEvents()
1523 { 1515 {
1524 return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListen ers(EventTypeNames::mouseup) || hasEventListeners(EventTypeNames::mousedown) || hasEventListeners(EventTypeNames::click) || hasEventListeners(EventTypeNames::DO MActivate); 1516 return isContentEditable(UserSelectAllIsAlwaysNonEditable) || hasEventListen ers(EventTypeNames::mouseup) || hasEventListeners(EventTypeNames::mousedown) || hasEventListeners(EventTypeNames::click) || hasEventListeners(EventTypeNames::DO MActivate);
1525 } 1517 }
1526 1518
1527 bool Node::willRespondToTouchEvents()
1528 {
1529 return hasEventListeners(EventTypeNames::touchstart) || hasEventListeners(Ev entTypeNames::touchmove) || hasEventListeners(EventTypeNames::touchcancel) || ha sEventListeners(EventTypeNames::touchend);
1530 }
1531
1532 #if !ENABLE(OILPAN) 1519 #if !ENABLE(OILPAN)
1533 // This is here for inlining 1520 // This is here for inlining
1534 inline void TreeScope::removedLastRefToScope() 1521 inline void TreeScope::removedLastRefToScope()
1535 { 1522 {
1536 ASSERT_WITH_SECURITY_IMPLICATION(!deletionHasBegun()); 1523 ASSERT_WITH_SECURITY_IMPLICATION(!deletionHasBegun());
1537 if (m_guardRefCount) { 1524 if (m_guardRefCount) {
1538 // If removing a child removes the last self-only ref, we don't 1525 // If removing a child removes the last self-only ref, we don't
1539 // want the scope to be destructed until after 1526 // want the scope to be destructed until after
1540 // removeDetachedChildren returns, so we guard ourselves with an 1527 // removeDetachedChildren returns, so we guard ourselves with an
1541 // extra self-only ref. 1528 // extra self-only ref.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 node->showTreeForThis(); 1680 node->showTreeForThis();
1694 } 1681 }
1695 1682
1696 void showNodePath(const blink::Node* node) 1683 void showNodePath(const blink::Node* node)
1697 { 1684 {
1698 if (node) 1685 if (node)
1699 node->showNodePathForThis(); 1686 node->showNodePathForThis();
1700 } 1687 }
1701 1688
1702 #endif 1689 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Node.h ('k') | sky/engine/core/dom/Touch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698