| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2014 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeEventContext) | 38 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(NodeEventContext) |
| 39 | 39 |
| 40 NodeEventContext::NodeEventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget
> currentTarget) | 40 NodeEventContext::NodeEventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget
> currentTarget) |
| 41 : m_node(node) | 41 : m_node(node) |
| 42 , m_currentTarget(currentTarget) | 42 , m_currentTarget(currentTarget) |
| 43 { | 43 { |
| 44 ASSERT(m_node); | 44 ASSERT(m_node); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void NodeEventContext::trace(Visitor* visitor) | |
| 48 { | |
| 49 visitor->trace(m_node); | |
| 50 visitor->trace(m_currentTarget); | |
| 51 visitor->trace(m_treeScopeEventContext); | |
| 52 } | |
| 53 | |
| 54 void NodeEventContext::handleLocalEvents(Event* event) const | 47 void NodeEventContext::handleLocalEvents(Event* event) const |
| 55 { | 48 { |
| 56 if (touchEventContext()) { | 49 if (touchEventContext()) { |
| 57 touchEventContext()->handleLocalEvents(event); | 50 touchEventContext()->handleLocalEvents(event); |
| 58 } else if (relatedTarget()) { | 51 } else if (relatedTarget()) { |
| 59 if (event->isMouseEvent()) { | 52 if (event->isMouseEvent()) { |
| 60 toMouseEvent(event)->setRelatedTarget(relatedTarget()); | 53 toMouseEvent(event)->setRelatedTarget(relatedTarget()); |
| 61 } else if (event->isFocusEvent()) { | 54 } else if (event->isFocusEvent()) { |
| 62 toFocusEvent(event)->setRelatedTarget(relatedTarget()); | 55 toFocusEvent(event)->setRelatedTarget(relatedTarget()); |
| 63 } | 56 } |
| 64 } | 57 } |
| 65 event->setTarget(target()); | 58 event->setTarget(target()); |
| 66 event->setCurrentTarget(m_currentTarget.get()); | 59 event->setCurrentTarget(m_currentTarget.get()); |
| 67 m_node->handleLocalEvents(event); | 60 m_node->handleLocalEvents(event); |
| 68 } | 61 } |
| 69 | 62 |
| 70 } | 63 } |
| OLD | NEW |