| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 void EventPath::adjustForRelatedTarget(Node& target, EventTarget* relatedTarget) | 262 void EventPath::adjustForRelatedTarget(Node& target, EventTarget* relatedTarget) |
| 263 { | 263 { |
| 264 if (!relatedTarget) | 264 if (!relatedTarget) |
| 265 return; | 265 return; |
| 266 Node* relatedNode = relatedTarget->toNode(); | 266 Node* relatedNode = relatedTarget->toNode(); |
| 267 if (!relatedNode) | 267 if (!relatedNode) |
| 268 return; | 268 return; |
| 269 if (target.document() != relatedNode->document()) | 269 if (target.document() != relatedNode->document()) |
| 270 return; | 270 return; |
| 271 if (!target.inDocument() || !relatedNode->inDocument()) | 271 if (!target.inShadowIncludingDocument() || !relatedNode->inShadowIncludingDo
cument()) |
| 272 return; | 272 return; |
| 273 | 273 |
| 274 RelatedTargetMap relatedNodeMap; | 274 RelatedTargetMap relatedNodeMap; |
| 275 buildRelatedNodeMap(*relatedNode, relatedNodeMap); | 275 buildRelatedNodeMap(*relatedNode, relatedNodeMap); |
| 276 | 276 |
| 277 for (const auto& treeScopeEventContext : m_treeScopeEventContexts) { | 277 for (const auto& treeScopeEventContext : m_treeScopeEventContexts) { |
| 278 EventTarget* adjustedRelatedTarget = findRelatedNode(treeScopeEventConte
xt->treeScope(), relatedNodeMap); | 278 EventTarget* adjustedRelatedTarget = findRelatedNode(treeScopeEventConte
xt->treeScope(), relatedNodeMap); |
| 279 ASSERT(adjustedRelatedTarget); | 279 ASSERT(adjustedRelatedTarget); |
| 280 treeScopeEventContext.get()->setRelatedTarget(adjustedRelatedTarget); | 280 treeScopeEventContext.get()->setRelatedTarget(adjustedRelatedTarget); |
| 281 } | 281 } |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 DEFINE_TRACE(EventPath) | 377 DEFINE_TRACE(EventPath) |
| 378 { | 378 { |
| 379 visitor->trace(m_nodeEventContexts); | 379 visitor->trace(m_nodeEventContexts); |
| 380 visitor->trace(m_node); | 380 visitor->trace(m_node); |
| 381 visitor->trace(m_event); | 381 visitor->trace(m_event); |
| 382 visitor->trace(m_treeScopeEventContexts); | 382 visitor->trace(m_treeScopeEventContexts); |
| 383 visitor->trace(m_windowEventContext); | 383 visitor->trace(m_windowEventContext); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace blink | 386 } // namespace blink |
| OLD | NEW |