OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 if (other.m_universalSiblingInvalidationSet) | 902 if (other.m_universalSiblingInvalidationSet) |
903 ensureUniversalSiblingInvalidationSet().combine( | 903 ensureUniversalSiblingInvalidationSet().combine( |
904 *other.m_universalSiblingInvalidationSet); | 904 *other.m_universalSiblingInvalidationSet); |
905 if (other.m_nthInvalidationSet) | 905 if (other.m_nthInvalidationSet) |
906 ensureNthInvalidationSet().combine(*other.m_nthInvalidationSet); | 906 ensureNthInvalidationSet().combine(*other.m_nthInvalidationSet); |
907 | 907 |
908 m_metadata.add(other.m_metadata); | 908 m_metadata.add(other.m_metadata); |
909 | 909 |
910 m_siblingRules.appendVector(other.m_siblingRules); | 910 m_siblingRules.appendVector(other.m_siblingRules); |
911 m_uncommonAttributeRules.appendVector(other.m_uncommonAttributeRules); | 911 m_uncommonAttributeRules.appendVector(other.m_uncommonAttributeRules); |
| 912 m_viewportDependentMediaQueryResults.appendVector( |
| 913 other.m_viewportDependentMediaQueryResults); |
| 914 m_deviceDependentMediaQueryResults.appendVector( |
| 915 other.m_deviceDependentMediaQueryResults); |
912 } | 916 } |
913 | 917 |
914 void RuleFeatureSet::clear() { | 918 void RuleFeatureSet::clear() { |
915 m_siblingRules.clear(); | 919 m_siblingRules.clear(); |
916 m_uncommonAttributeRules.clear(); | 920 m_uncommonAttributeRules.clear(); |
917 m_metadata.clear(); | 921 m_metadata.clear(); |
918 m_classInvalidationSets.clear(); | 922 m_classInvalidationSets.clear(); |
919 m_attributeInvalidationSets.clear(); | 923 m_attributeInvalidationSets.clear(); |
920 m_idInvalidationSets.clear(); | 924 m_idInvalidationSets.clear(); |
921 m_pseudoInvalidationSets.clear(); | 925 m_pseudoInvalidationSets.clear(); |
922 m_universalSiblingInvalidationSet.clear(); | 926 m_universalSiblingInvalidationSet.clear(); |
923 m_nthInvalidationSet.clear(); | 927 m_nthInvalidationSet.clear(); |
| 928 m_viewportDependentMediaQueryResults.clear(); |
| 929 m_deviceDependentMediaQueryResults.clear(); |
924 } | 930 } |
925 | 931 |
926 void RuleFeatureSet::collectInvalidationSetsForClass( | 932 void RuleFeatureSet::collectInvalidationSetsForClass( |
927 InvalidationLists& invalidationLists, | 933 InvalidationLists& invalidationLists, |
928 Element& element, | 934 Element& element, |
929 const AtomicString& className) const { | 935 const AtomicString& className) const { |
930 InvalidationSetMap::const_iterator it = | 936 InvalidationSetMap::const_iterator it = |
931 m_classInvalidationSets.find(className); | 937 m_classInvalidationSets.find(className); |
932 if (it == m_classInvalidationSets.end()) | 938 if (it == m_classInvalidationSets.end()) |
933 return; | 939 return; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 if (&siblingFeatures == &descendantFeatures) | 1139 if (&siblingFeatures == &descendantFeatures) |
1134 universalSet.setInvalidatesSelf(); | 1140 universalSet.setInvalidatesSelf(); |
1135 else | 1141 else |
1136 addFeaturesToInvalidationSet(universalSet.ensureSiblingDescendants(), | 1142 addFeaturesToInvalidationSet(universalSet.ensureSiblingDescendants(), |
1137 descendantFeatures); | 1143 descendantFeatures); |
1138 } | 1144 } |
1139 | 1145 |
1140 DEFINE_TRACE(RuleFeatureSet) { | 1146 DEFINE_TRACE(RuleFeatureSet) { |
1141 visitor->trace(m_siblingRules); | 1147 visitor->trace(m_siblingRules); |
1142 visitor->trace(m_uncommonAttributeRules); | 1148 visitor->trace(m_uncommonAttributeRules); |
| 1149 visitor->trace(m_viewportDependentMediaQueryResults); |
| 1150 visitor->trace(m_deviceDependentMediaQueryResults); |
1143 } | 1151 } |
1144 | 1152 |
1145 void RuleFeatureSet::InvalidationSetFeatures::add( | 1153 void RuleFeatureSet::InvalidationSetFeatures::add( |
1146 const InvalidationSetFeatures& other) { | 1154 const InvalidationSetFeatures& other) { |
1147 classes.appendVector(other.classes); | 1155 classes.appendVector(other.classes); |
1148 attributes.appendVector(other.attributes); | 1156 attributes.appendVector(other.attributes); |
1149 ids.appendVector(other.ids); | 1157 ids.appendVector(other.ids); |
1150 tagNames.appendVector(other.tagNames); | 1158 tagNames.appendVector(other.tagNames); |
1151 maxDirectAdjacentSelectors = | 1159 maxDirectAdjacentSelectors = |
1152 std::max(maxDirectAdjacentSelectors, other.maxDirectAdjacentSelectors); | 1160 std::max(maxDirectAdjacentSelectors, other.maxDirectAdjacentSelectors); |
(...skipping 11 matching lines...) Expand all Loading... |
1164 return !classes.isEmpty() || !attributes.isEmpty() || !ids.isEmpty() || | 1172 return !classes.isEmpty() || !attributes.isEmpty() || !ids.isEmpty() || |
1165 !tagNames.isEmpty() || customPseudoElement; | 1173 !tagNames.isEmpty() || customPseudoElement; |
1166 } | 1174 } |
1167 | 1175 |
1168 bool RuleFeatureSet::InvalidationSetFeatures::hasTagIdClassOrAttribute() const { | 1176 bool RuleFeatureSet::InvalidationSetFeatures::hasTagIdClassOrAttribute() const { |
1169 return !classes.isEmpty() || !attributes.isEmpty() || !ids.isEmpty() || | 1177 return !classes.isEmpty() || !attributes.isEmpty() || !ids.isEmpty() || |
1170 !tagNames.isEmpty(); | 1178 !tagNames.isEmpty(); |
1171 } | 1179 } |
1172 | 1180 |
1173 } // namespace blink | 1181 } // namespace blink |
OLD | NEW |