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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 EventPath& path) { | 64 EventPath& path) { |
65 if (m_eventPath) | 65 if (m_eventPath) |
66 return *m_eventPath; | 66 return *m_eventPath; |
67 | 67 |
68 m_eventPath = new HeapVector<Member<EventTarget>>(); | 68 m_eventPath = new HeapVector<Member<EventTarget>>(); |
69 LocalDOMWindow* window = path.windowEventContext().window(); | 69 LocalDOMWindow* window = path.windowEventContext().window(); |
70 m_eventPath->reserveCapacity(path.size() + (window ? 1 : 0)); | 70 m_eventPath->reserveCapacity(path.size() + (window ? 1 : 0)); |
71 | 71 |
72 for (auto& context : path.nodeEventContexts()) { | 72 for (auto& context : path.nodeEventContexts()) { |
73 if (context.treeScopeEventContext().isUnclosedTreeOf(*this)) | 73 if (context.treeScopeEventContext().isUnclosedTreeOf(*this)) |
74 m_eventPath->append(context.node()); | 74 m_eventPath->push_back(context.node()); |
75 } | 75 } |
76 if (window) | 76 if (window) |
77 m_eventPath->append(window); | 77 m_eventPath->push_back(window); |
78 return *m_eventPath; | 78 return *m_eventPath; |
79 } | 79 } |
80 | 80 |
81 TouchEventContext* TreeScopeEventContext::ensureTouchEventContext() { | 81 TouchEventContext* TreeScopeEventContext::ensureTouchEventContext() { |
82 if (!m_touchEventContext) | 82 if (!m_touchEventContext) |
83 m_touchEventContext = TouchEventContext::create(); | 83 m_touchEventContext = TouchEventContext::create(); |
84 return m_touchEventContext.get(); | 84 return m_touchEventContext.get(); |
85 } | 85 } |
86 | 86 |
87 TreeScopeEventContext* TreeScopeEventContext::create(TreeScope& treeScope) { | 87 TreeScopeEventContext* TreeScopeEventContext::create(TreeScope& treeScope) { |
(...skipping 27 matching lines...) Expand all Loading... |
115 for (const auto& context : m_children) { | 115 for (const auto& context : m_children) { |
116 orderNumber = context->calculateTreeOrderAndSetNearestAncestorClosedTree( | 116 orderNumber = context->calculateTreeOrderAndSetNearestAncestorClosedTree( |
117 orderNumber + 1, containingClosedShadowTree()); | 117 orderNumber + 1, containingClosedShadowTree()); |
118 } | 118 } |
119 m_postOrder = orderNumber + 1; | 119 m_postOrder = orderNumber + 1; |
120 | 120 |
121 return orderNumber + 1; | 121 return orderNumber + 1; |
122 } | 122 } |
123 | 123 |
124 } // namespace blink | 124 } // namespace blink |
OLD | NEW |