| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 HeapVector<Member<TreeScopeEventContext>> m_children; | 97 HeapVector<Member<TreeScopeEventContext>> m_children; |
| 98 int m_preOrder; | 98 int m_preOrder; |
| 99 int m_postOrder; | 99 int m_postOrder; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 #if ENABLE(ASSERT) | 102 #if ENABLE(ASSERT) |
| 103 inline bool TreeScopeEventContext::isUnreachableNode(EventTarget& target) | 103 inline bool TreeScopeEventContext::isUnreachableNode(EventTarget& target) |
| 104 { | 104 { |
| 105 // FIXME: Checks also for SVG elements. | 105 // FIXME: Checks also for SVG elements. |
| 106 return target.toNode() && !target.toNode()->isSVGElement() && !target.toNode
()->treeScope().isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(treeScope
()); | 106 return target.toNode() && !target.toNode()->isSVGElement() && !target.toNode
()->treeScopeOrDocument().isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf
(treeScope()); |
| 107 } | 107 } |
| 108 #endif | 108 #endif |
| 109 | 109 |
| 110 inline void TreeScopeEventContext::setTarget(EventTarget* target) | 110 inline void TreeScopeEventContext::setTarget(EventTarget* target) |
| 111 { | 111 { |
| 112 ASSERT(target); | 112 ASSERT(target); |
| 113 ASSERT(!isUnreachableNode(*target)); | 113 ASSERT(!isUnreachableNode(*target)); |
| 114 m_target = target; | 114 m_target = target; |
| 115 } | 115 } |
| 116 | 116 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 138 { | 138 { |
| 139 ASSERT(m_preOrder != -1 && m_postOrder != -1 && other.m_preOrder != -1 && ot
her.m_postOrder != -1); | 139 ASSERT(m_preOrder != -1 && m_postOrder != -1 && other.m_preOrder != -1 && ot
her.m_postOrder != -1); |
| 140 return (m_preOrder < other.m_preOrder && m_postOrder < other.m_preOrder) | 140 return (m_preOrder < other.m_preOrder && m_postOrder < other.m_preOrder) |
| 141 || (m_preOrder > other.m_preOrder && m_preOrder > other.m_postOrder); | 141 || (m_preOrder > other.m_preOrder && m_preOrder > other.m_postOrder); |
| 142 } | 142 } |
| 143 #endif | 143 #endif |
| 144 | 144 |
| 145 } // namespace blink | 145 } // namespace blink |
| 146 | 146 |
| 147 #endif // TreeScopeEventContext_h | 147 #endif // TreeScopeEventContext_h |
| OLD | NEW |