| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 // (2) If no closed shadow root in ancestors of this, include it. | 46 // (2) If no closed shadow root in ancestors of this, include it. |
| 47 if (!containingClosedShadowTree()) | 47 if (!containingClosedShadowTree()) |
| 48 return true; | 48 return true; |
| 49 | 49 |
| 50 // (3) If |this| is descendent of |other|, exclude if any closed shadow root
in between. | 50 // (3) If |this| is descendent of |other|, exclude if any closed shadow root
in between. |
| 51 if (isDescendantOf(other)) | 51 if (isDescendantOf(other)) |
| 52 return !containingClosedShadowTree()->isDescendantOf(other); | 52 return !containingClosedShadowTree()->isDescendantOf(other); |
| 53 | 53 |
| 54 // (4) |this| and |other| must be in exclusive branches. | 54 // (4) |this| and |other| must be in exclusive branches. |
| 55 ASSERT(other.isExclusivePartOf(*this)); | 55 #if DCHECK_IS_ON() |
| 56 DCHECK(other.isExclusivePartOf(*this)); |
| 57 #endif |
| 56 return false; | 58 return false; |
| 57 } | 59 } |
| 58 | 60 |
| 59 HeapVector<Member<EventTarget>>& TreeScopeEventContext::ensureEventPath(EventPat
h& path) | 61 HeapVector<Member<EventTarget>>& TreeScopeEventContext::ensureEventPath(EventPat
h& path) |
| 60 { | 62 { |
| 61 if (m_eventPath) | 63 if (m_eventPath) |
| 62 return *m_eventPath; | 64 return *m_eventPath; |
| 63 | 65 |
| 64 m_eventPath = new HeapVector<Member<EventTarget>>(); | 66 m_eventPath = new HeapVector<Member<EventTarget>>(); |
| 65 LocalDOMWindow* window = path.windowEventContext().window(); | 67 LocalDOMWindow* window = path.windowEventContext().window(); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 m_preOrder = orderNumber; | 114 m_preOrder = orderNumber; |
| 113 m_containingClosedShadowTree = (rootNode().isShadowRoot() && !toShadowRoot(r
ootNode()).isOpenOrV0()) ? this : nearestAncestorClosedTreeScopeEventContext; | 115 m_containingClosedShadowTree = (rootNode().isShadowRoot() && !toShadowRoot(r
ootNode()).isOpenOrV0()) ? this : nearestAncestorClosedTreeScopeEventContext; |
| 114 for (size_t i = 0; i < m_children.size(); ++i) | 116 for (size_t i = 0; i < m_children.size(); ++i) |
| 115 orderNumber = m_children[i]->calculateTreeOrderAndSetNearestAncestorClos
edTree(orderNumber + 1, containingClosedShadowTree()); | 117 orderNumber = m_children[i]->calculateTreeOrderAndSetNearestAncestorClos
edTree(orderNumber + 1, containingClosedShadowTree()); |
| 116 m_postOrder = orderNumber + 1; | 118 m_postOrder = orderNumber + 1; |
| 117 | 119 |
| 118 return orderNumber + 1; | 120 return orderNumber + 1; |
| 119 } | 121 } |
| 120 | 122 |
| 121 } // namespace blink | 123 } // namespace blink |
| OLD | NEW |