| Index: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp | 
| diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp | 
| index 552385189874a4ccf7d6b9cb6d5a2133d853753d..0f0747cec2edfc129e410c6267c5ef8a862b7ce2 100644 | 
| --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp | 
| +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp | 
| @@ -28,6 +28,7 @@ | 
|  | 
| #include "core/css/BasicShapeFunctions.h" | 
| #include "core/css/CSSBasicShapeValues.h" | 
| +#include "core/css/CSSColorValue.h" | 
| #include "core/css/CSSContentDistributionValue.h" | 
| #include "core/css/CSSCustomIdentValue.h" | 
| #include "core/css/CSSFontFamilyValue.h" | 
| @@ -156,6 +157,11 @@ FilterOperations StyleBuilderConverter::convertFilterOperations( | 
| return FilterOperationResolver::createFilterOperations(state, value); | 
| } | 
|  | 
| +FilterOperations StyleBuilderConverter::convertOffscreenFilterOperations( | 
| +    const CSSValue& value) { | 
| +  return FilterOperationResolver::createOffscreenFilterOperations(value); | 
| +} | 
| + | 
| static FontDescription::GenericFamilyType convertGenericFamily( | 
| CSSValueID valueID) { | 
| switch (valueID) { | 
| @@ -328,6 +334,36 @@ float StyleBuilderConverter::convertFontSizeAdjust(StyleResolverState& state, | 
| return primitiveValue.getFloatValue(); | 
| } | 
|  | 
| +double StyleBuilderConverter::convertValueToNumber( | 
| +    const CSSFunctionValue* filter, | 
| +    const CSSPrimitiveValue* value) { | 
| +  switch (filter->functionType()) { | 
| +    case CSSValueGrayscale: | 
| +    case CSSValueSepia: | 
| +    case CSSValueSaturate: | 
| +    case CSSValueInvert: | 
| +    case CSSValueBrightness: | 
| +    case CSSValueContrast: | 
| +    case CSSValueOpacity: { | 
| +      double amount = (filter->functionType() == CSSValueBrightness) ? 0 : 1; | 
| +      if (filter->length() == 1) { | 
| +        amount = value->getDoubleValue(); | 
| +        if (value->isPercentage()) | 
| +          amount /= 100; | 
| +      } | 
| +      return amount; | 
| +    } | 
| +    case CSSValueHueRotate: { | 
| +      double angle = 0; | 
| +      if (filter->length() == 1) | 
| +        angle = value->computeDegrees(); | 
| +      return angle; | 
| +    } | 
| +    default: | 
| +      return 0; | 
| +  } | 
| +} | 
| + | 
| FontWeight StyleBuilderConverter::convertFontWeight(StyleResolverState& state, | 
| const CSSValue& value) { | 
| const CSSIdentifierValue& identifierValue = toCSSIdentifierValue(value); | 
| @@ -1000,25 +1036,48 @@ LengthSize StyleBuilderConverter::convertRadius(StyleResolverState& state, | 
| return LengthSize(radiusWidth, radiusHeight); | 
| } | 
|  | 
| -ShadowData StyleBuilderConverter::convertShadow(StyleResolverState& state, | 
| -                                                const CSSValue& value) { | 
| +ShadowData StyleBuilderConverter::convertShadow( | 
| +    const CSSToLengthConversionData& conversionData, | 
| +    StyleResolverState* state, | 
| +    const CSSValue& value) { | 
| const CSSShadowValue& shadow = toCSSShadowValue(value); | 
| -  float x = shadow.x->computeLength<float>(state.cssToLengthConversionData()); | 
| -  float y = shadow.y->computeLength<float>(state.cssToLengthConversionData()); | 
| +  float x = shadow.x->computeLength<float>(conversionData); | 
| +  float y = shadow.y->computeLength<float>(conversionData); | 
| float blur = | 
| -      shadow.blur | 
| -          ? shadow.blur->computeLength<float>(state.cssToLengthConversionData()) | 
| -          : 0; | 
| -  float spread = shadow.spread | 
| -                     ? shadow.spread->computeLength<float>( | 
| -                           state.cssToLengthConversionData()) | 
| -                     : 0; | 
| +      shadow.blur ? shadow.blur->computeLength<float>(conversionData) : 0; | 
| +  float spread = | 
| +      shadow.spread ? shadow.spread->computeLength<float>(conversionData) : 0; | 
| ShadowStyle shadowStyle = | 
| shadow.style && shadow.style->getValueID() == CSSValueInset ? Inset | 
| : Normal; | 
| StyleColor color = StyleColor::currentColor(); | 
| -  if (shadow.color) | 
| -    color = convertStyleColor(state, *shadow.color); | 
| +  if (shadow.color) { | 
| +    if (state) { | 
| +      color = convertStyleColor(*state, *shadow.color); | 
| +    } else { | 
| +      // For OffScreen canvas, we default to black and only parse non | 
| +      // Document dependent CSS colors. | 
| +      color = StyleColor(Color::black); | 
| +      if (shadow.color->isColorValue()) { | 
| +        color = toCSSColorValue(*shadow.color).value(); | 
| +      } else { | 
| +        CSSValueID valueID = toCSSIdentifierValue(*shadow.color).getValueID(); | 
| +        switch (valueID) { | 
| +          case CSSValueInvalid: | 
| +            NOTREACHED(); | 
| +          case CSSValueInternalQuirkInherit: | 
| +          case CSSValueWebkitLink: | 
| +          case CSSValueWebkitActivelink: | 
| +          case CSSValueWebkitFocusRingColor: | 
| +          case CSSValueCurrentcolor: | 
| +            break; | 
| +          default: | 
| +            color = StyleColor::colorFromKeyword(valueID); | 
| +        } | 
| +      } | 
| +    } | 
| +  } | 
| + | 
| return ShadowData(FloatPoint(x, y), blur, spread, shadowStyle, color); | 
| } | 
|  | 
| @@ -1031,8 +1090,10 @@ PassRefPtr<ShadowList> StyleBuilderConverter::convertShadowList( | 
| } | 
|  | 
| ShadowDataVector shadows; | 
| -  for (const auto& item : toCSSValueList(value)) | 
| -    shadows.push_back(convertShadow(state, *item)); | 
| +  for (const auto& item : toCSSValueList(value)) { | 
| +    shadows.push_back( | 
| +        convertShadow(state.cssToLengthConversionData(), &state, *item)); | 
| +  } | 
|  | 
| return ShadowList::adopt(shadows); | 
| } | 
|  |