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

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

Issue 219183002: Disable the thread-safe MQ parser for main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Testing BisonCSSParser Created 6 years, 8 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
« no previous file with comments | « Source/core/css/parser/BisonCSSParser.h ('k') | Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 declaration->addParsedProperties(m_parsedProperties); 1205 declaration->addParsedProperties(m_parsedProperties);
1206 clearProperties(); 1206 clearProperties();
1207 } 1207 }
1208 1208
1209 if (m_observer) 1209 if (m_observer)
1210 m_observer->endRuleBody(string.length(), false); 1210 m_observer->endRuleBody(string.length(), false);
1211 1211
1212 return ok; 1212 return ok;
1213 } 1213 }
1214 1214
1215 PassRefPtrWillBeRawPtr<MediaQuerySet> BisonCSSParser::parseMediaQueryList(const String& string)
1216 {
1217 ASSERT(!m_mediaList);
1218
1219 // can't use { because tokenizer state switches from mediaquery to initial s tate when it sees { token.
1220 // instead insert one " " (which is caught by maybe_space in CSSGrammar.y)
1221 setupParser("@-internal-medialist ", string, "");
1222 cssyyparse(this);
1223
1224 ASSERT(m_mediaList);
1225 return m_mediaList.release();
1226 }
1227
1215 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties) 1228 static inline void filterProperties(bool important, const WillBeHeapVector<CSSPr operty, 256>& input, WillBeHeapVector<CSSProperty, 256>& output, size_t& unusedE ntries, BitArray<numCSSProperties>& seenProperties)
1216 { 1229 {
1217 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found. 1230 // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
1218 for (int i = input.size() - 1; i >= 0; --i) { 1231 for (int i = input.size() - 1; i >= 0; --i) {
1219 const CSSProperty& property = input[i]; 1232 const CSSProperty& property = input[i];
1220 if (property.isImportant() != important) 1233 if (property.isImportant() != important)
1221 continue; 1234 continue;
1222 const unsigned propertyIDIndex = property.id() - firstCSSProperty; 1235 const unsigned propertyIDIndex = property.id() - firstCSSProperty;
1223 if (seenProperties.get(propertyIDIndex)) 1236 if (seenProperties.get(propertyIDIndex))
1224 continue; 1237 continue;
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
2172 rule->setProperties(createStylePropertySet()); 2185 rule->setProperties(createStylePropertySet());
2173 clearProperties(); 2186 clearProperties();
2174 2187
2175 StyleRuleViewport* result = rule.get(); 2188 StyleRuleViewport* result = rule.get();
2176 m_parsedRules.append(rule.release()); 2189 m_parsedRules.append(rule.release());
2177 2190
2178 return result; 2191 return result;
2179 } 2192 }
2180 2193
2181 } 2194 }
OLDNEW
« no previous file with comments | « Source/core/css/parser/BisonCSSParser.h ('k') | Source/core/html/parser/HTMLPreloadScanner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698