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

Side by Side Diff: Source/core/dom/shadow/ContentDistributor.h

Issue 17054002: Element::recalcStyle() overly reattach()-es InsertionPoints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 InsertionPoint* findInsertionPointFor(const Node* key) const; 125 InsertionPoint* findInsertionPointFor(const Node* key) const;
126 const SelectRuleFeatureSet& ensureSelectFeatureSet(ElementShadow*); 126 const SelectRuleFeatureSet& ensureSelectFeatureSet(ElementShadow*);
127 127
128 void distributeSelectionsTo(InsertionPoint*, const ContentDistribution& pool , Vector<bool>& distributed); 128 void distributeSelectionsTo(InsertionPoint*, const ContentDistribution& pool , Vector<bool>& distributed);
129 void distributeNodeChildrenTo(InsertionPoint*, ContainerNode*); 129 void distributeNodeChildrenTo(InsertionPoint*, ContainerNode*);
130 130
131 void invalidateDistribution(Element* host); 131 void invalidateDistribution(Element* host);
132 void didShadowBoundaryChange(Element* host); 132 void didShadowBoundaryChange(Element* host);
133 void didAffectSelector(Element* host, AffectedSelectorMask); 133 void didAffectSelector(Element* host, AffectedSelectorMask);
134 void willAffectSelector(Element* host); 134 void willAffectSelector(Element* host);
135 void setNeedsStyleRecalcIfDistributedTo(Element* host, InsertionPoint*);
135 136
136 static void ensureDistribution(ShadowRoot*); 137 static void ensureDistribution(ShadowRoot*);
138 static void ensureDistribution(ElementShadow*);
139 static void ensureDistribution(Element*);
137 140
138 private: 141 private:
139 void distribute(Element* host); 142 void distribute(Element* host);
140 bool invalidate(Element* host); 143 bool invalidate(Element* host, Vector<RefPtr<Node> >& nodesNeedingReattach);
141 void populate(Node*, ContentDistribution&); 144 void populate(Node*, ContentDistribution&);
142 145
143 void collectSelectFeatureSetFrom(ShadowRoot*); 146 void collectSelectFeatureSetFrom(ShadowRoot*);
144 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } 147 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; }
145 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } 148 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; }
146 149
147 void setValidity(Validity validity) { m_validity = validity; } 150 void setValidity(Validity validity) { m_validity = validity; }
148 bool isValid() const { return m_validity == Valid; } 151 bool isValid() const { return m_validity == Valid; }
149 bool needsDistribution() const; 152 bool needsDistribution() const;
150 bool needsInvalidation() const { return m_validity != Invalidated; } 153 bool needsInvalidation() const { return m_validity != Invalidated; }
151 154
152 HashMap<const Node*, RefPtr<InsertionPoint> > m_nodeToInsertionPoint; 155 typedef HashMap<const Node*, RefPtr<InsertionPoint> > NodeInsertionPointMap;
156 NodeInsertionPointMap m_nodeToInsertionPoint;
153 SelectRuleFeatureSet m_selectFeatures; 157 SelectRuleFeatureSet m_selectFeatures;
154 unsigned m_needsSelectFeatureSet : 1; 158 unsigned m_needsSelectFeatureSet : 1;
155 unsigned m_validity : 2; 159 unsigned m_validity : 2;
156 }; 160 };
157 161
158 inline bool ContentDistributor::needsDistribution() const 162 inline bool ContentDistributor::needsDistribution() const
159 { 163 {
160 // During the invalidation, re-distribution should be supressed. 164 // During the invalidation, re-distribution should be supressed.
161 return m_validity != Valid && m_validity != Invalidating; 165 return m_validity != Valid && m_validity != Invalidating;
162 } 166 }
163 167
164 } 168 }
165 169
166 #endif 170 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698