Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: Source/core/dom/EventPathWalker.cpp

Issue 23717008: Remove useless null checks from Node::document() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 21 matching lines...) Expand all
32 #include "core/dom/shadow/ShadowRoot.h" 32 #include "core/dom/shadow/ShadowRoot.h"
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 EventPathWalker::EventPathWalker(const Node* node) 36 EventPathWalker::EventPathWalker(const Node* node)
37 : m_node(node) 37 : m_node(node)
38 , m_distributedNode(node) 38 , m_distributedNode(node)
39 , m_isVisitingInsertionPointInReprojection(false) 39 , m_isVisitingInsertionPointInReprojection(false)
40 { 40 {
41 ASSERT(node); 41 ASSERT(node);
42 // FIXME: It's not clear if we need this document check, but I think we do 42 node->document()->updateDistributionForNodeIfNeeded(const_cast<Node*>(node)) ;
43 // since DocType nodes from document.implementation.createDocumentType
44 // don't have a document().
45 if (Document* document = node->document())
46 document->updateDistributionForNodeIfNeeded(const_cast<Node*>(node));
47 } 43 }
48 44
49 Node* EventPathWalker::parent(const Node* node) 45 Node* EventPathWalker::parent(const Node* node)
50 { 46 {
51 EventPathWalker walker(node); 47 EventPathWalker walker(node);
52 walker.moveToParent(); 48 walker.moveToParent();
53 return walker.node(); 49 return walker.node();
54 } 50 }
55 51
56 void EventPathWalker::moveToParent() 52 void EventPathWalker::moveToParent()
(...skipping 20 matching lines...) Expand all
77 m_node = insertionPoint; 73 m_node = insertionPoint;
78 m_isVisitingInsertionPointInReprojection = true; 74 m_isVisitingInsertionPointInReprojection = true;
79 return; 75 return;
80 } 76 }
81 m_node = shadowRoot->host(); 77 m_node = shadowRoot->host();
82 m_distributedNode = m_node; 78 m_distributedNode = m_node;
83 m_isVisitingInsertionPointInReprojection = false; 79 m_isVisitingInsertionPointInReprojection = false;
84 } 80 }
85 81
86 } // namespace 82 } // namespace
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698