| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 TreeScopeEventContext(TreeScope&); | 65 TreeScopeEventContext(TreeScope&); |
| 66 | 66 |
| 67 #ifndef NDEBUG | 67 #ifndef NDEBUG |
| 68 bool isUnreachableNode(EventTarget&); | 68 bool isUnreachableNode(EventTarget&); |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 TreeScope& m_treeScope; | 71 TreeScope& m_treeScope; |
| 72 RefPtr<EventTarget> m_target; | 72 RefPtr<EventTarget> m_target; |
| 73 RefPtr<EventTarget> m_relatedTarget; | 73 RefPtr<EventTarget> m_relatedTarget; |
| 74 RefPtr<NodeList> m_eventPath; | 74 RefPtr<NodeList> m_eventPath; |
| 75 RefPtr<TouchEventContext> m_touchEventContext; | 75 RefPtrWillBePersistent<TouchEventContext> m_touchEventContext; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 #ifndef NDEBUG | 78 #ifndef NDEBUG |
| 79 inline bool TreeScopeEventContext::isUnreachableNode(EventTarget& target) | 79 inline bool TreeScopeEventContext::isUnreachableNode(EventTarget& target) |
| 80 { | 80 { |
| 81 // FIXME: Checks also for SVG elements. | 81 // FIXME: Checks also for SVG elements. |
| 82 return target.toNode() && !target.toNode()->isSVGElement() && !target.toNode
()->treeScope().isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(m_treeSco
pe); | 82 return target.toNode() && !target.toNode()->isSVGElement() && !target.toNode
()->treeScope().isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(m_treeSco
pe); |
| 83 } | 83 } |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 inline void TreeScopeEventContext::setTarget(PassRefPtr<EventTarget> target) | 86 inline void TreeScopeEventContext::setTarget(PassRefPtr<EventTarget> target) |
| 87 { | 87 { |
| 88 ASSERT(target); | 88 ASSERT(target); |
| 89 ASSERT(!isUnreachableNode(*target)); | 89 ASSERT(!isUnreachableNode(*target)); |
| 90 m_target = target; | 90 m_target = target; |
| 91 } | 91 } |
| 92 | 92 |
| 93 inline void TreeScopeEventContext::setRelatedTarget(PassRefPtr<EventTarget> rela
tedTarget) | 93 inline void TreeScopeEventContext::setRelatedTarget(PassRefPtr<EventTarget> rela
tedTarget) |
| 94 { | 94 { |
| 95 ASSERT(relatedTarget); | 95 ASSERT(relatedTarget); |
| 96 ASSERT(!isUnreachableNode(*relatedTarget)); | 96 ASSERT(!isUnreachableNode(*relatedTarget)); |
| 97 m_relatedTarget = relatedTarget; | 97 m_relatedTarget = relatedTarget; |
| 98 } | 98 } |
| 99 | 99 |
| 100 } | 100 } |
| 101 | 101 |
| 102 #endif // TreeScopeEventContext_h | 102 #endif // TreeScopeEventContext_h |
| OLD | NEW |