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

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

Issue 216433003: RFC: Make BisonCSSParser purely stack allocated. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 using namespace std; 101 using namespace std;
102 using namespace WTF; 102 using namespace WTF;
103 103
104 namespace WebCore { 104 namespace WebCore {
105 105
106 static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX; 106 static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;
107 107
108 BisonCSSParser::BisonCSSParser(const CSSParserContext& context) 108 BisonCSSParser::BisonCSSParser(const CSSParserContext& context)
109 : m_context(context) 109 : m_context(context)
110 , m_important(false)
111 , m_id(CSSPropertyInvalid)
112 , m_styleSheet(0)
113 , m_supportsCondition(false)
114 , m_selectorListForParseSelector(0)
115 , m_numParsedPropertiesBeforeMarginBox(INVALID_NUM_PARSED_PROPERTIES)
116 , m_hasFontFaceOnlyValues(false)
117 , m_hadSyntacticallyValidCSSRule(false)
118 , m_logErrors(false)
119 , m_ignoreErrors(false)
120 , m_defaultNamespace(starAtom)
121 , m_observer(0)
122 , m_source(0)
123 , m_ruleHeaderType(CSSRuleSourceData::UNKNOWN_RULE)
124 , m_allowImportRules(true)
125 , m_allowNamespaceDeclarations(true)
126 , m_inViewport(false)
127 , m_tokenizer(*this) 110 , m_tokenizer(*this)
128 { 111 {
112 init();
113 }
114
115 BisonCSSParser::BisonCSSParser(Document* document)
eseidel 2014/03/28 22:09:24 Why is this needed? We could also add a parserCon
wibling-chromium 2014/03/31 08:06:36 Sure, I will do that instead of the constructor.
116 : m_context(document ? CSSParserContext(*document, 0) : strictCSSParserConte xt())
117 , m_tokenizer(*this)
118 {
119 init();
120 }
121
122 void BisonCSSParser::init()
123 {
124 m_important = false;
125 m_id = CSSPropertyInvalid;
126 m_styleSheet = 0;
127 m_supportsCondition = false;
128 m_selectorListForParseSelector = 0;
129 m_numParsedPropertiesBeforeMarginBox =INVALID_NUM_PARSED_PROPERTIES;
130 m_hasFontFaceOnlyValues = false;
131 m_hadSyntacticallyValidCSSRule = false;
132 m_logErrors = false;
133 m_ignoreErrors = false;
134 m_defaultNamespace = starAtom;
135 m_observer = 0;
136 m_source = 0;
137 m_ruleHeaderType = CSSRuleSourceData::UNKNOWN_RULE;
138 m_allowImportRules = true;
139 m_allowNamespaceDeclarations = true;
140 m_inViewport = false;
129 #if YYDEBUG > 0 141 #if YYDEBUG > 0
130 cssyydebug = 1; 142 cssyydebug = 1;
131 #endif 143 #endif
132 CSSPropertySourceData::init(); 144 CSSPropertySourceData::init();
133 } 145 }
134 146
135 BisonCSSParser::~BisonCSSParser() 147 BisonCSSParser::~BisonCSSParser()
136 { 148 {
137 clearProperties(); 149 clearProperties();
138 150
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after
2168 rule->setProperties(createStylePropertySet()); 2180 rule->setProperties(createStylePropertySet());
2169 clearProperties(); 2181 clearProperties();
2170 2182
2171 StyleRuleViewport* result = rule.get(); 2183 StyleRuleViewport* result = rule.get();
2172 m_parsedRules.append(rule.release()); 2184 m_parsedRules.append(rule.release());
2173 2185
2174 return result; 2186 return result;
2175 } 2187 }
2176 2188
2177 } 2189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698