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

Unified Diff: Source/core/css/analyzer/RuleSetAnalyzer.h

Issue 129633003: Add a first pass of a class descendant invalidator, and a containing RuleSetAnalyzer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed name Created 6 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: Source/core/css/analyzer/RuleSetAnalyzer.h
diff --git a/Source/core/svg/SVGAnimatedLength.h b/Source/core/css/analyzer/RuleSetAnalyzer.h
similarity index 64%
copy from Source/core/svg/SVGAnimatedLength.h
copy to Source/core/css/analyzer/RuleSetAnalyzer.h
index 36efeb08d1e17fe2c1615d9c4d22d4f31978fd32..14cfebfa2d7f9d06a3b5e92edf708387f72952c2 100644
--- a/Source/core/svg/SVGAnimatedLength.h
+++ b/Source/core/css/analyzer/RuleSetAnalyzer.h
@@ -28,31 +28,36 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SVGAnimatedLength_h
-#define SVGAnimatedLength_h
+#ifndef RuleSetAnalyzer_h
+#define RuleSetAnalyzer_h
-#include "core/svg/SVGLengthTearOff.h"
-#include "core/svg/properties/NewSVGAnimatedProperty.h"
+#include "core/css/analyzer/DescendantInvalidationSet.h"
+#include "wtf/RefCounted.h"
namespace WebCore {
-class SVGAnimatedLength : public NewSVGAnimatedProperty<SVGLength> {
+class CSSSelector;
+class RuleFeatureSet;
+class RuleData;
+
+// Keeps track of information about a set of CSS rules in order to answer style questions about them.
+class RuleSetAnalyzer : public RefCounted<RuleSetAnalyzer> {
public:
- static PassRefPtr<SVGAnimatedLength> create(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtr<SVGLength> initialValue)
- {
- return adoptRef(new SVGAnimatedLength(contextElement, attributeName, initialValue));
- }
-
- void setDefaultValueAsString(const String&);
- void setBaseValueAsString(const String&, SVGLengthNegativeValuesMode, SVGParsingError&);
-
-protected:
- SVGAnimatedLength(SVGElement* contextElement, const QualifiedName& attributeName, PassRefPtr<SVGLength> initialValue)
- : NewSVGAnimatedProperty<SVGLength>(contextElement, attributeName, initialValue)
- {
- }
+ static PassRefPtr<RuleSetAnalyzer> create();
+
+ void collectFeaturesFromRuleData(RuleFeatureSet& features, const RuleData&);
+ void combine(const RuleSetAnalyzer& other);
+private:
+ RuleSetAnalyzer();
+ typedef HashMap<AtomicString, RefPtr<DescendantInvalidationSet> > InvalidationSetMap;
+
+ DescendantInvalidationSet* ensureClassInvalidationSet(const AtomicString& className);
+
+ bool updateClassInvalidationSets(const CSSSelector*);
+
+ InvalidationSetMap m_classInvalidationSets;
};
} // namespace WebCore
-#endif // SVGAnimatedLength_h
+#endif // RuleSetAnalyzer_h

Powered by Google App Engine
This is Rietveld 408576698