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

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

Issue 181663002: Have Document::elementSheet() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.cpp ('k') | Source/core/dom/Document.h » ('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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 setupParser("@-internal-selector ", string, ""); 1231 setupParser("@-internal-selector ", string, "");
1232 1232
1233 cssyyparse(this); 1233 cssyyparse(this);
1234 1234
1235 m_selectorListForParseSelector = 0; 1235 m_selectorListForParseSelector = 0;
1236 } 1236 }
1237 1237
1238 PassRefPtr<ImmutableStylePropertySet> BisonCSSParser::parseInlineStyleDeclaratio n(const String& string, Element* element) 1238 PassRefPtr<ImmutableStylePropertySet> BisonCSSParser::parseInlineStyleDeclaratio n(const String& string, Element* element)
1239 { 1239 {
1240 Document& document = element->document(); 1240 Document& document = element->document();
1241 CSSParserContext context = CSSParserContext(document.elementSheet()->content s()->parserContext(), UseCounter::getFrom(&document)); 1241 CSSParserContext context = CSSParserContext(document.elementSheet().contents ()->parserContext(), UseCounter::getFrom(&document));
1242 context.setMode((element->isHTMLElement() && !document.inQuirksMode()) ? HTM LStandardMode : HTMLQuirksMode); 1242 context.setMode((element->isHTMLElement() && !document.inQuirksMode()) ? HTM LStandardMode : HTMLQuirksMode);
1243 return BisonCSSParser(context).parseDeclaration(string, document.elementShee t()->contents()); 1243 return BisonCSSParser(context).parseDeclaration(string, document.elementShee t().contents());
1244 } 1244 }
1245 1245
1246 PassRefPtr<ImmutableStylePropertySet> BisonCSSParser::parseDeclaration(const Str ing& string, StyleSheetContents* contextStyleSheet) 1246 PassRefPtr<ImmutableStylePropertySet> BisonCSSParser::parseDeclaration(const Str ing& string, StyleSheetContents* contextStyleSheet)
1247 { 1247 {
1248 setStyleSheet(contextStyleSheet); 1248 setStyleSheet(contextStyleSheet);
1249 1249
1250 setupParser("@-internal-decls ", string, ""); 1250 setupParser("@-internal-decls ", string, "");
1251 cssyyparse(this); 1251 cssyyparse(this);
1252 m_rule = nullptr; 1252 m_rule = nullptr;
1253 1253
(...skipping 8911 matching lines...) Expand 10 before | Expand all | Expand 10 after
10165 { 10165 {
10166 // The tokenizer checks for the construct of an+b. 10166 // The tokenizer checks for the construct of an+b.
10167 // However, since the {ident} rule precedes the {nth} rule, some of those 10167 // However, since the {ident} rule precedes the {nth} rule, some of those
10168 // tokens are identified as string literal. Furthermore we need to accept 10168 // tokens are identified as string literal. Furthermore we need to accept
10169 // "odd" and "even" which does not match to an+b. 10169 // "odd" and "even" which does not match to an+b.
10170 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 10170 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
10171 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 10171 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
10172 } 10172 }
10173 10173
10174 } 10174 }
OLDNEW
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.cpp ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698