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

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

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
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 5854 matching lines...) Expand 10 before | Expand all | Expand 10 after
5865 5865
5866 if (name.is8Bit()) 5866 if (name.is8Bit())
5867 parseResult = fastParseColorInternal(rgb, name.characters8(), length, st rict); 5867 parseResult = fastParseColorInternal(rgb, name.characters8(), length, st rict);
5868 else 5868 else
5869 parseResult = fastParseColorInternal(rgb, name.characters16(), length, s trict); 5869 parseResult = fastParseColorInternal(rgb, name.characters16(), length, s trict);
5870 5870
5871 if (parseResult) 5871 if (parseResult)
5872 return true; 5872 return true;
5873 5873
5874 // Try named colors. 5874 // Try named colors.
5875 Color tc; 5875 StyleColor color;
5876 tc.setNamedColor(name); 5876 color.setNamedColor(name);
5877 if (tc.isValid()) { 5877 if (color.isValid()) {
5878 rgb = tc.rgb(); 5878 rgb = color.rgb();
5879 return true; 5879 return true;
5880 } 5880 }
5881 return false; 5881 return false;
5882 } 5882 }
5883 5883
5884 inline double CSSParser::parsedDouble(CSSParserValue *v, ReleaseParsedCalcValueC ondition releaseCalc) 5884 inline double CSSParser::parsedDouble(CSSParserValue *v, ReleaseParsedCalcValueC ondition releaseCalc)
5885 { 5885 {
5886 const double result = m_parsedCalculation ? m_parsedCalculation->doubleValue () : v->fValue; 5886 const double result = m_parsedCalculation ? m_parsedCalculation->doubleValue () : v->fValue;
5887 if (releaseCalc == ReleaseParsedCalcValue) 5887 if (releaseCalc == ReleaseParsedCalcValue)
5888 m_parsedCalculation.release(); 5888 m_parsedCalculation.release();
(...skipping 5851 matching lines...) Expand 10 before | Expand all | Expand 10 after
11740 { 11740 {
11741 // The tokenizer checks for the construct of an+b. 11741 // The tokenizer checks for the construct of an+b.
11742 // However, since the {ident} rule precedes the {nth} rule, some of those 11742 // However, since the {ident} rule precedes the {nth} rule, some of those
11743 // tokens are identified as string literal. Furthermore we need to accept 11743 // tokens are identified as string literal. Furthermore we need to accept
11744 // "odd" and "even" which does not match to an+b. 11744 // "odd" and "even" which does not match to an+b.
11745 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11745 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11746 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11746 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11747 } 11747 }
11748 11748
11749 } 11749 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698