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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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/CSSGradientValue.cpp ('k') | Source/core/css/CSSStyleSheet.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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 1278
1279 setupParser("@-internal-selector ", string, ""); 1279 setupParser("@-internal-selector ", string, "");
1280 1280
1281 cssyyparse(this); 1281 cssyyparse(this);
1282 1282
1283 m_selectorListForParseSelector = 0; 1283 m_selectorListForParseSelector = 0;
1284 } 1284 }
1285 1285
1286 PassRefPtr<ImmutableStylePropertySet> CSSParser::parseInlineStyleDeclaration(con st String& string, Element* element) 1286 PassRefPtr<ImmutableStylePropertySet> CSSParser::parseInlineStyleDeclaration(con st String& string, Element* element)
1287 { 1287 {
1288 Document* document = element->document(); 1288 Document& document = element->document();
1289 CSSParserContext context = document->elementSheet()->contents()->parserConte xt(); 1289 CSSParserContext context = document.elementSheet()->contents()->parserContex t();
1290 context.mode = strictToCSSParserMode(element->isHTMLElement() && !document-> inQuirksMode()); 1290 context.mode = strictToCSSParserMode(element->isHTMLElement() && !document.i nQuirksMode());
1291 return CSSParser(context, UseCounter::getFrom(document)).parseDeclaration(st ring, document->elementSheet()->contents()); 1291 return CSSParser(context, UseCounter::getFrom(&document)).parseDeclaration(s tring, document.elementSheet()->contents());
1292 } 1292 }
1293 1293
1294 PassRefPtr<ImmutableStylePropertySet> CSSParser::parseDeclaration(const String& string, StyleSheetContents* contextStyleSheet) 1294 PassRefPtr<ImmutableStylePropertySet> CSSParser::parseDeclaration(const String& string, StyleSheetContents* contextStyleSheet)
1295 { 1295 {
1296 setStyleSheet(contextStyleSheet); 1296 setStyleSheet(contextStyleSheet);
1297 1297
1298 setupParser("@-internal-decls ", string, ""); 1298 setupParser("@-internal-decls ", string, "");
1299 cssyyparse(this); 1299 cssyyparse(this);
1300 m_rule = 0; 1300 m_rule = 0;
1301 1301
(...skipping 10669 matching lines...) Expand 10 before | Expand all | Expand 10 after
11971 { 11971 {
11972 // The tokenizer checks for the construct of an+b. 11972 // The tokenizer checks for the construct of an+b.
11973 // However, since the {ident} rule precedes the {nth} rule, some of those 11973 // However, since the {ident} rule precedes the {nth} rule, some of those
11974 // tokens are identified as string literal. Furthermore we need to accept 11974 // tokens are identified as string literal. Furthermore we need to accept
11975 // "odd" and "even" which does not match to an+b. 11975 // "odd" and "even" which does not match to an+b.
11976 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11976 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11977 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11977 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11978 } 11978 }
11979 11979
11980 } 11980 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSGradientValue.cpp ('k') | Source/core/css/CSSStyleSheet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698