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

Unified Diff: Source/core/css/parser/BisonCSSParser-in.cpp

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 | « Source/core/css/parser/BisonCSSParser.h ('k') | Source/core/css/parser/CSSGrammar.y » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/BisonCSSParser-in.cpp
diff --git a/Source/core/css/parser/BisonCSSParser-in.cpp b/Source/core/css/parser/BisonCSSParser-in.cpp
index 529ed1d979e9cc3312ffd9b88b076c28f61a2eef..6147900256a56a1c6ffab8792f6994bb92c959e1 100644
--- a/Source/core/css/parser/BisonCSSParser-in.cpp
+++ b/Source/core/css/parser/BisonCSSParser-in.cpp
@@ -114,7 +114,7 @@ BisonCSSParser::BisonCSSParser(const CSSParserContext& context)
, m_defaultNamespace(starAtom)
, m_observer(0)
, m_source(0)
- , m_ruleHeaderType(CSSRuleSourceData::UNKNOWN_RULE)
+ , m_ruleHeaderType(StyleRule::Unknown)
, m_allowImportRules(true)
, m_allowNamespaceDeclarations(true)
, m_inViewport(false)
@@ -271,7 +271,7 @@ bool BisonCSSParser::parseDeclaration(MutableStylePropertySet* declaration, cons
setupParser("@-internal-decls ", string, "");
if (m_observer) {
- m_observer->startRuleHeader(CSSRuleSourceData::STYLE_RULE, 0);
+ m_observer->startRuleHeader(StyleRule::Style, 0);
m_observer->endRuleHeader(1);
m_observer->startRuleBody(0);
}
@@ -596,7 +596,7 @@ void BisonCSSParser::markSupportsRuleHeaderStart()
if (!m_supportsRuleDataStack)
m_supportsRuleDataStack = adoptPtrWillBeNoop(new RuleSourceDataList());
- RefPtrWillBeRawPtr<CSSRuleSourceData> data = CSSRuleSourceData::create(CSSRuleSourceData::SUPPORTS_RULE);
+ RefPtrWillBeRawPtr<CSSRuleSourceData> data = CSSRuleSourceData::create(StyleRule::Supports);
data->ruleHeaderRange.start = m_tokenizer.tokenStartOffset();
m_supportsRuleDataStack->append(data);
}
@@ -671,7 +671,7 @@ void BisonCSSParser::tokenToLowerCase(CSSParserString& token)
void BisonCSSParser::endInvalidRuleHeader()
{
- if (m_ruleHeaderType == CSSRuleSourceData::UNKNOWN_RULE)
+ if (m_ruleHeaderType == StyleRule::Unknown)
return;
CSSParserLocation location;
@@ -682,7 +682,7 @@ void BisonCSSParser::endInvalidRuleHeader()
else
location.token.init(m_tokenizer.m_dataStart16.get() + m_ruleHeaderStartOffset, 0);
- reportError(location, m_ruleHeaderType == CSSRuleSourceData::STYLE_RULE ? InvalidSelectorCSSError : InvalidRuleCSSError);
+ reportError(location, m_ruleHeaderType == StyleRule::Style ? InvalidSelectorCSSError : InvalidRuleCSSError);
endRuleHeader();
}
@@ -991,7 +991,7 @@ void BisonCSSParser::endRule(bool valid)
m_ruleHasHeader = true;
}
-void BisonCSSParser::startRuleHeader(CSSRuleSourceData::Type ruleType)
+void BisonCSSParser::startRuleHeader(StyleRule::Type ruleType)
{
resumeErrorLogging();
m_ruleHeaderType = ruleType;
@@ -1006,8 +1006,8 @@ void BisonCSSParser::startRuleHeader(CSSRuleSourceData::Type ruleType)
void BisonCSSParser::endRuleHeader()
{
- ASSERT(m_ruleHeaderType != CSSRuleSourceData::UNKNOWN_RULE);
- m_ruleHeaderType = CSSRuleSourceData::UNKNOWN_RULE;
+ ASSERT(m_ruleHeaderType != StyleRule::Unknown);
+ m_ruleHeaderType = StyleRule::Unknown;
if (m_observer) {
ASSERT(m_ruleHasHeader);
m_observer->endRuleHeader(m_tokenizer.safeUserStringTokenOffset());
« no previous file with comments | « Source/core/css/parser/BisonCSSParser.h ('k') | Source/core/css/parser/CSSGrammar.y » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698