| Index: Source/core/css/resolver/FilterOperationResolver.cpp
|
| diff --git a/Source/core/css/resolver/FilterOperationResolver.cpp b/Source/core/css/resolver/FilterOperationResolver.cpp
|
| index adccab71e3ba223cfd04a244b2daeb01221938e9..7625423cf29fe9233ef0c28307482309583b352e 100644
|
| --- a/Source/core/css/resolver/FilterOperationResolver.cpp
|
| +++ b/Source/core/css/resolver/FilterOperationResolver.cpp
|
| @@ -76,7 +76,7 @@ bool FilterOperationResolver::createFilterOperations(const CSSValue& inValue, co
|
| ASSERT(outOperations.isEmpty());
|
|
|
| if (inValue.isPrimitiveValue()) {
|
| - CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(inValue);
|
| + const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(inValue);
|
| if (primitiveValue.getValueID() == CSSValueNone)
|
| return true;
|
| }
|
| @@ -125,15 +125,15 @@ bool FilterOperationResolver::createFilterOperations(const CSSValue& inValue, co
|
| continue;
|
| }
|
|
|
| - CSSPrimitiveValue* firstValue = filterValue.length() && filterValue.item(0).isPrimitiveValue() ? &toCSSPrimitiveValue(filterValue.item(0)) : 0;
|
| + NullableCSSValue firstValue = filterValue.length() && filterValue.item(0).isPrimitiveValue() ? NullableCSSValue(filterValue.item(0)) : nullptr;
|
| switch (filterValue.functionType()) {
|
| case CSSValueGrayscale:
|
| case CSSValueSepia:
|
| case CSSValueSaturate: {
|
| double amount = 1;
|
| if (filterValue.length() == 1) {
|
| - amount = firstValue->getDoubleValue();
|
| - if (firstValue->isPercentage())
|
| + amount = toCSSPrimitiveValue(firstValue).getDoubleValue();
|
| + if (toCSSPrimitiveValue(firstValue).isPercentage())
|
| amount /= 100;
|
| }
|
|
|
| @@ -143,7 +143,7 @@ bool FilterOperationResolver::createFilterOperations(const CSSValue& inValue, co
|
| case CSSValueHueRotate: {
|
| double angle = 0;
|
| if (filterValue.length() == 1)
|
| - angle = firstValue->computeDegrees();
|
| + angle = toCSSPrimitiveValue(firstValue).computeDegrees();
|
|
|
| operations.operations().append(BasicColorMatrixFilterOperation::create(angle, operationType));
|
| break;
|
| @@ -154,8 +154,8 @@ bool FilterOperationResolver::createFilterOperations(const CSSValue& inValue, co
|
| case CSSValueOpacity: {
|
| double amount = (filterValue.functionType() == CSSValueBrightness) ? 0 : 1;
|
| if (filterValue.length() == 1) {
|
| - amount = firstValue->getDoubleValue();
|
| - if (firstValue->isPercentage())
|
| + amount = toCSSPrimitiveValue(firstValue).getDoubleValue();
|
| + if (toCSSPrimitiveValue(firstValue).isPercentage())
|
| amount /= 100;
|
| }
|
|
|
| @@ -165,7 +165,7 @@ bool FilterOperationResolver::createFilterOperations(const CSSValue& inValue, co
|
| case CSSValueBlur: {
|
| Length stdDeviation = Length(0, Fixed);
|
| if (filterValue.length() >= 1)
|
| - stdDeviation = firstValue->convertToLength(conversionData);
|
| + stdDeviation = toCSSPrimitiveValue(firstValue).convertToLength(conversionData);
|
| operations.operations().append(BlurFilterOperation::create(stdDeviation));
|
| break;
|
| }
|
| @@ -178,11 +178,11 @@ bool FilterOperationResolver::createFilterOperations(const CSSValue& inValue, co
|
| continue;
|
|
|
| CSSShadowValue& item = toCSSShadowValue(cssValue);
|
| - IntPoint location(item.x->computeLength<int>(conversionData), item.y->computeLength<int>(conversionData));
|
| - int blur = item.blur ? item.blur->computeLength<int>(conversionData) : 0;
|
| + IntPoint location(toCSSPrimitiveValue(item.x).computeLength<int>(conversionData), toCSSPrimitiveValue(item.y).computeLength<int>(conversionData));
|
| + int blur = item.blur ? toCSSPrimitiveValue(item.blur).computeLength<int>(conversionData) : 0;
|
| Color shadowColor = Color::black;
|
| if (item.color)
|
| - shadowColor = state.document().textLinkColors().colorFromPrimitiveValue(*item.color.get(), state.style()->color());
|
| + shadowColor = state.document().textLinkColors().colorFromPrimitiveValue(toCSSPrimitiveValue(item.color), state.style()->color());
|
|
|
| operations.operations().append(DropShadowFilterOperation::create(location, blur, shadowColor));
|
| break;
|
|
|