Chromium Code Reviews| Index: Source/core/css/resolver/StyleBuilderConverter.cpp |
| diff --git a/Source/core/css/resolver/StyleBuilderConverter.cpp b/Source/core/css/resolver/StyleBuilderConverter.cpp |
| index 4ffe88db3b55529bdcd101c287699562f702ea21..f05caa85c793992c5f82f209694246d4fcd686e1 100644 |
| --- a/Source/core/css/resolver/StyleBuilderConverter.cpp |
| +++ b/Source/core/css/resolver/StyleBuilderConverter.cpp |
| @@ -27,6 +27,7 @@ |
| #include "config.h" |
| #include "core/css/resolver/StyleBuilderConverter.h" |
| +#include "core/css/BasicShapeFunctions.h" |
| #include "core/css/CSSFontFeatureValue.h" |
| #include "core/css/CSSFunctionValue.h" |
| #include "core/css/CSSGridLineNamesValue.h" |
| @@ -718,6 +719,36 @@ PassRefPtr<ShadowList> StyleBuilderConverter::convertShadow(StyleResolverState& |
| return ShadowList::adopt(shadows); |
| } |
| +PassRefPtr<ShapeValue> StyleBuilderConverter::convertShapeValue(StyleResolverState& state, CSSValue* value) |
| +{ |
| + if (value->isPrimitiveValue()) { |
| + ASSERT(toCSSPrimitiveValue(value)->getValueID() == CSSValueNone); |
| + return nullptr; |
| + } |
| + |
| + if (value->isImageValue() || value->isImageGeneratorValue() || value->isImageSetValue()) |
| + return ShapeValue::createImageValue(state.styleImage(CSSPropertyShapeOutside, value)); |
| + |
| + ASSERT(value->isValueList()); |
|
Timothy Loh
2014/10/20 12:29:57
I wouldn't bother with this since toCSSValueList c
|
| + |
| + RefPtr<BasicShape> shape; |
| + CSSBoxType cssBox = BoxMissing; |
| + CSSValueList* valueList = toCSSValueList(value); |
| + for (unsigned i = 0; i < valueList->length(); ++i) { |
| + CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->item(i)); |
| + if (primitiveValue->isShape()) |
| + shape = basicShapeForValue(state, primitiveValue->getShapeValue()); |
| + else |
| + cssBox = CSSBoxType(*primitiveValue); |
| + } |
| + |
| + if (shape) |
| + return ShapeValue::createShapeValue(shape.release(), cssBox); |
| + if (cssBox != BoxMissing) |
| + return ShapeValue::createBoxShapeValue(cssBox); |
| + return nullptr; |
|
Timothy Loh
2014/10/20 12:29:57
I think we never reach this?
andersr
2014/10/20 12:36:03
Can the parser deliver an empty CSSValueList?
|
| +} |
| + |
| float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value) |
| { |
| CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |