OLD | NEW |
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 Loading... |
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(Element*); |
137 | 138 |
138 private: | 139 private: |
139 void distribute(Element* host); | 140 void distribute(Element* host); |
140 bool invalidate(Element* host); | 141 bool invalidate(Element* host, Vector<Node*>& nodesNeedingReattach); |
141 void populate(Node*, ContentDistribution&); | 142 void populate(Node*, ContentDistribution&); |
142 | 143 |
143 void collectSelectFeatureSetFrom(ShadowRoot*); | 144 void collectSelectFeatureSetFrom(ShadowRoot*); |
144 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } | 145 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } |
145 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } | 146 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } |
146 | 147 |
147 void setValidity(Validity validity) { m_validity = validity; } | 148 void setValidity(Validity validity) { m_validity = validity; } |
148 bool isValid() const { return m_validity == Valid; } | 149 bool isValid() const { return m_validity == Valid; } |
149 bool needsDistribution() const; | 150 bool needsDistribution() const; |
150 bool needsInvalidation() const { return m_validity != Invalidated; } | 151 bool needsInvalidation() const { return m_validity != Invalidated; } |
151 | 152 |
152 HashMap<const Node*, RefPtr<InsertionPoint> > m_nodeToInsertionPoint; | 153 typedef HashMap<const Node*, RefPtr<InsertionPoint> > NodeInsertionPointMap; |
| 154 NodeInsertionPointMap m_nodeToInsertionPoint; |
153 SelectRuleFeatureSet m_selectFeatures; | 155 SelectRuleFeatureSet m_selectFeatures; |
154 unsigned m_needsSelectFeatureSet : 1; | 156 unsigned m_needsSelectFeatureSet : 1; |
155 unsigned m_validity : 2; | 157 unsigned m_validity : 2; |
156 }; | 158 }; |
157 | 159 |
158 inline bool ContentDistributor::needsDistribution() const | 160 inline bool ContentDistributor::needsDistribution() const |
159 { | 161 { |
160 // During the invalidation, re-distribution should be supressed. | 162 // During the invalidation, re-distribution should be supressed. |
161 return m_validity != Valid && m_validity != Invalidating; | 163 return m_validity != Valid && m_validity != Invalidating; |
162 } | 164 } |
163 | 165 |
164 } | 166 } |
165 | 167 |
166 #endif | 168 #endif |
OLD | NEW |