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

Side by Side Diff: sky/engine/core/css/parser/BisonCSSParser.h

Issue 654693004: Remove meta viewport and @viewport CSS rules. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve d. 5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserve d.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 void startEndUnknownRule(); 206 void startEndUnknownRule();
207 207
208 void endInvalidRuleHeader(); 208 void endInvalidRuleHeader();
209 void reportError(const CSSParserLocation&, CSSParserError = GeneralCSSError) ; 209 void reportError(const CSSParserLocation&, CSSParserError = GeneralCSSError) ;
210 void resumeErrorLogging() { m_ignoreErrors = false; } 210 void resumeErrorLogging() { m_ignoreErrors = false; }
211 void setLocationLabel(const CSSParserLocation& location) { m_locationLabel = location; } 211 void setLocationLabel(const CSSParserLocation& location) { m_locationLabel = location; }
212 const CSSParserLocation& lastLocationLabel() const { return m_locationLabel; } 212 const CSSParserLocation& lastLocationLabel() const { return m_locationLabel; }
213 213
214 void tokenToLowerCase(CSSParserString& token); 214 void tokenToLowerCase(CSSParserString& token);
215 215
216 void markViewportRuleBodyStart() { m_inViewport = true; }
217 void markViewportRuleBodyEnd() { m_inViewport = false; }
218 StyleRuleBase* createViewportRule();
219
220 CSSParserLocation currentLocation() { return m_tokenizer.currentLocation(); } 216 CSSParserLocation currentLocation() { return m_tokenizer.currentLocation(); }
221 217
222 private: 218 private:
223 class StyleDeclarationScope {
224 STACK_ALLOCATED();
225 WTF_MAKE_NONCOPYABLE(StyleDeclarationScope);
226 public:
227 StyleDeclarationScope(BisonCSSParser* parser, const StylePropertySet* de claration)
228 : m_parser(parser)
229 , m_mode(declaration->cssParserMode())
230 {
231 if (isCSSViewportParsingEnabledForMode(m_mode)) {
232 ASSERT(!m_parser->inViewport());
233 m_parser->markViewportRuleBodyStart();
234 }
235 }
236
237 ~StyleDeclarationScope()
238 {
239 if (isCSSViewportParsingEnabledForMode(m_mode))
240 m_parser->markViewportRuleBodyEnd();
241 }
242
243 private:
244 BisonCSSParser* m_parser;
245 CSSParserMode m_mode;
246 };
247
248 inline void ensureLineEndings(); 219 inline void ensureLineEndings();
249 220
250 void setStyleSheet(StyleSheetContents* styleSheet) { m_styleSheet = styleShe et; } 221 void setStyleSheet(StyleSheetContents* styleSheet) { m_styleSheet = styleShe et; }
251 222
252 bool inViewport() const { return m_inViewport; } 223 bool inViewport() const { return m_inViewport; }
253 224
254 void recheckAtKeyword(const UChar* str, int len); 225 void recheckAtKeyword(const UChar* str, int len);
255 226
256 template<unsigned prefixLength, unsigned suffixLength> 227 template<unsigned prefixLength, unsigned suffixLength>
257 inline void setupParser(const char (&prefix)[prefixLength], const String& st ring, const char (&suffix)[suffixLength]) 228 inline void setupParser(const char (&prefix)[prefixLength], const String& st ring, const char (&suffix)[suffixLength])
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 inline int cssyylex(void* yylval, BisonCSSParser* parser) 283 inline int cssyylex(void* yylval, BisonCSSParser* parser)
313 { 284 {
314 return parser->m_tokenizer.lex(yylval); 285 return parser->m_tokenizer.lex(yylval);
315 } 286 }
316 287
317 bool isValidNthToken(const CSSParserString&); 288 bool isValidNthToken(const CSSParserString&);
318 289
319 } // namespace blink 290 } // namespace blink
320 291
321 #endif // BisonCSSParser_h 292 #endif // BisonCSSParser_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698