| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 m_nodeEventContexts.reserveCapacity(nodesInPath.size()); | 151 m_nodeEventContexts.reserveCapacity(nodesInPath.size()); |
| 152 for (Node* nodeInPath : nodesInPath) { | 152 for (Node* nodeInPath : nodesInPath) { |
| 153 m_nodeEventContexts.append(NodeEventContext(nodeInPath, eventTargetRespe
ctingTargetRules(*nodeInPath))); | 153 m_nodeEventContexts.append(NodeEventContext(nodeInPath, eventTargetRespe
ctingTargetRules(*nodeInPath))); |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 void EventPath::calculateTreeOrderAndSetNearestAncestorClosedTree() | 157 void EventPath::calculateTreeOrderAndSetNearestAncestorClosedTree() |
| 158 { | 158 { |
| 159 // Precondition: | 159 // Precondition: |
| 160 // - TreeScopes in m_treeScopeEventContexts must be *connected* in the sam
e tree of trees. | 160 // - TreeScopes in m_treeScopeEventContexts must be *connected* in the sam
e composed tree. |
| 161 // - The root tree must be included. | 161 // - The root tree must be included. |
| 162 WillBeHeapHashMap<RawPtrWillBeMember<const TreeScope>, RawPtrWillBeMember<Tr
eeScopeEventContext>> treeScopeEventContextMap; | 162 WillBeHeapHashMap<RawPtrWillBeMember<const TreeScope>, RawPtrWillBeMember<Tr
eeScopeEventContext>> treeScopeEventContextMap; |
| 163 for (const auto& treeScopeEventContext : m_treeScopeEventContexts) | 163 for (const auto& treeScopeEventContext : m_treeScopeEventContexts) |
| 164 treeScopeEventContextMap.add(&treeScopeEventContext->treeScope(), treeSc
opeEventContext.get()); | 164 treeScopeEventContextMap.add(&treeScopeEventContext->treeScope(), treeSc
opeEventContext.get()); |
| 165 TreeScopeEventContext* rootTree = nullptr; | 165 TreeScopeEventContext* rootTree = nullptr; |
| 166 for (const auto& treeScopeEventContext : m_treeScopeEventContexts) { | 166 for (const auto& treeScopeEventContext : m_treeScopeEventContexts) { |
| 167 // Use olderShadowRootOrParentTreeScope here for parent-child relationsh
ips. | 167 // Use olderShadowRootOrParentTreeScope here for parent-child relationsh
ips. |
| 168 // See the definition of trees of trees in the Shadow DOM spec: | 168 // See the definition of trees of trees in the Shadow DOM spec: |
| 169 // http://w3c.github.io/webcomponents/spec/shadow/ | 169 // http://w3c.github.io/webcomponents/spec/shadow/ |
| 170 TreeScope* parent = treeScopeEventContext.get()->treeScope().olderShadow
RootOrParentTreeScope(); | 170 TreeScope* parent = treeScopeEventContext.get()->treeScope().olderShadow
RootOrParentTreeScope(); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 #if ENABLE(OILPAN) | 379 #if ENABLE(OILPAN) |
| 380 visitor->trace(m_nodeEventContexts); | 380 visitor->trace(m_nodeEventContexts); |
| 381 visitor->trace(m_node); | 381 visitor->trace(m_node); |
| 382 visitor->trace(m_event); | 382 visitor->trace(m_event); |
| 383 visitor->trace(m_treeScopeEventContexts); | 383 visitor->trace(m_treeScopeEventContexts); |
| 384 visitor->trace(m_windowEventContext); | 384 visitor->trace(m_windowEventContext); |
| 385 #endif | 385 #endif |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace blink | 388 } // namespace blink |
| OLD | NEW |