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

Unified Diff: sky/engine/core/css/RuleFeature.cpp

Issue 837883002: Store features in the ScopedStyleResoolver. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Simpler even. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/css/RuleFeature.cpp
diff --git a/sky/engine/core/css/RuleFeature.cpp b/sky/engine/core/css/RuleFeature.cpp
index 27f7e533a2e598732fb25318ebfd033269bbe6bc..29e36f2c1173dc29d118dcb20c75dc3adaea047a 100644
--- a/sky/engine/core/css/RuleFeature.cpp
+++ b/sky/engine/core/css/RuleFeature.cpp
@@ -91,71 +91,4 @@ void RuleFeatureSet::clear()
m_idNames.clear();
}
-void RuleFeatureSet::scheduleStyleInvalidationForClassChange(const SpaceSplitString& changedClasses, Element& element)
-{
- unsigned changedSize = changedClasses.size();
- for (unsigned i = 0; i < changedSize; ++i) {
- scheduleStyleInvalidationForClassChange(changedClasses[i], element);
- }
-}
-
-void RuleFeatureSet::scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClasses, const SpaceSplitString& newClasses, Element& element)
-{
- if (!oldClasses.size()) {
- scheduleStyleInvalidationForClassChange(newClasses, element);
- return;
- }
-
- // Class vectors tend to be very short. This is faster than using a hash table.
- BitVector remainingClassBits;
- remainingClassBits.ensureSize(oldClasses.size());
-
- for (unsigned i = 0; i < newClasses.size(); ++i) {
- bool found = false;
- for (unsigned j = 0; j < oldClasses.size(); ++j) {
- if (newClasses[i] == oldClasses[j]) {
- // Mark each class that is still in the newClasses so we can skip doing
- // an n^2 search below when looking for removals. We can't break from
- // this loop early since a class can appear more than once.
- remainingClassBits.quickSet(j);
- found = true;
- }
- }
- // Class was added.
- if (!found)
- scheduleStyleInvalidationForClassChange(newClasses[i], element);
- }
-
- for (unsigned i = 0; i < oldClasses.size(); ++i) {
- if (remainingClassBits.quickGet(i))
- continue;
- // Class was removed.
- scheduleStyleInvalidationForClassChange(oldClasses[i], element);
- }
-}
-
-void RuleFeatureSet::scheduleStyleInvalidationForAttributeChange(const QualifiedName& attributeName, Element& element)
-{
- if (m_attributeNames.contains(attributeName.localName()))
- element.setNeedsStyleRecalc(LocalStyleChange);
-}
-
-void RuleFeatureSet::scheduleStyleInvalidationForIdChange(const AtomicString& oldId, const AtomicString& newId, Element& element)
-{
- if (!oldId.isEmpty()) {
- if (m_idNames.contains(oldId))
- element.setNeedsStyleRecalc(LocalStyleChange);
- }
- if (!newId.isEmpty()) {
- if (m_idNames.contains(newId))
- element.setNeedsStyleRecalc(LocalStyleChange);
- }
-}
-
-void RuleFeatureSet::scheduleStyleInvalidationForClassChange(const AtomicString& className, Element& element)
-{
- if (m_classNames.contains(className))
- element.setNeedsStyleRecalc(LocalStyleChange);
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698