| Index: Source/core/dom/EventRetargeter.cpp
|
| diff --git a/Source/core/dom/EventRetargeter.cpp b/Source/core/dom/EventRetargeter.cpp
|
| index da3e8297b406e616f6abb593b5469af5d1db5c25..8c950b2a4125ec08ca7013c165e5839321a686ce 100644
|
| --- a/Source/core/dom/EventRetargeter.cpp
|
| +++ b/Source/core/dom/EventRetargeter.cpp
|
| @@ -40,7 +40,7 @@ namespace WebCore {
|
|
|
| static inline bool inTheSameScope(ShadowRoot* shadowRoot, EventTarget* target)
|
| {
|
| - return target->toNode() && target->toNode()->treeScope().rootNode() == shadowRoot;
|
| + return target->toNode() && target->toNode()->treeScope()->rootNode() == shadowRoot;
|
| }
|
|
|
| static inline EventDispatchBehavior determineDispatchBehavior(Event* event, ShadowRoot* shadowRoot, EventTarget* target)
|
| @@ -120,17 +120,17 @@ void EventRetargeter::calculateAdjustedEventPathForEachNode(EventPath& eventPath
|
| TreeScope* lastScope = 0;
|
| size_t eventPathSize = eventPath.size();
|
| for (size_t i = 0; i < eventPathSize; ++i) {
|
| - TreeScope* currentScope = &eventPath[i]->node()->treeScope();
|
| + NonNullPtr<TreeScope> currentScope = eventPath[i]->node()->treeScope();
|
| if (currentScope == lastScope) {
|
| // Fast path.
|
| eventPath[i]->setEventPath(eventPath[i - 1]->eventPath());
|
| continue;
|
| }
|
| - lastScope = currentScope;
|
| + lastScope = currentScope.get();
|
| Vector<RefPtr<Node> > nodes;
|
| for (size_t j = 0; j < eventPathSize; ++j) {
|
| Node* node = eventPath[j]->node();
|
| - if (node->treeScope().isInclusiveAncestorOf(*currentScope))
|
| + if (node->treeScope()->isInclusiveAncestorOf(currentScope))
|
| nodes.append(node);
|
| }
|
| eventPath[i]->adoptEventPath(nodes);
|
| @@ -215,19 +215,19 @@ void EventRetargeter::calculateAdjustedNodes(const Node* node, const Node* relat
|
| TreeScope* lastTreeScope = 0;
|
| Node* adjustedNode = 0;
|
| for (EventPath::const_iterator iter = eventPath.begin(); iter < eventPath.end(); ++iter) {
|
| - TreeScope* scope = &(*iter)->node()->treeScope();
|
| + NonNullPtr<TreeScope> scope = (*iter)->node()->treeScope();
|
| if (scope == lastTreeScope) {
|
| // Re-use the previous adjustedRelatedTarget if treeScope does not change. Just for the performance optimization.
|
| adjustedNodes.append(adjustedNode);
|
| } else {
|
| - adjustedNode = findRelatedNode(scope, relatedNodeMap);
|
| + adjustedNode = findRelatedNode(scope.get(), relatedNodeMap);
|
| adjustedNodes.append(adjustedNode);
|
| }
|
| - lastTreeScope = scope;
|
| + lastTreeScope = scope.get();
|
| if (eventWithRelatedTargetDispatchBehavior == DoesNotStopAtBoundary)
|
| continue;
|
| if (targetIsIdenticalToToRelatedTarget) {
|
| - if (node->treeScope().rootNode() == (*iter)->node()) {
|
| + if (node->treeScope()->rootNode() == (*iter)->node()) {
|
| eventPath.shrink(iter + 1 - eventPath.begin());
|
| break;
|
| }
|
| @@ -250,11 +250,11 @@ void EventRetargeter::buildRelatedNodeMap(const Node* relatedNode, RelatedNodeMa
|
| relatedNodeStack.append(node);
|
| else if (walker.isVisitingInsertionPointInReprojection())
|
| relatedNodeStack.append(relatedNodeStack.last());
|
| - TreeScope* scope = &node->treeScope();
|
| + NonNullPtr<TreeScope> scope = node->treeScope();
|
| // Skips adding a node to the map if treeScope does not change. Just for the performance optimization.
|
| if (scope != lastTreeScope)
|
| - relatedNodeMap.add(scope, relatedNodeStack.last());
|
| - lastTreeScope = scope;
|
| + relatedNodeMap.add(scope.get(), relatedNodeStack.last());
|
| + lastTreeScope = scope.get();
|
| if (node->isShadowRoot()) {
|
| ASSERT(!relatedNodeStack.isEmpty());
|
| relatedNodeStack.removeLast();
|
|
|