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

Unified Diff: Source/core/css/CSSPropertySourceData.h

Issue 951213004: Make CSSRuleSourceData use the CSSRule Type enum (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use StyleRule::Type Created 5 years, 10 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
« no previous file with comments | « no previous file | Source/core/css/StyleRule.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPropertySourceData.h
diff --git a/Source/core/css/CSSPropertySourceData.h b/Source/core/css/CSSPropertySourceData.h
index 2c473a257a01a8cf78c06a4ef12b5d632d20b18f..cef6b39a0a7f9972849c5c9c9c612c150168f483 100644
--- a/Source/core/css/CSSPropertySourceData.h
+++ b/Source/core/css/CSSPropertySourceData.h
@@ -31,6 +31,7 @@
#ifndef CSSPropertySourceData_h
#define CSSPropertySourceData_h
+#include "core/css/StyleRule.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/RefCounted.h"
@@ -117,41 +118,23 @@ typedef WillBeHeapVector<RefPtrWillBeMember<CSSRuleSourceData> > RuleSourceDataL
typedef WillBeHeapVector<SourceRange> SelectorRangeList;
struct CSSRuleSourceData : public RefCountedWillBeGarbageCollected<CSSRuleSourceData> {
- enum Type {
- UNKNOWN_RULE,
- STYLE_RULE,
- CHARSET_RULE,
- IMPORT_RULE,
- MEDIA_RULE,
- FONT_FACE_RULE,
- PAGE_RULE,
- KEYFRAMES_RULE,
- VIEWPORT_RULE,
- SUPPORTS_RULE,
- };
-
- static PassRefPtrWillBeRawPtr<CSSRuleSourceData> create(Type type)
+ static PassRefPtrWillBeRawPtr<CSSRuleSourceData> create(StyleRule::Type type)
{
return adoptRefWillBeNoop(new CSSRuleSourceData(type));
}
- static PassRefPtrWillBeRawPtr<CSSRuleSourceData> createUnknown()
- {
- return adoptRefWillBeNoop(new CSSRuleSourceData(UNKNOWN_RULE));
- }
-
- CSSRuleSourceData(Type type)
+ CSSRuleSourceData(StyleRule::Type type)
: type(type)
{
- if (type == STYLE_RULE || type == FONT_FACE_RULE || type == PAGE_RULE)
+ if (type == StyleRule::Style || type == StyleRule::FontFace || type == StyleRule::Page)
styleSourceData = CSSStyleSourceData::create();
- if (type == MEDIA_RULE || type == IMPORT_RULE)
+ if (type == StyleRule::Media || type == StyleRule::Import)
mediaSourceData = CSSMediaSourceData::create();
}
DECLARE_TRACE();
- Type type;
+ StyleRule::Type type;
// Range of the selector list in the enclosing source.
SourceRange ruleHeaderRange;
« no previous file with comments | « no previous file | Source/core/css/StyleRule.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698