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

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp

Issue 2241193004: Fix a crash: SlotAssignment is unintentionally created for v0 shadow trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/shadow/SlotAssignment.h" 5 #include "core/dom/shadow/SlotAssignment.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/dom/ElementTraversal.h" 8 #include "core/dom/ElementTraversal.h"
9 #include "core/dom/NodeTraversal.h" 9 #include "core/dom/NodeTraversal.h"
10 #include "core/dom/shadow/ElementShadow.h" 10 #include "core/dom/shadow/ElementShadow.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 m_owner->owner()->setNeedsDistributionRecalc(); 98 m_owner->owner()->setNeedsDistributionRecalc();
99 } 99 }
100 } 100 }
101 101
102 SlotAssignment::SlotAssignment(ShadowRoot& owner) 102 SlotAssignment::SlotAssignment(ShadowRoot& owner)
103 : m_slotMap(DocumentOrderedMap::create()) 103 : m_slotMap(DocumentOrderedMap::create())
104 , m_owner(&owner) 104 , m_owner(&owner)
105 , m_needsCollectSlots(false) 105 , m_needsCollectSlots(false)
106 , m_slotCount(0) 106 , m_slotCount(0)
107 { 107 {
108 DCHECK(owner.isV1());
108 } 109 }
109 110
110 static void detachNotAssignedNode(Node& node) 111 static void detachNotAssignedNode(Node& node)
111 { 112 {
112 if (node.layoutObject()) 113 if (node.layoutObject())
113 node.lazyReattachIfAttached(); 114 node.lazyReattachIfAttached();
114 } 115 }
115 116
116 void SlotAssignment::resolveAssignment() 117 void SlotAssignment::resolveAssignment()
117 { 118 {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 } 178 }
178 179
179 DEFINE_TRACE(SlotAssignment) 180 DEFINE_TRACE(SlotAssignment)
180 { 181 {
181 visitor->trace(m_slots); 182 visitor->trace(m_slots);
182 visitor->trace(m_slotMap); 183 visitor->trace(m_slotMap);
183 visitor->trace(m_owner); 184 visitor->trace(m_owner);
184 } 185 }
185 186
186 } // namespace blink 187 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698