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

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

Issue 23264017: Implement support for unprefixed keyframes rules resolution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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
« no previous file with comments | « Source/core/css/CSSParser.h ('k') | Source/core/css/resolver/ScopedStyleResolver.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 10248 matching lines...) Expand 10 before | Expand all | Expand 10 after
10259 } 10259 }
10260 CASE("host") { 10260 CASE("host") {
10261 m_token = HOST_SYM; 10261 m_token = HOST_SYM;
10262 } 10262 }
10263 CASE("import") { 10263 CASE("import") {
10264 m_parsingMode = MediaQueryMode; 10264 m_parsingMode = MediaQueryMode;
10265 m_token = IMPORT_SYM; 10265 m_token = IMPORT_SYM;
10266 } 10266 }
10267 CASE("keyframes") { 10267 CASE("keyframes") {
10268 if (RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled()) 10268 if (RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled())
10269 m_token = WEBKIT_KEYFRAMES_SYM; 10269 m_token = KEYFRAMES_SYM;
10270 } 10270 }
10271 CASE("left-top") { 10271 CASE("left-top") {
10272 if (LIKELY(!hasEscape)) 10272 if (LIKELY(!hasEscape))
10273 m_token = LEFTTOP_SYM; 10273 m_token = LEFTTOP_SYM;
10274 } 10274 }
10275 CASE("left-middle") { 10275 CASE("left-middle") {
10276 if (LIKELY(!hasEscape)) 10276 if (LIKELY(!hasEscape))
10277 m_token = LEFTMIDDLE_SYM; 10277 m_token = LEFTMIDDLE_SYM;
10278 } 10278 }
10279 CASE("left-bottom") { 10279 CASE("left-bottom") {
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
11189 ensureLineEndings(); 11189 ensureLineEndings();
11190 TextPosition tokenPosition = TextPosition::fromOffsetAndLineEndings(loca tion.offset, *m_lineEndings); 11190 TextPosition tokenPosition = TextPosition::fromOffsetAndLineEndings(loca tion.offset, *m_lineEndings);
11191 lineNumberInStyleSheet = tokenPosition.m_line.zeroBasedInt(); 11191 lineNumberInStyleSheet = tokenPosition.m_line.zeroBasedInt();
11192 columnNumber = (lineNumberInStyleSheet ? 0 : m_startPosition.m_column.ze roBasedInt()) + tokenPosition.m_column.zeroBasedInt(); 11192 columnNumber = (lineNumberInStyleSheet ? 0 : m_startPosition.m_column.ze roBasedInt()) + tokenPosition.m_column.zeroBasedInt();
11193 } else { 11193 } else {
11194 lineNumberInStyleSheet = location.lineNumber; 11194 lineNumberInStyleSheet = location.lineNumber;
11195 } 11195 }
11196 console->addMessage(CSSMessageSource, WarningMessageLevel, message, m_styleS heet->baseURL().string(), lineNumberInStyleSheet + m_startPosition.m_line.zeroBa sedInt() + 1, columnNumber + 1); 11196 console->addMessage(CSSMessageSource, WarningMessageLevel, message, m_styleS heet->baseURL().string(), lineNumberInStyleSheet + m_startPosition.m_line.zeroBa sedInt() + 1, columnNumber + 1);
11197 } 11197 }
11198 11198
11199 StyleRuleKeyframes* CSSParser::createKeyframesRule(const String& name, PassOwnPt r<Vector<RefPtr<StyleKeyframe> > > popKeyframes) 11199 StyleRuleKeyframes* CSSParser::createKeyframesRule(const String& name, PassOwnPt r<Vector<RefPtr<StyleKeyframe> > > popKeyframes, bool isPrefixed)
11200 { 11200 {
11201 OwnPtr<Vector<RefPtr<StyleKeyframe> > > keyframes = popKeyframes; 11201 OwnPtr<Vector<RefPtr<StyleKeyframe> > > keyframes = popKeyframes;
11202 m_allowImportRules = m_allowNamespaceDeclarations = false; 11202 m_allowImportRules = m_allowNamespaceDeclarations = false;
11203 RefPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create(); 11203 RefPtr<StyleRuleKeyframes> rule = StyleRuleKeyframes::create();
11204 for (size_t i = 0; i < keyframes->size(); ++i) 11204 for (size_t i = 0; i < keyframes->size(); ++i)
11205 rule->parserAppendKeyframe(keyframes->at(i)); 11205 rule->parserAppendKeyframe(keyframes->at(i));
11206 rule->setName(name); 11206 rule->setName(name);
11207 rule->setVendorPrefixed(isPrefixed);
11207 StyleRuleKeyframes* rulePtr = rule.get(); 11208 StyleRuleKeyframes* rulePtr = rule.get();
11208 m_parsedRules.append(rule.release()); 11209 m_parsedRules.append(rule.release());
11209 endRuleBody(); 11210 endRuleBody();
11210 return rulePtr; 11211 return rulePtr;
11211 } 11212 }
11212 11213
11213 StyleRuleBase* CSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector> >* se lectors) 11214 StyleRuleBase* CSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector> >* se lectors)
11214 { 11215 {
11215 StyleRule* result = 0; 11216 StyleRule* result = 0;
11216 if (selectors) { 11217 if (selectors) {
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
11947 { 11948 {
11948 // The tokenizer checks for the construct of an+b. 11949 // The tokenizer checks for the construct of an+b.
11949 // However, since the {ident} rule precedes the {nth} rule, some of those 11950 // However, since the {ident} rule precedes the {nth} rule, some of those
11950 // tokens are identified as string literal. Furthermore we need to accept 11951 // tokens are identified as string literal. Furthermore we need to accept
11951 // "odd" and "even" which does not match to an+b. 11952 // "odd" and "even" which does not match to an+b.
11952 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11953 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11953 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11954 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11954 } 11955 }
11955 11956
11956 } 11957 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSParser.h ('k') | Source/core/css/resolver/ScopedStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698