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 16 matching lines...) Expand all Loading... |
27 #include "config.h" | 27 #include "config.h" |
28 #include "core/events/TreeScopeEventContext.h" | 28 #include "core/events/TreeScopeEventContext.h" |
29 | 29 |
30 #include "core/dom/StaticNodeList.h" | 30 #include "core/dom/StaticNodeList.h" |
31 #include "core/dom/shadow/ShadowRoot.h" | 31 #include "core/dom/shadow/ShadowRoot.h" |
32 #include "core/events/EventPath.h" | 32 #include "core/events/EventPath.h" |
33 #include "core/events/TouchEventContext.h" | 33 #include "core/events/TouchEventContext.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 WillBeHeapVector<RefPtrWillBeRawPtr<EventTarget>>& TreeScopeEventContext::ensure
EventPath(EventPath& path) | 37 WillBeHeapVector<RefPtrWillBeMember<EventTarget>>& TreeScopeEventContext::ensure
EventPath(EventPath& path) |
38 { | 38 { |
39 if (m_eventPath) | 39 if (m_eventPath) |
40 return *m_eventPath; | 40 return *m_eventPath; |
41 | 41 |
42 m_eventPath = adoptPtrWillBeNoop(new WillBeHeapVector<RefPtrWillBeRawPtr<Eve
ntTarget>>()); | 42 m_eventPath = adoptPtrWillBeNoop(new WillBeHeapVector<RefPtrWillBeMember<Eve
ntTarget>>()); |
43 LocalDOMWindow* window = path.windowEventContext().window(); | 43 LocalDOMWindow* window = path.windowEventContext().window(); |
44 m_eventPath->reserveCapacity(path.size() + window ? 1 : 0); | 44 m_eventPath->reserveCapacity(path.size() + window ? 1 : 0); |
45 for (size_t i = 0; i < path.size(); ++i) { | 45 for (size_t i = 0; i < path.size(); ++i) { |
46 Node& rootNode = path[i].treeScopeEventContext().rootNode(); | 46 Node& rootNode = path[i].treeScopeEventContext().rootNode(); |
47 if (rootNode.isShadowRoot() && toShadowRoot(rootNode).type() == ShadowRo
ot::AuthorShadowRoot) | 47 if (rootNode.isShadowRoot() && toShadowRoot(rootNode).type() == ShadowRo
ot::AuthorShadowRoot) |
48 m_eventPath->append(path[i].node()); | 48 m_eventPath->append(path[i].node()); |
49 else if (path[i].treeScopeEventContext().isInclusiveAncestorOf(*this)) | 49 else if (path[i].treeScopeEventContext().isInclusiveAncestorOf(*this)) |
50 m_eventPath->append(path[i].node()); | 50 m_eventPath->append(path[i].node()); |
51 } | 51 } |
52 if (window) | 52 if (window) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 int TreeScopeEventContext::calculatePrePostOrderNumber(int orderNumber) | 92 int TreeScopeEventContext::calculatePrePostOrderNumber(int orderNumber) |
93 { | 93 { |
94 m_preOrder = orderNumber; | 94 m_preOrder = orderNumber; |
95 for (size_t i = 0; i < m_children.size(); ++i) | 95 for (size_t i = 0; i < m_children.size(); ++i) |
96 orderNumber = m_children[i]->calculatePrePostOrderNumber(orderNumber + 1
); | 96 orderNumber = m_children[i]->calculatePrePostOrderNumber(orderNumber + 1
); |
97 m_postOrder = orderNumber + 1; | 97 m_postOrder = orderNumber + 1; |
98 return orderNumber + 1; | 98 return orderNumber + 1; |
99 } | 99 } |
100 | 100 |
101 } | 101 } |
OLD | NEW |