| Index: third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp
|
| diff --git a/third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp b/third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp
|
| index 2e830b0c6d4394ba5c2eea9f70e6b8cbeee12a52..7071a27c563be8ebc8d0934a88480b15dcf13335 100644
|
| --- a/third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/animation/PropertyInterpolationTypesMapping.cpp
|
| @@ -48,18 +48,20 @@
|
| #include "core/animation/SVGRectInterpolationType.h"
|
| #include "core/animation/SVGTransformListInterpolationType.h"
|
| #include "core/animation/SVGValueInterpolationType.h"
|
| +#include "wtf/PtrUtil.h"
|
| +#include <memory>
|
|
|
| namespace blink {
|
|
|
| const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyHandle& property)
|
| {
|
| - using ApplicableTypesMap = HashMap<PropertyHandle, OwnPtr<const InterpolationTypes>>;
|
| + using ApplicableTypesMap = HashMap<PropertyHandle, std::unique_ptr<const InterpolationTypes>>;
|
| DEFINE_STATIC_LOCAL(ApplicableTypesMap, applicableTypesMap, ());
|
| auto entry = applicableTypesMap.find(property);
|
| if (entry != applicableTypesMap.end())
|
| return *entry->value.get();
|
|
|
| - OwnPtr<InterpolationTypes> applicableTypes = adoptPtr(new InterpolationTypes());
|
| + std::unique_ptr<InterpolationTypes> applicableTypes = wrapUnique(new InterpolationTypes());
|
|
|
| if (property.isCSSProperty() || property.isPresentationAttribute()) {
|
| CSSPropertyID cssProperty = property.isCSSProperty() ? property.cssProperty() : property.presentationAttribute();
|
| @@ -115,7 +117,7 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH
|
| case CSSPropertyWordSpacing:
|
| case CSSPropertyX:
|
| case CSSPropertyY:
|
| - applicableTypes->append(adoptPtr(new CSSLengthInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSLengthInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyFlexGrow:
|
| case CSSPropertyFlexShrink:
|
| @@ -131,11 +133,11 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH
|
| case CSSPropertyColumnCount:
|
| case CSSPropertyWidows:
|
| case CSSPropertyZIndex:
|
| - applicableTypes->append(adoptPtr(new CSSNumberInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSNumberInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyLineHeight:
|
| - applicableTypes->append(adoptPtr(new CSSLengthInterpolationType(cssProperty)));
|
| - applicableTypes->append(adoptPtr(new CSSNumberInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSLengthInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSNumberInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBackgroundColor:
|
| case CSSPropertyBorderBottomColor:
|
| @@ -150,118 +152,118 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH
|
| case CSSPropertyTextDecorationColor:
|
| case CSSPropertyColumnRuleColor:
|
| case CSSPropertyWebkitTextStrokeColor:
|
| - applicableTypes->append(adoptPtr(new CSSColorInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSColorInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyFill:
|
| case CSSPropertyStroke:
|
| - applicableTypes->append(adoptPtr(new CSSPaintInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSPaintInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyD:
|
| - applicableTypes->append(adoptPtr(new CSSPathInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSPathInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBoxShadow:
|
| case CSSPropertyTextShadow:
|
| - applicableTypes->append(adoptPtr(new CSSShadowListInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSShadowListInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBorderImageSource:
|
| case CSSPropertyListStyleImage:
|
| case CSSPropertyWebkitMaskBoxImageSource:
|
| - applicableTypes->append(adoptPtr(new CSSImageInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSImageInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBackgroundImage:
|
| case CSSPropertyWebkitMaskImage:
|
| - applicableTypes->append(adoptPtr(new CSSImageListInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSImageListInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyStrokeDasharray:
|
| - applicableTypes->append(adoptPtr(new CSSLengthListInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSLengthListInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyFontWeight:
|
| - applicableTypes->append(adoptPtr(new CSSFontWeightInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSFontWeightInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyVisibility:
|
| - applicableTypes->append(adoptPtr(new CSSVisibilityInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSVisibilityInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyClip:
|
| - applicableTypes->append(adoptPtr(new CSSClipInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSClipInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyMotionRotation:
|
| - applicableTypes->append(adoptPtr(new CSSMotionRotationInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSMotionRotationInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBackgroundPositionX:
|
| case CSSPropertyBackgroundPositionY:
|
| case CSSPropertyWebkitMaskPositionX:
|
| case CSSPropertyWebkitMaskPositionY:
|
| - applicableTypes->append(adoptPtr(new CSSPositionAxisListInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSPositionAxisListInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyPerspectiveOrigin:
|
| case CSSPropertyObjectPosition:
|
| - applicableTypes->append(adoptPtr(new CSSPositionInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSPositionInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBorderBottomLeftRadius:
|
| case CSSPropertyBorderBottomRightRadius:
|
| case CSSPropertyBorderTopLeftRadius:
|
| case CSSPropertyBorderTopRightRadius:
|
| - applicableTypes->append(adoptPtr(new CSSLengthPairInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSLengthPairInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyTranslate:
|
| - applicableTypes->append(adoptPtr(new CSSTranslateInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSTranslateInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyTransformOrigin:
|
| - applicableTypes->append(adoptPtr(new CSSTransformOriginInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSTransformOriginInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBackgroundSize:
|
| case CSSPropertyWebkitMaskSize:
|
| - applicableTypes->append(adoptPtr(new CSSSizeListInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSSizeListInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBorderImageOutset:
|
| case CSSPropertyBorderImageWidth:
|
| case CSSPropertyWebkitMaskBoxImageOutset:
|
| case CSSPropertyWebkitMaskBoxImageWidth:
|
| - applicableTypes->append(adoptPtr(new CSSBorderImageLengthBoxInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSBorderImageLengthBoxInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyScale:
|
| - applicableTypes->append(adoptPtr(new CSSScaleInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSScaleInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyFontSize:
|
| - applicableTypes->append(adoptPtr(new CSSFontSizeInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSFontSizeInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyTextIndent:
|
| - applicableTypes->append(adoptPtr(new CSSTextIndentInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSTextIndentInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBorderImageSlice:
|
| case CSSPropertyWebkitMaskBoxImageSlice:
|
| - applicableTypes->append(adoptPtr(new CSSImageSliceInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSImageSliceInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyWebkitClipPath:
|
| case CSSPropertyShapeOutside:
|
| - applicableTypes->append(adoptPtr(new CSSBasicShapeInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSBasicShapeInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyRotate:
|
| - applicableTypes->append(adoptPtr(new CSSRotateInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSRotateInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyBackdropFilter:
|
| case CSSPropertyWebkitFilter:
|
| - applicableTypes->append(adoptPtr(new CSSFilterListInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSFilterListInterpolationType(cssProperty)));
|
| break;
|
| case CSSPropertyTransform:
|
| - applicableTypes->append(adoptPtr(new CSSTransformInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSTransformInterpolationType(cssProperty)));
|
| break;
|
| default:
|
| ASSERT(!CSSPropertyMetadata::isInterpolableProperty(cssProperty));
|
| }
|
|
|
| - applicableTypes->append(adoptPtr(new CSSValueInterpolationType(cssProperty)));
|
| + applicableTypes->append(wrapUnique(new CSSValueInterpolationType(cssProperty)));
|
|
|
| } else {
|
| const QualifiedName& attribute = property.svgAttribute();
|
| if (attribute == SVGNames::orientAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGAngleInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGAngleInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::numOctavesAttr
|
| || attribute == SVGNames::targetXAttr
|
| || attribute == SVGNames::targetYAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGIntegerInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGIntegerInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::orderAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGIntegerOptionalIntegerInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGIntegerOptionalIntegerInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::cxAttr
|
| || attribute == SVGNames::cyAttr
|
| || attribute == SVGNames::fxAttr
|
| @@ -281,15 +283,15 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH
|
| || attribute == SVGNames::x2Attr
|
| || attribute == SVGNames::y1Attr
|
| || attribute == SVGNames::y2Attr) {
|
| - applicableTypes->append(adoptPtr(new SVGLengthInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGLengthInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::dxAttr
|
| || attribute == SVGNames::dyAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attribute)));
|
| - applicableTypes->append(adoptPtr(new SVGLengthListInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGNumberInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGLengthListInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::xAttr
|
| || attribute == SVGNames::yAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGLengthInterpolationType(attribute)));
|
| - applicableTypes->append(adoptPtr(new SVGLengthListInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGLengthInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGLengthListInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::amplitudeAttr
|
| || attribute == SVGNames::azimuthAttr
|
| || attribute == SVGNames::biasAttr
|
| @@ -315,27 +317,27 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH
|
| || attribute == SVGNames::specularExponentAttr
|
| || attribute == SVGNames::surfaceScaleAttr
|
| || attribute == SVGNames::zAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGNumberInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGNumberInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::kernelMatrixAttr
|
| || attribute == SVGNames::rotateAttr
|
| || attribute == SVGNames::tableValuesAttr
|
| || attribute == SVGNames::valuesAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGNumberListInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGNumberListInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::baseFrequencyAttr
|
| || attribute == SVGNames::kernelUnitLengthAttr
|
| || attribute == SVGNames::radiusAttr
|
| || attribute == SVGNames::stdDeviationAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGNumberOptionalNumberInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGNumberOptionalNumberInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::dAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGPathInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGPathInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::pointsAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGPointListInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGPointListInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::viewBoxAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGRectInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGRectInterpolationType(attribute)));
|
| } else if (attribute == SVGNames::gradientTransformAttr
|
| || attribute == SVGNames::patternTransformAttr
|
| || attribute == SVGNames::transformAttr) {
|
| - applicableTypes->append(adoptPtr(new SVGTransformListInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGTransformListInterpolationType(attribute)));
|
| } else if (attribute == HTMLNames::classAttr
|
| || attribute == SVGNames::clipPathUnitsAttr
|
| || attribute == SVGNames::edgeModeAttr
|
| @@ -369,7 +371,7 @@ const InterpolationTypes& PropertyInterpolationTypesMapping::get(const PropertyH
|
| ASSERT_NOT_REACHED();
|
| }
|
|
|
| - applicableTypes->append(adoptPtr(new SVGValueInterpolationType(attribute)));
|
| + applicableTypes->append(wrapUnique(new SVGValueInterpolationType(attribute)));
|
| }
|
|
|
| auto addResult = applicableTypesMap.add(property, std::move(applicableTypes));
|
|
|