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

Side by Side Diff: third_party/WebKit/Source/core/events/TreeScopeEventContext.cpp

Issue 2270293002: Replace ASSERT*() with DCHECK*() in core/events/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: isUnreachableNode -> checkReachableNode Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/events/TreeScopeEventContext.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) 2014 Google Inc. All Rights Reserved. 2 * Copyright (C) 2014 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // (2) If no closed shadow root in ancestors of this, include it. 46 // (2) If no closed shadow root in ancestors of this, include it.
47 if (!containingClosedShadowTree()) 47 if (!containingClosedShadowTree())
48 return true; 48 return true;
49 49
50 // (3) If |this| is descendent of |other|, exclude if any closed shadow root in between. 50 // (3) If |this| is descendent of |other|, exclude if any closed shadow root in between.
51 if (isDescendantOf(other)) 51 if (isDescendantOf(other))
52 return !containingClosedShadowTree()->isDescendantOf(other); 52 return !containingClosedShadowTree()->isDescendantOf(other);
53 53
54 // (4) |this| and |other| must be in exclusive branches. 54 // (4) |this| and |other| must be in exclusive branches.
55 ASSERT(other.isExclusivePartOf(*this)); 55 #if DCHECK_IS_ON()
56 DCHECK(other.isExclusivePartOf(*this));
57 #endif
56 return false; 58 return false;
57 } 59 }
58 60
59 HeapVector<Member<EventTarget>>& TreeScopeEventContext::ensureEventPath(EventPat h& path) 61 HeapVector<Member<EventTarget>>& TreeScopeEventContext::ensureEventPath(EventPat h& path)
60 { 62 {
61 if (m_eventPath) 63 if (m_eventPath)
62 return *m_eventPath; 64 return *m_eventPath;
63 65
64 m_eventPath = new HeapVector<Member<EventTarget>>(); 66 m_eventPath = new HeapVector<Member<EventTarget>>();
65 LocalDOMWindow* window = path.windowEventContext().window(); 67 LocalDOMWindow* window = path.windowEventContext().window();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 m_preOrder = orderNumber; 114 m_preOrder = orderNumber;
113 m_containingClosedShadowTree = (rootNode().isShadowRoot() && !toShadowRoot(r ootNode()).isOpenOrV0()) ? this : nearestAncestorClosedTreeScopeEventContext; 115 m_containingClosedShadowTree = (rootNode().isShadowRoot() && !toShadowRoot(r ootNode()).isOpenOrV0()) ? this : nearestAncestorClosedTreeScopeEventContext;
114 for (size_t i = 0; i < m_children.size(); ++i) 116 for (size_t i = 0; i < m_children.size(); ++i)
115 orderNumber = m_children[i]->calculateTreeOrderAndSetNearestAncestorClos edTree(orderNumber + 1, containingClosedShadowTree()); 117 orderNumber = m_children[i]->calculateTreeOrderAndSetNearestAncestorClos edTree(orderNumber + 1, containingClosedShadowTree());
116 m_postOrder = orderNumber + 1; 118 m_postOrder = orderNumber + 1;
117 119
118 return orderNumber + 1; 120 return orderNumber + 1;
119 } 121 }
120 122
121 } // namespace blink 123 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/TreeScopeEventContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698