Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1010 return false; | 1010 return false; |
| 1011 | 1011 |
| 1012 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 1012 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 1013 if (!primitiveValue->isRGBColor()) | 1013 if (!primitiveValue->isRGBColor()) |
| 1014 return false; | 1014 return false; |
| 1015 | 1015 |
| 1016 color = primitiveValue->getRGBA32Value(); | 1016 color = primitiveValue->getRGBA32Value(); |
| 1017 return true; | 1017 return true; |
| 1018 } | 1018 } |
| 1019 | 1019 |
| 1020 StyleColor BisonCSSParser::colorFromRGBColorString(const String& colorString) | |
|
fs
2014/07/01 07:52:12
I suspect this method is better off being folded i
| |
| 1021 { | |
| 1022 // FIXME: Rework css parser so it is more SVG aware. | |
|
krit
2014/07/01 06:01:55
fill and stroke will have the same syntax as backg
| |
| 1023 RGBA32 color; | |
| 1024 if (BisonCSSParser::parseColor(color, colorString.stripWhiteSpace())) | |
| 1025 return StyleColor(color); | |
| 1026 // FIXME: This branch catches the string currentColor, but we should error i f we have an illegal color value. | |
| 1027 return StyleColor::currentColor(); | |
| 1028 } | |
| 1029 | |
| 1020 bool BisonCSSParser::parseColor(const String& string) | 1030 bool BisonCSSParser::parseColor(const String& string) |
| 1021 { | 1031 { |
| 1022 setupParser("@-internal-decls color:", string, ""); | 1032 setupParser("@-internal-decls color:", string, ""); |
| 1023 cssyyparse(this); | 1033 cssyyparse(this); |
| 1024 m_rule = nullptr; | 1034 m_rule = nullptr; |
| 1025 | 1035 |
| 1026 return !m_parsedProperties.isEmpty() && m_parsedProperties.first().id() == C SSPropertyColor; | 1036 return !m_parsedProperties.isEmpty() && m_parsedProperties.first().id() == C SSPropertyColor; |
| 1027 } | 1037 } |
| 1028 | 1038 |
| 1029 bool BisonCSSParser::parseSystemColor(RGBA32& color, const String& string) | 1039 bool BisonCSSParser::parseSystemColor(RGBA32& color, const String& string) |
| (...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2102 rule->setProperties(createStylePropertySet()); | 2112 rule->setProperties(createStylePropertySet()); |
| 2103 clearProperties(); | 2113 clearProperties(); |
| 2104 | 2114 |
| 2105 StyleRuleViewport* result = rule.get(); | 2115 StyleRuleViewport* result = rule.get(); |
| 2106 m_parsedRules.append(rule.release()); | 2116 m_parsedRules.append(rule.release()); |
| 2107 | 2117 |
| 2108 return result; | 2118 return result; |
| 2109 } | 2119 } |
| 2110 | 2120 |
| 2111 } | 2121 } |
| OLD | NEW |