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

Side by Side Diff: Source/core/events/EventPath.cpp

Issue 1265573003: Fix crash on null ptr dereference in EventPath propagation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update the comment (not necessarily async events) Created 5 years, 4 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/shadow/ShadowRoot.h ('k') | no next file » | 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 nodesInPath.append(insertionPoint); 126 nodesInPath.append(insertionPoint);
127 } 127 }
128 current = insertionPoints.last(); 128 current = insertionPoints.last();
129 continue; 129 continue;
130 } 130 }
131 if (current->isShadowRoot()) { 131 if (current->isShadowRoot()) {
132 if (m_event && shouldStopAtShadowRoot(*m_event, *toShadowRoot(curren t), *m_node)) 132 if (m_event && shouldStopAtShadowRoot(*m_event, *toShadowRoot(curren t), *m_node))
133 break; 133 break;
134 current = current->shadowHost(); 134 current = current->shadowHost();
135 #if !ENABLE(OILPAN)
136 // TODO(kochi): crbug.com/507413 This check is necessary when some a synchronous event
137 // is queued while its shadow host is removed and the shadow root ge ts the event
138 // immediately after it. When Oilpan is enabled, this situation doe s not happen.
139 // Except this case, shadow root's host is assumed to be non-null.
140 if (current)
141 nodesInPath.append(current);
142 #else
135 nodesInPath.append(current); 143 nodesInPath.append(current);
144 #endif
136 } else { 145 } else {
137 current = current->parentNode(); 146 current = current->parentNode();
138 if (current) 147 if (current)
139 nodesInPath.append(current); 148 nodesInPath.append(current);
140 } 149 }
141 } 150 }
142 151
143 m_nodeEventContexts.reserveCapacity(nodesInPath.size()); 152 m_nodeEventContexts.reserveCapacity(nodesInPath.size());
144 for (Node* nodeInPath : nodesInPath) { 153 for (Node* nodeInPath : nodesInPath) {
145 m_nodeEventContexts.append(NodeEventContext(nodeInPath, eventTargetRespe ctingTargetRules(*nodeInPath))); 154 m_nodeEventContexts.append(NodeEventContext(nodeInPath, eventTargetRespe ctingTargetRules(*nodeInPath)));
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 #if ENABLE(OILPAN) 371 #if ENABLE(OILPAN)
363 visitor->trace(m_nodeEventContexts); 372 visitor->trace(m_nodeEventContexts);
364 visitor->trace(m_node); 373 visitor->trace(m_node);
365 visitor->trace(m_event); 374 visitor->trace(m_event);
366 visitor->trace(m_treeScopeEventContexts); 375 visitor->trace(m_treeScopeEventContexts);
367 visitor->trace(m_windowEventContext); 376 visitor->trace(m_windowEventContext);
368 #endif 377 #endif
369 } 378 }
370 379
371 } // namespace 380 } // namespace
OLDNEW
« no previous file with comments | « Source/core/dom/shadow/ShadowRoot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698