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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 135 |
136 static void ensureDistribution(ShadowRoot*); | 136 static void ensureDistribution(ShadowRoot*); |
137 | 137 static void ensureDistribution(ElementShadow*); |
138 private: | 138 private: |
139 void distribute(Element* host); | 139 void distribute(Element* host); |
140 bool invalidate(Element* host); | 140 bool invalidate(Element* host, Vector<RefPtr<Node> >& nodesNeedingReattach); |
141 void populate(Node*, ContentDistribution&); | 141 void populate(Node*, ContentDistribution&); |
142 | 142 |
143 void collectSelectFeatureSetFrom(ShadowRoot*); | 143 void collectSelectFeatureSetFrom(ShadowRoot*); |
144 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } | 144 bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; } |
145 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } | 145 void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; } |
146 | 146 |
147 void setValidity(Validity validity) { m_validity = validity; } | 147 void setValidity(Validity validity) { m_validity = validity; } |
148 bool isValid() const { return m_validity == Valid; } | 148 bool isValid() const { return m_validity == Valid; } |
149 bool needsDistribution() const; | 149 bool needsDistribution() const; |
150 bool needsInvalidation() const { return m_validity != Invalidated; } | 150 bool needsInvalidation() const { return m_validity != Invalidated; } |
151 | 151 |
| 152 static void ensureDistribution(Element* host); |
| 153 |
152 HashMap<const Node*, RefPtr<InsertionPoint> > m_nodeToInsertionPoint; | 154 HashMap<const Node*, RefPtr<InsertionPoint> > 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 |