| 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 17 matching lines...) Expand all Loading... |
| 28 #include "sky/engine/core/css/parser/CSSPropertyParser.h" | 28 #include "sky/engine/core/css/parser/CSSPropertyParser.h" |
| 29 | 29 |
| 30 // FIXME: Way too many! | 30 // FIXME: Way too many! |
| 31 #include <limits.h> | 31 #include <limits.h> |
| 32 #include "gen/sky/core/CSSValueKeywords.h" | 32 #include "gen/sky/core/CSSValueKeywords.h" |
| 33 #include "gen/sky/core/StylePropertyShorthand.h" | 33 #include "gen/sky/core/StylePropertyShorthand.h" |
| 34 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 34 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 35 #include "sky/engine/core/css/CSSAspectRatioValue.h" | 35 #include "sky/engine/core/css/CSSAspectRatioValue.h" |
| 36 #include "sky/engine/core/css/CSSBasicShapes.h" | 36 #include "sky/engine/core/css/CSSBasicShapes.h" |
| 37 #include "sky/engine/core/css/CSSBorderImage.h" | 37 #include "sky/engine/core/css/CSSBorderImage.h" |
| 38 #include "sky/engine/core/css/CSSCanvasValue.h" | |
| 39 #include "sky/engine/core/css/CSSCrossfadeValue.h" | 38 #include "sky/engine/core/css/CSSCrossfadeValue.h" |
| 40 #include "sky/engine/core/css/CSSCursorImageValue.h" | 39 #include "sky/engine/core/css/CSSCursorImageValue.h" |
| 41 #include "sky/engine/core/css/CSSFontFaceSrcValue.h" | 40 #include "sky/engine/core/css/CSSFontFaceSrcValue.h" |
| 42 #include "sky/engine/core/css/CSSFontFeatureValue.h" | 41 #include "sky/engine/core/css/CSSFontFeatureValue.h" |
| 43 #include "sky/engine/core/css/CSSFunctionValue.h" | 42 #include "sky/engine/core/css/CSSFunctionValue.h" |
| 44 #include "sky/engine/core/css/CSSGradientValue.h" | 43 #include "sky/engine/core/css/CSSGradientValue.h" |
| 45 #include "sky/engine/core/css/CSSImageSetValue.h" | 44 #include "sky/engine/core/css/CSSImageSetValue.h" |
| 46 #include "sky/engine/core/css/CSSImageValue.h" | 45 #include "sky/engine/core/css/CSSImageValue.h" |
| 47 #include "sky/engine/core/css/CSSInheritedValue.h" | 46 #include "sky/engine/core/css/CSSInheritedValue.h" |
| 48 #include "sky/engine/core/css/CSSInitialValue.h" | 47 #include "sky/engine/core/css/CSSInitialValue.h" |
| (...skipping 5175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5224 | 5223 |
| 5225 if (equalIgnoringCase(val->function->name, "repeating-linear-gradient(")) | 5224 if (equalIgnoringCase(val->function->name, "repeating-linear-gradient(")) |
| 5226 return parseLinearGradient(valueList, value, Repeating); | 5225 return parseLinearGradient(valueList, value, Repeating); |
| 5227 | 5226 |
| 5228 if (equalIgnoringCase(val->function->name, "radial-gradient(")) | 5227 if (equalIgnoringCase(val->function->name, "radial-gradient(")) |
| 5229 return parseRadialGradient(valueList, value, NonRepeating); | 5228 return parseRadialGradient(valueList, value, NonRepeating); |
| 5230 | 5229 |
| 5231 if (equalIgnoringCase(val->function->name, "repeating-radial-gradient(")) | 5230 if (equalIgnoringCase(val->function->name, "repeating-radial-gradient(")) |
| 5232 return parseRadialGradient(valueList, value, Repeating); | 5231 return parseRadialGradient(valueList, value, Repeating); |
| 5233 | 5232 |
| 5234 if (equalIgnoringCase(val->function->name, "-webkit-canvas(")) | |
| 5235 return parseCanvas(valueList, value); | |
| 5236 | |
| 5237 if (equalIgnoringCase(val->function->name, "-webkit-cross-fade(")) | 5233 if (equalIgnoringCase(val->function->name, "-webkit-cross-fade(")) |
| 5238 return parseCrossfade(valueList, value); | 5234 return parseCrossfade(valueList, value); |
| 5239 | 5235 |
| 5240 return false; | 5236 return false; |
| 5241 } | 5237 } |
| 5242 | 5238 |
| 5243 bool CSSPropertyParser::parseCrossfade(CSSParserValueList* valueList, RefPtr<CSS
Value>& crossfade) | 5239 bool CSSPropertyParser::parseCrossfade(CSSParserValueList* valueList, RefPtr<CSS
Value>& crossfade) |
| 5244 { | 5240 { |
| 5245 // Walk the arguments. | 5241 // Walk the arguments. |
| 5246 CSSParserValueList* args = valueList->current()->function->args.get(); | 5242 CSSParserValueList* args = valueList->current()->function->args.get(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5279 return false; | 5275 return false; |
| 5280 | 5276 |
| 5281 RefPtr<CSSCrossfadeValue> result = CSSCrossfadeValue::create(fromImageValue,
toImageValue); | 5277 RefPtr<CSSCrossfadeValue> result = CSSCrossfadeValue::create(fromImageValue,
toImageValue); |
| 5282 result->setPercentage(percentage); | 5278 result->setPercentage(percentage); |
| 5283 | 5279 |
| 5284 crossfade = result; | 5280 crossfade = result; |
| 5285 | 5281 |
| 5286 return true; | 5282 return true; |
| 5287 } | 5283 } |
| 5288 | 5284 |
| 5289 bool CSSPropertyParser::parseCanvas(CSSParserValueList* valueList, RefPtr<CSSVal
ue>& canvas) | |
| 5290 { | |
| 5291 // Walk the arguments. | |
| 5292 CSSParserValueList* args = valueList->current()->function->args.get(); | |
| 5293 if (!args || args->size() != 1) | |
| 5294 return false; | |
| 5295 | |
| 5296 // The first argument is the canvas name. It is an identifier. | |
| 5297 CSSParserValue* value = args->current(); | |
| 5298 if (!value || value->unit != CSSPrimitiveValue::CSS_IDENT) | |
| 5299 return false; | |
| 5300 | |
| 5301 canvas = CSSCanvasValue::create(value->string); | |
| 5302 return true; | |
| 5303 } | |
| 5304 | |
| 5305 PassRefPtr<CSSValue> CSSPropertyParser::parseImageSet(CSSParserValueList* valueL
ist) | 5285 PassRefPtr<CSSValue> CSSPropertyParser::parseImageSet(CSSParserValueList* valueL
ist) |
| 5306 { | 5286 { |
| 5307 CSSParserValue* function = valueList->current(); | 5287 CSSParserValue* function = valueList->current(); |
| 5308 | 5288 |
| 5309 if (function->unit != CSSParserValue::Function) | 5289 if (function->unit != CSSParserValue::Function) |
| 5310 return nullptr; | 5290 return nullptr; |
| 5311 | 5291 |
| 5312 CSSParserValueList* functionArgs = valueList->current()->function->args.get(
); | 5292 CSSParserValueList* functionArgs = valueList->current()->function->args.get(
); |
| 5313 if (!functionArgs || !functionArgs->size() || !functionArgs->current()) | 5293 if (!functionArgs || !functionArgs->size() || !functionArgs->current()) |
| 5314 return nullptr; | 5294 return nullptr; |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6129 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 6109 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
| 6130 } | 6110 } |
| 6131 | 6111 |
| 6132 bool CSSPropertyParser::isSystemColor(int id) | 6112 bool CSSPropertyParser::isSystemColor(int id) |
| 6133 { | 6113 { |
| 6134 // FIXME(sky): remove | 6114 // FIXME(sky): remove |
| 6135 return false; | 6115 return false; |
| 6136 } | 6116 } |
| 6137 | 6117 |
| 6138 } // namespace blink | 6118 } // namespace blink |
| OLD | NEW |