Index: Source/core/css/resolver/FilterOperationResolver.cpp |
diff --git a/Source/core/css/resolver/FilterOperationResolver.cpp b/Source/core/css/resolver/FilterOperationResolver.cpp |
index 348c7a09854c42c3501c04de589a8248fd2c2d48..055ae7befb5aa98a13c4e25f8cfee786e077784d 100644 |
--- a/Source/core/css/resolver/FilterOperationResolver.cpp |
+++ b/Source/core/css/resolver/FilterOperationResolver.cpp |
@@ -76,7 +76,7 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS |
ASSERT(outOperations.isEmpty()); |
if (inValue.isPrimitiveValue()) { |
- CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(inValue); |
+ CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(inValue); |
if (primitiveValue.getValueID() == CSSValueNone) |
return true; |
} |
@@ -125,15 +125,15 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS |
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(CSSValue inValue, const CSS |
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(CSSValue inValue, const CSS |
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(CSSValue inValue, const CSS |
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(CSSValue inValue, const CSS |
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; |