Diff
Modified: trunk/Source/WebCore/ChangeLog (243184 => 243185)
--- trunk/Source/WebCore/ChangeLog 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/ChangeLog 2019-03-20 01:49:29 UTC (rev 243185)
@@ -1,5 +1,147 @@
2019-03-19 Said Abou-Hallawa <[email protected]>
+ Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio
+ https://bugs.webkit.org/show_bug.cgi?id=195960
+
+ Reviewed by Simon Fraser.
+
+ -- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty<
+ SVGPreserveAspectRatio>.
+
+ -- Make SVGPreserveAspectRatio be derived form SVGValueProperty<
+ SVGPreserveAspectRatioValue>.
+
+ -- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated
+ property.
+
+ -- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated
+ property of the target element and all its instances.
+
+ -- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of
+ animated property in a period of time.
+
+ SVGFilterPrimitiveStandardAttributes::build() should be const function.
+ This is required for this patch because SVGFEImageElement::build() calls
+ SVGFEImageElement::preserveAspectRatio() which is const.
+
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * svg/SVGAnimatedPreserveAspectRatio.cpp: Removed.
+ * svg/SVGAnimatedPreserveAspectRatio.h: Removed.
+ * svg/SVGAnimatorFactory.h:
+ (WebCore::SVGAnimatorFactory::create):
+ * svg/SVGFEBlendElement.cpp:
+ (WebCore::SVGFEBlendElement::build const):
+ (WebCore::SVGFEBlendElement::build): Deleted.
+ * svg/SVGFEBlendElement.h:
+ * svg/SVGFEColorMatrixElement.cpp:
+ (WebCore::SVGFEColorMatrixElement::build const):
+ (WebCore::SVGFEColorMatrixElement::build): Deleted.
+ * svg/SVGFEColorMatrixElement.h:
+ * svg/SVGFEComponentTransferElement.cpp:
+ (WebCore::SVGFEComponentTransferElement::build const):
+ (WebCore::SVGFEComponentTransferElement::build): Deleted.
+ * svg/SVGFEComponentTransferElement.h:
+ * svg/SVGFECompositeElement.cpp:
+ (WebCore::SVGFECompositeElement::build const):
+ (WebCore::SVGFECompositeElement::build): Deleted.
+ * svg/SVGFECompositeElement.h:
+ * svg/SVGFEConvolveMatrixElement.cpp:
+ (WebCore::SVGFEConvolveMatrixElement::build const):
+ (WebCore::SVGFEConvolveMatrixElement::build): Deleted.
+ * svg/SVGFEConvolveMatrixElement.h:
+ * svg/SVGFEDiffuseLightingElement.cpp:
+ (WebCore::SVGFEDiffuseLightingElement::build const):
+ (WebCore::SVGFEDiffuseLightingElement::build): Deleted.
+ * svg/SVGFEDiffuseLightingElement.h:
+ * svg/SVGFEDisplacementMapElement.cpp:
+ (WebCore::SVGFEDisplacementMapElement::build const):
+ (WebCore::SVGFEDisplacementMapElement::build): Deleted.
+ * svg/SVGFEDisplacementMapElement.h:
+ * svg/SVGFEDropShadowElement.cpp:
+ (WebCore::SVGFEDropShadowElement::build const):
+ (WebCore::SVGFEDropShadowElement::build): Deleted.
+ * svg/SVGFEDropShadowElement.h:
+ * svg/SVGFEFloodElement.cpp:
+ (WebCore::SVGFEFloodElement::build const):
+ (WebCore::SVGFEFloodElement::build): Deleted.
+ * svg/SVGFEFloodElement.h:
+ * svg/SVGFEGaussianBlurElement.cpp:
+ (WebCore::SVGFEGaussianBlurElement::build const):
+ (WebCore::SVGFEGaussianBlurElement::build): Deleted.
+ * svg/SVGFEGaussianBlurElement.h:
+ * svg/SVGFEImageElement.cpp:
+ (WebCore::SVGFEImageElement::SVGFEImageElement):
+ (WebCore::SVGFEImageElement::parseAttribute):
+ (WebCore::SVGFEImageElement::build const):
+ (WebCore::SVGFEImageElement::registerAttributes): Deleted.
+ (WebCore::SVGFEImageElement::build): Deleted.
+ * svg/SVGFEImageElement.h:
+ * svg/SVGFEMergeElement.cpp:
+ (WebCore::SVGFEMergeElement::build const):
+ (WebCore::SVGFEMergeElement::build): Deleted.
+ * svg/SVGFEMergeElement.h:
+ * svg/SVGFEMorphologyElement.cpp:
+ (WebCore::SVGFEMorphologyElement::build const):
+ (WebCore::SVGFEMorphologyElement::build): Deleted.
+ * svg/SVGFEMorphologyElement.h:
+ * svg/SVGFEOffsetElement.cpp:
+ (WebCore::SVGFEOffsetElement::build const):
+ (WebCore::SVGFEOffsetElement::build): Deleted.
+ * svg/SVGFEOffsetElement.h:
+ * svg/SVGFESpecularLightingElement.cpp:
+ (WebCore::SVGFESpecularLightingElement::build const):
+ (WebCore::SVGFESpecularLightingElement::build): Deleted.
+ * svg/SVGFESpecularLightingElement.h:
+ * svg/SVGFETileElement.cpp:
+ (WebCore::SVGFETileElement::build const):
+ (WebCore::SVGFETileElement::build): Deleted.
+ * svg/SVGFETileElement.h:
+ * svg/SVGFETurbulenceElement.cpp:
+ (WebCore::SVGFETurbulenceElement::build const):
+ (WebCore::SVGFETurbulenceElement::build): Deleted.
+ * svg/SVGFETurbulenceElement.h:
+ * svg/SVGFilterPrimitiveStandardAttributes.h:
+ * svg/SVGFitToViewBox.cpp:
+ (WebCore::SVGFitToViewBox::SVGFitToViewBox):
+ (WebCore::SVGFitToViewBox::parseViewBox):
+ (WebCore::SVGFitToViewBox::registerAttributes): Deleted.
+ * svg/SVGFitToViewBox.h:
+ (WebCore::SVGFitToViewBox::preserveAspectRatio const):
+ (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
+ (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
+ (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
+ (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
+ * svg/SVGImageElement.cpp:
+ (WebCore::SVGImageElement::SVGImageElement):
+ (WebCore::SVGImageElement::registerAttributes):
+ (WebCore::SVGImageElement::parseAttribute):
+ * svg/SVGImageElement.h:
+ * svg/SVGMarkerElement.h:
+ * svg/SVGPatternElement.h:
+ * svg/SVGPreserveAspectRatio.h:
+ (WebCore::SVGPreserveAspectRatio::create):
+ (WebCore::SVGPreserveAspectRatio::align const):
+ (WebCore::SVGPreserveAspectRatio::setAlign):
+ (WebCore::SVGPreserveAspectRatio::meetOrSlice const):
+ (WebCore::SVGPreserveAspectRatio::setMeetOrSlice):
+ (WebCore::SVGPreserveAspectRatio::align): Deleted.
+ (WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted.
+ (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted.
+ * svg/SVGSVGElement.h:
+ * svg/SVGStringList.h:
+ * svg/SVGSymbolElement.h:
+ * svg/SVGViewSpec.h:
+ * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
+ * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
+ * svg/properties/SVGAnimatedPropertyImpl.h:
+ * svg/properties/SVGAnimationDiscreteFunctionImpl.h:
+ * svg/properties/SVGAttributeRegistry.h:
+ * svg/properties/SVGPropertyOwnerRegistry.h:
+ (WebCore::SVGPropertyOwnerRegistry::registerProperty):
+
+2019-03-19 Said Abou-Hallawa <[email protected]>
+
Remove the SVG property tear off objects of SVGAnimatedRect
https://bugs.webkit.org/show_bug.cgi?id=195949
Modified: trunk/Source/WebCore/Sources.txt (243184 => 243185)
--- trunk/Source/WebCore/Sources.txt 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/Sources.txt 2019-03-20 01:49:29 UTC (rev 243185)
@@ -2279,7 +2279,6 @@
svg/SVGAnimatedNumberOptionalNumber.cpp
svg/SVGAnimatedPath.cpp
svg/SVGAnimatedPointList.cpp
-svg/SVGAnimatedPreserveAspectRatio.cpp
svg/SVGAnimatedString.cpp
svg/SVGAnimatedTransformList.cpp
svg/SVGAnimatedTypeAnimator.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (243184 => 243185)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-03-20 01:49:29 UTC (rev 243185)
@@ -293,7 +293,6 @@
08F2F00A1213E61700DCEC48 /* RenderImageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F2F0081213E61700DCEC48 /* RenderImageResource.h */; settings = {ATTRIBUTES = (Private, ); }; };
08F859D51463F9CD0067D933 /* SVGImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F859D31463F9CD0067D933 /* SVGImageCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
08F859D51463F9CD0067D934 /* SVGImageForContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F859D31463F9CD0067D934 /* SVGImageForContainer.h */; };
- 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */; };
0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */; settings = {ATTRIBUTES = (); }; };
0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056170F2578BE0095FF6A /* ThreadableLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5678,7 +5677,6 @@
08F859D21463F9CD0067D934 /* SVGImageForContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImageForContainer.cpp; sourceTree = "<group>"; };
08F859D31463F9CD0067D933 /* SVGImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageCache.h; sourceTree = "<group>"; };
08F859D31463F9CD0067D934 /* SVGImageForContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageForContainer.h; sourceTree = "<group>"; };
- 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPreserveAspectRatio.h; sourceTree = "<group>"; };
0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginViewBase.h; sourceTree = "<group>"; };
0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderMap.cpp; sourceTree = "<group>"; };
0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentThreadableLoader.cpp; sourceTree = "<group>"; };
@@ -7578,7 +7576,6 @@
431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberOptionalNumber.h; sourceTree = "<group>"; };
431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberOptionalNumber.cpp; sourceTree = "<group>"; };
431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; };
- 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPreserveAspectRatio.cpp; sourceTree = "<group>"; };
432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorCheckerTestFunctions.h; sourceTree = "<group>"; };
4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberList.cpp; sourceTree = "<group>"; };
4358E87A1360A2EE00E4748C /* JSSVGFEDropShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGFEDropShadowElement.cpp; sourceTree = "<group>"; };
@@ -24147,8 +24144,6 @@
0863951413B5FE5700BB344D /* SVGAnimatedPath.h */,
43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */,
43B9336713B261B1004584BF /* SVGAnimatedPointList.h */,
- 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */,
- 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */,
B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */,
B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */,
43A6266613B3D11000AC94B8 /* SVGAnimatedString.cpp */,
@@ -31928,7 +31923,6 @@
0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */,
089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */,
43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */,
- 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */,
088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */,
088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */,
55FA7FFF21110E6E005AEFE7 /* SVGAnimatedPropertyType.h in Headers */,
Deleted: trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
-
-#include "SVGAnimateElementBase.h"
-
-namespace WebCore {
-
-SVGAnimatedPreserveAspectRatioAnimator::SVGAnimatedPreserveAspectRatioAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement)
- : SVGAnimatedTypeAnimator(AnimatedPreserveAspectRatio, animationElement, contextElement)
-{
-}
-
-std::unique_ptr<SVGAnimatedType> SVGAnimatedPreserveAspectRatioAnimator::constructFromString(const String& string)
-{
- return SVGAnimatedType::create(SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString(string));
-}
-
-std::unique_ptr<SVGAnimatedType> SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
-{
- return constructFromBaseValue<SVGAnimatedPreserveAspectRatio>(animatedTypes);
-}
-
-void SVGAnimatedPreserveAspectRatioAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes)
-{
- stopAnimValAnimationForType<SVGAnimatedPreserveAspectRatio>(animatedTypes);
-}
-
-void SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type)
-{
- resetFromBaseValue<SVGAnimatedPreserveAspectRatio>(animatedTypes, type);
-}
-
-void SVGAnimatedPreserveAspectRatioAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes)
-{
- animValWillChangeForType<SVGAnimatedPreserveAspectRatio>(animatedTypes);
-}
-
-void SVGAnimatedPreserveAspectRatioAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes)
-{
- animValDidChangeForType<SVGAnimatedPreserveAspectRatio>(animatedTypes);
-}
-
-void SVGAnimatedPreserveAspectRatioAnimator::addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*)
-{
- ASSERT_NOT_REACHED();
-}
-
-void SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue(float percentage, unsigned, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType*, SVGAnimatedType* animated)
-{
- ASSERT(m_animationElement);
- ASSERT(m_contextElement);
-
- const auto& fromPreserveAspectRatio = (m_animationElement->animationMode() == AnimationMode::To ? animated : from)->as<SVGPreserveAspectRatioValue>();
- const auto& toPreserveAspectRatio = to->as<SVGPreserveAspectRatioValue>();
- auto& animatedPreserveAspectRatio = animated->as<SVGPreserveAspectRatioValue>();
-
- m_animationElement->animateDiscreteType<SVGPreserveAspectRatioValue>(percentage, fromPreserveAspectRatio, toPreserveAspectRatio, animatedPreserveAspectRatio);
-}
-
-float SVGAnimatedPreserveAspectRatioAnimator::calculateDistance(const String&, const String&)
-{
- // No paced animations for SVGPreserveAspectRatio.
- return -1;
-}
-
-}
Deleted: trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include "SVGAnimatedPropertyTearOff.h"
-#include "SVGAnimatedTypeAnimator.h"
-#include "SVGAttributeAccessor.h"
-#include "SVGPreserveAspectRatio.h"
-
-namespace WebCore {
-
-class SVGAnimationElement;
-
-using SVGAnimatedPreserveAspectRatio = SVGAnimatedPropertyTearOff<SVGPreserveAspectRatio>;
-using SVGAnimatedPreserveAspectRatioAttribute = SVGAnimatedAttribute<SVGAnimatedPreserveAspectRatio>;
-
-template<typename OwnerType>
-using SVGAnimatedPreserveAspectRatioAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedPreserveAspectRatioAttribute, AnimatedPreserveAspectRatio>;
-
-class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedTypeAnimator {
-public:
- SVGAnimatedPreserveAspectRatioAnimator(SVGAnimationElement*, SVGElement*);
-
- std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override;
- std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override;
- void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override;
- void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override;
- void animValWillChange(const SVGElementAnimatedPropertyList&) override;
- void animValDidChange(const SVGElementAnimatedPropertyList&) override;
-
- void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override;
- void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override;
- float calculateDistance(const String& fromString, const String& toString) override;
-};
-
-} // namespace WebCore
Modified: trunk/Source/WebCore/svg/SVGAnimatorFactory.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGAnimatorFactory.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGAnimatorFactory.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -29,7 +29,6 @@
#include "SVGAnimatedNumberOptionalNumber.h"
#include "SVGAnimatedPath.h"
#include "SVGAnimatedPointList.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGAnimatedString.h"
#include "SVGAnimatedTransformList.h"
@@ -72,7 +71,7 @@
case AnimatedPoints:
return std::make_unique<SVGAnimatedPointListAnimator>(animationElement, contextElement);
case AnimatedPreserveAspectRatio:
- return std::make_unique<SVGAnimatedPreserveAspectRatioAnimator>(animationElement, contextElement);
+ return nullptr;
case AnimatedRect:
return nullptr;
case AnimatedString:
Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEBlendElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -104,7 +104,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
auto input2 = filterBuilder->getEffectById(in2());
Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEBlendElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -73,7 +73,7 @@
void parseAttribute(const QualifiedName&, const AtomicString&) override;
void svgAttributeChanged(const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
AttributeOwnerProxy m_attributeOwnerProxy { *this };
Modified: trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEColorMatrixElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -107,7 +107,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFEColorMatrixElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEColorMatrixElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEColorMatrixElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -98,7 +98,7 @@
void svgAttributeChanged(const QualifiedName&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
AttributeOwnerProxy m_attributeOwnerProxy { *this };
PropertyRegistry m_propertyRegistry { *this };
Modified: trunk/Source/WebCore/svg/SVGFEComponentTransferElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEComponentTransferElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEComponentTransferElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -66,7 +66,7 @@
SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value);
}
-RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFEComponentTransferElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEComponentTransferElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEComponentTransferElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -48,7 +48,7 @@
// FIXME: svgAttributeChanged missing.
void parseAttribute(const QualifiedName&, const AtomicString&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
AttributeOwnerProxy m_attributeOwnerProxy { *this };
PropertyRegistry m_propertyRegistry { *this };
Modified: trunk/Source/WebCore/svg/SVGFECompositeElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFECompositeElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFECompositeElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -135,7 +135,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
auto input2 = filterBuilder->getEffectById(in2());
Modified: trunk/Source/WebCore/svg/SVGFECompositeElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFECompositeElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFECompositeElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -85,8 +85,8 @@
public:
static Ref<SVGFECompositeElement> create(const QualifiedName&, Document&);
- String in1() { return m_in1.currentValue(attributeOwnerProxy()); }
- String in2() { return m_in2.currentValue(attributeOwnerProxy()); }
+ String in1() const { return m_in1.currentValue(attributeOwnerProxy()); }
+ String in2() const { return m_in2.currentValue(attributeOwnerProxy()); }
CompositeOperationType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); }
float k1() const { return m_k1.currentValue(attributeOwnerProxy()); }
float k2() const { return m_k2.currentValue(attributeOwnerProxy()); }
@@ -121,7 +121,7 @@
void svgAttributeChanged(const QualifiedName&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
AttributeOwnerProxy m_attributeOwnerProxy { *this };
PropertyRegistry m_propertyRegistry { *this };
Modified: trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -216,7 +216,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -113,7 +113,7 @@
void svgAttributeChanged(const QualifiedName&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
static const AtomicString& kernelUnitLengthXIdentifier();
static const AtomicString& kernelUnitLengthYIdentifier();
Modified: trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -170,7 +170,7 @@
primitiveAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -68,7 +68,7 @@
void svgAttributeChanged(const QualifiedName&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
static const AtomicString& kernelUnitLengthXIdentifier();
static const AtomicString& kernelUnitLengthYIdentifier();
Modified: trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -119,7 +119,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
auto input2 = filterBuilder->getEffectById(in2());
Modified: trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -103,7 +103,7 @@
void svgAttributeChanged(const QualifiedName&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
AttributeOwnerProxy m_attributeOwnerProxy { *this };
PropertyRegistry m_propertyRegistry { *this };
Modified: trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -116,7 +116,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
RenderObject* renderer = this->renderer();
if (!renderer)
Modified: trunk/Source/WebCore/svg/SVGFEDropShadowElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEDropShadowElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEDropShadowElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -64,7 +64,7 @@
void parseAttribute(const QualifiedName&, const AtomicString&) override;
void svgAttributeChanged(const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
static const AtomicString& stdDeviationXIdentifier();
static const AtomicString& stdDeviationYIdentifier();
Modified: trunk/Source/WebCore/svg/SVGFEFloodElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEFloodElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEFloodElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -58,7 +58,7 @@
return false;
}
-RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter)
+RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter) const
{
RenderObject* renderer = this->renderer();
if (!renderer)
Modified: trunk/Source/WebCore/svg/SVGFEFloodElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEFloodElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEFloodElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -33,7 +33,7 @@
SVGFEFloodElement(const QualifiedName&, Document&);
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -114,7 +114,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEGaussianBlurElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -65,7 +65,7 @@
void parseAttribute(const QualifiedName&, const AtomicString&) override;
void svgAttributeChanged(const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
static const AtomicString& stdDeviationXIdentifier();
static const AtomicString& stdDeviationYIdentifier();
Modified: trunk/Source/WebCore/svg/SVGFEImageElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEImageElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -44,7 +44,11 @@
, SVGURIReference(this)
{
ASSERT(hasTagName(SVGNames::feImageTag));
- registerAttributes();
+
+ static std::once_flag onceFlag;
+ std::call_once(onceFlag, [] {
+ PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>();
+ });
}
Ref<SVGFEImageElement> SVGFEImageElement::create(const QualifiedName& tagName, Document& document)
@@ -111,20 +115,12 @@
invalidate();
}
-void SVGFEImageElement::registerAttributes()
-{
- auto& registry = attributeRegistry();
- if (!registry.isEmpty())
- return;
- registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>();
-}
-
void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == SVGNames::preserveAspectRatioAttr) {
SVGPreserveAspectRatioValue preserveAspectRatio;
preserveAspectRatio.parse(value);
- m_preserveAspectRatio.setValue(preserveAspectRatio);
+ m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio);
return;
}
@@ -185,7 +181,7 @@
RenderSVGResource::markForLayoutAndParentResourceInvalidation(*parentRenderer);
}
-RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter)
+RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter) const
{
if (m_cachedImage)
return FEImage::createWithImage(filter, m_cachedImage->imageForRenderer(renderer()), preserveAspectRatio());
Modified: trunk/Source/WebCore/svg/SVGFEImageElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEImageElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -23,7 +23,6 @@
#include "CachedImageClient.h"
#include "CachedResourceHandle.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFEImage.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
@@ -40,15 +39,13 @@
bool hasSingleSecurityOrigin() const;
- const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(attributeOwnerProxy()); }
- RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); }
+ const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); }
+ SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; }
private:
SVGFEImageElement(const QualifiedName&, Document&);
using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>;
- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); }
- static void registerAttributes();
const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; }
using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>;
@@ -67,7 +64,7 @@
void didFinishInsertingNode() override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
void clearResourceReferences();
void requestImageResource();
@@ -78,7 +75,7 @@
AttributeOwnerProxy m_attributeOwnerProxy { *this };
PropertyRegistry m_propertyRegistry { *this };
- SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio;
+ Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) };
CachedResourceHandle<CachedImage> m_cachedImage;
};
Modified: trunk/Source/WebCore/svg/SVGFEMergeElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEMergeElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEMergeElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -44,7 +44,7 @@
return adoptRef(*new SVGFEMergeElement(tagName, document));
}
-RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto effect = FEMerge::create(filter);
FilterEffectVector& mergeInputs = effect->inputEffects();
Modified: trunk/Source/WebCore/svg/SVGFEMergeElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEMergeElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEMergeElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -32,7 +32,7 @@
private:
SVGFEMergeElement(const QualifiedName&, Document&);
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEMorphologyElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -133,7 +133,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
float xRadius = radiusX();
Modified: trunk/Source/WebCore/svg/SVGFEMorphologyElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEMorphologyElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEMorphologyElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -93,7 +93,7 @@
void svgAttributeChanged(const QualifiedName&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
static const AtomicString& radiusXIdentifier();
static const AtomicString& radiusYIdentifier();
Modified: trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEOffsetElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -85,7 +85,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFEOffsetElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFEOffsetElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFEOffsetElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -58,7 +58,7 @@
void parseAttribute(const QualifiedName&, const AtomicString&) override;
void svgAttributeChanged(const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
AttributeOwnerProxy m_attributeOwnerProxy { *this };
PropertyRegistry m_propertyRegistry { *this };
Modified: trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -179,7 +179,7 @@
primitiveAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFESpecularLightingElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFESpecularLightingElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFESpecularLightingElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -69,7 +69,7 @@
void svgAttributeChanged(const QualifiedName&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
static const AtomicString& kernelUnitLengthXIdentifier();
static const AtomicString& kernelUnitLengthYIdentifier();
Modified: trunk/Source/WebCore/svg/SVGFETileElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFETileElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFETileElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -74,7 +74,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter)
+RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const
{
auto input1 = filterBuilder->getEffectById(in1());
Modified: trunk/Source/WebCore/svg/SVGFETileElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFETileElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFETileElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -52,7 +52,7 @@
void parseAttribute(const QualifiedName&, const AtomicString&) override;
void svgAttributeChanged(const QualifiedName&) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
AttributeOwnerProxy m_attributeOwnerProxy { *this };
PropertyRegistry m_propertyRegistry { *this };
Modified: trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFETurbulenceElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -139,7 +139,7 @@
SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
}
-RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter)
+RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter) const
{
if (baseFrequencyX() < 0 || baseFrequencyY() < 0)
return nullptr;
Modified: trunk/Source/WebCore/svg/SVGFETurbulenceElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFETurbulenceElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFETurbulenceElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -131,7 +131,7 @@
void svgAttributeChanged(const QualifiedName&) override;
bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override;
- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override;
+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override;
static const AtomicString& baseFrequencyXIdentifier();
static const AtomicString& baseFrequencyYIdentifier();
Modified: trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -40,7 +40,7 @@
public:
void setStandardAttributes(FilterEffect*) const;
- virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) = 0;
+ virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const = 0;
// Returns true, if the new value is different from the old one.
virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);
Modified: trunk/Source/WebCore/svg/SVGFitToViewBox.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFitToViewBox.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFitToViewBox.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -35,25 +35,16 @@
namespace WebCore {
SVGFitToViewBox::SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess access)
- : m_attributeOwnerProxy(*this, *contextElement, access == SVGPropertyAccess::ReadWrite ? PropertyIsReadWrite : PropertyIsReadOnly)
- , m_viewBox(SVGAnimatedRect::create(contextElement, access))
+ : m_viewBox(SVGAnimatedRect::create(contextElement, access))
+ , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(contextElement, access))
{
- registerAttributes();
-
static std::once_flag onceFlag;
std::call_once(onceFlag, [] {
PropertyRegistry::registerProperty<SVGNames::viewBoxAttr, &SVGFitToViewBox::m_viewBox>();
+ PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFitToViewBox::m_preserveAspectRatio>();
});
}
-void SVGFitToViewBox::registerAttributes()
-{
- auto& registry = attributeRegistry();
- if (!registry.isEmpty())
- return;
- registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFitToViewBox::m_preserveAspectRatio>();
-}
-
void SVGFitToViewBox::setViewBox(const FloatRect& viewBox)
{
m_viewBox->setBaseValInternal(viewBox);
@@ -113,7 +104,7 @@
bool valid = parseNumber(c, end, x) && parseNumber(c, end, y) && parseNumber(c, end, width) && parseNumber(c, end, height, false);
if (validate) {
- Document& document = m_attributeOwnerProxy.element().document();
+ Document& document = m_viewBox->contextElement()->document();
if (!valid) {
document.accessSVGExtensions().reportWarning("Problem parsing viewBox=\"" + str + "\"");
Modified: trunk/Source/WebCore/svg/SVGFitToViewBox.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGFitToViewBox.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGFitToViewBox.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -43,19 +43,19 @@
using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFitToViewBox>;
const FloatRect& viewBox() const { return m_viewBox->currentValue(); }
- const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(m_attributeOwnerProxy); }
+ const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); }
SVGAnimatedRect& viewBoxAnimated() { return m_viewBox; }
- RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(m_attributeOwnerProxy); }
+ SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; }
void setViewBox(const FloatRect&);
void resetViewBox();
- void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio.setValue(preserveAspectRatio); }
- void resetPreserveAspectRatio() { m_preserveAspectRatio.resetValue(); }
+ void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); }
+ void resetPreserveAspectRatio() { m_preserveAspectRatio->setBaseValInternal({ }); }
String viewBoxString() const { return SVGPropertyTraits<FloatRect>::toString(viewBox()); }
- String preserveAspectRatioString() const { return m_preserveAspectRatio.toString(); }
+ String preserveAspectRatioString() const { return preserveAspectRatio().valueAsString(); }
bool hasValidViewBox() const { return m_isViewBoxValid; }
bool hasEmptyViewBox() const { return m_isViewBoxValid && viewBox().isEmpty(); }
@@ -74,11 +74,8 @@
bool parseViewBox(const UChar*& start, const UChar* end, FloatRect& viewBox, bool validate = true);
private:
- static void registerAttributes();
-
- AttributeOwnerProxy m_attributeOwnerProxy;
Ref<SVGAnimatedRect> m_viewBox;
- SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio;
+ Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio;
bool m_isViewBoxValid { false };
};
Modified: trunk/Source/WebCore/svg/SVGImageElement.cpp (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGImageElement.cpp 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGImageElement.cpp 2019-03-20 01:49:29 UTC (rev 243185)
@@ -44,6 +44,11 @@
, m_imageLoader(*this)
{
registerAttributes();
+
+ static std::once_flag onceFlag;
+ std::call_once(onceFlag, [] {
+ PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGImageElement::m_preserveAspectRatio>();
+ });
}
Ref<SVGImageElement> SVGImageElement::create(const QualifiedName& tagName, Document& document)
@@ -69,7 +74,6 @@
registry.registerAttribute<SVGNames::yAttr, &SVGImageElement::m_y>();
registry.registerAttribute<SVGNames::widthAttr, &SVGImageElement::m_width>();
registry.registerAttribute<SVGNames::heightAttr, &SVGImageElement::m_height>();
- registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGImageElement::m_preserveAspectRatio>();
}
void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -77,7 +81,7 @@
if (name == SVGNames::preserveAspectRatioAttr) {
SVGPreserveAspectRatioValue preserveAspectRatio;
preserveAspectRatio.parse(value);
- m_preserveAspectRatio.setValue(preserveAspectRatio);
+ m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio);
return;
}
Modified: trunk/Source/WebCore/svg/SVGImageElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGImageElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGImageElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -22,7 +22,6 @@
#pragma once
#include "SVGAnimatedLength.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGGraphicsElement.h"
#include "SVGImageLoader.h"
@@ -42,13 +41,13 @@
const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); }
const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); }
const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); }
- const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(attributeOwnerProxy()); }
+ const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); }
RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); }
RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); }
RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); }
RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); }
- RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); }
+ SVGAnimatedPreserveAspectRatio& preserveAspectRatioAnimated() { return m_preserveAspectRatio; }
private:
SVGImageElement(const QualifiedName&, Document&);
@@ -86,7 +85,7 @@
SVGAnimatedLengthAttribute m_y { LengthModeHeight };
SVGAnimatedLengthAttribute m_width { LengthModeWidth };
SVGAnimatedLengthAttribute m_height { LengthModeHeight };
- SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio;
+ Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) };
SVGImageLoader m_imageLoader;
};
Modified: trunk/Source/WebCore/svg/SVGMarkerElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGMarkerElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGMarkerElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -24,7 +24,6 @@
#include "SVGAnimatedAngle.h"
#include "SVGAnimatedEnumeration.h"
#include "SVGAnimatedLength.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGElement.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
Modified: trunk/Source/WebCore/svg/SVGPatternElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGPatternElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGPatternElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -23,7 +23,6 @@
#include "SVGAnimatedEnumeration.h"
#include "SVGAnimatedLength.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGAnimatedTransformList.h"
#include "SVGElement.h"
#include "SVGExternalResourcesRequired.h"
Modified: trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGPreserveAspectRatio.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,40 +26,37 @@
#pragma once
#include "SVGPreserveAspectRatioValue.h"
-#include "SVGPropertyTearOff.h"
+#include "SVGValueProperty.h"
namespace WebCore {
-class SVGPreserveAspectRatio : public SVGPropertyTearOff<SVGPreserveAspectRatioValue> {
+class SVGPreserveAspectRatio : public SVGValueProperty<SVGPreserveAspectRatioValue> {
+ using Base = SVGValueProperty<SVGPreserveAspectRatioValue>;
+ using Base::Base;
+ using Base::m_value;
+
public:
- static Ref<SVGPreserveAspectRatio> create(SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGPreserveAspectRatioValue& value)
+ static Ref<SVGPreserveAspectRatio> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGPreserveAspectRatioValue& value = { })
{
- return adoptRef(*new SVGPreserveAspectRatio(animatedProperty, role, value));
+ return adoptRef(*new SVGPreserveAspectRatio(owner, access, value));
}
- static Ref<SVGPreserveAspectRatio> create(const SVGPreserveAspectRatioValue& initialValue = { })
+ template<typename T>
+ static ExceptionOr<Ref<SVGPreserveAspectRatio>> create(ExceptionOr<T>&& value)
{
- return adoptRef(*new SVGPreserveAspectRatio(initialValue));
+ if (value.hasException())
+ return value.releaseException();
+ return adoptRef(*new SVGPreserveAspectRatio(value.releaseReturnValue()));
}
- template<typename T> static ExceptionOr<Ref<SVGPreserveAspectRatio>> create(ExceptionOr<T>&& initialValue)
- {
- if (initialValue.hasException())
- return initialValue.releaseException();
- return create(initialValue.releaseReturnValue());
- }
+ unsigned short align() const { return m_value.align(); }
- unsigned short align()
- {
- return propertyReference().align();
- }
-
ExceptionOr<void> setAlign(float value)
{
if (isReadOnly())
return Exception { NoModificationAllowedError };
- auto result = propertyReference().setAlign(value);
+ auto result = m_value.setAlign(value);
if (result.hasException())
return result;
@@ -67,10 +64,7 @@
return result;
}
- unsigned short meetOrSlice()
- {
- return propertyReference().meetOrSlice();
- }
+ unsigned short meetOrSlice() const { return m_value.meetOrSlice(); }
ExceptionOr<void> setMeetOrSlice(float value)
{
@@ -77,7 +71,7 @@
if (isReadOnly())
return Exception { NoModificationAllowedError };
- auto result = propertyReference().setMeetOrSlice(value);
+ auto result = m_value.setMeetOrSlice(value);
if (result.hasException())
return result;
@@ -85,16 +79,10 @@
return result;
}
-private:
- SVGPreserveAspectRatio(SVGLegacyAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGPreserveAspectRatioValue& value)
- : SVGPropertyTearOff<SVGPreserveAspectRatioValue>(&animatedProperty, role, value)
+ String valueAsString() const override
{
+ return m_value.valueAsString();
}
-
- explicit SVGPreserveAspectRatio(const SVGPreserveAspectRatioValue& initialValue)
- : SVGPropertyTearOff<SVGPreserveAspectRatioValue>(initialValue)
- {
- }
};
} // namespace WebCore
Modified: trunk/Source/WebCore/svg/SVGSVGElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGSVGElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGSVGElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -23,7 +23,6 @@
#include "FloatPoint.h"
#include "SVGAnimatedLength.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
#include "SVGGraphicsElement.h"
Modified: trunk/Source/WebCore/svg/SVGStringList.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGStringList.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGStringList.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -27,6 +27,7 @@
#include "SVGParserUtilities.h"
#include "SVGPrimitiveList.h"
+#include <wtf/text/StringBuilder.h>
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGSymbolElement.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGSymbolElement.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGSymbolElement.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -21,7 +21,6 @@
#pragma once
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGElement.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGFitToViewBox.h"
Modified: trunk/Source/WebCore/svg/SVGViewSpec.h (243184 => 243185)
--- trunk/Source/WebCore/svg/SVGViewSpec.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/SVGViewSpec.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -20,7 +20,6 @@
#pragma once
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGFitToViewBox.h"
#include "SVGTransformListValues.h"
#include "SVGZoomAndPan.h"
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h (243184 => 243185)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -77,6 +77,28 @@
};
template<typename OwnerType>
+class SVGAnimatedPreserveAspectRatioAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio> {
+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio>;
+ using Base::property;
+
+public:
+ using Base::Base;
+ template<Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property>
+ constexpr static const SVGMemberAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPreserveAspectRatioAccessor, property>(); }
+
+private:
+ std::unique_ptr<SVGAttributeAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final
+ {
+ return SVGAnimatedPreserveAspectRatioAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive);
+ }
+
+ void appendAnimatedInstance(OwnerType& owner, SVGAttributeAnimator& animator) const final
+ {
+ static_cast<SVGAnimatedPreserveAspectRatioAnimator&>(animator).appendAnimatedInstance(property(owner));
+ }
+};
+
+template<typename OwnerType>
class SVGAnimatedRectAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedRect> {
using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedRect>;
using Base::property;
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h (243184 => 243185)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -75,7 +75,25 @@
m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal());
}
};
-
+
+class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction> {
+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction>;
+ using Base::Base;
+
+public:
+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPreserveAspectRatio>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive)
+ {
+ return std::make_unique<SVGAnimatedPreserveAspectRatioAnimator>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive);
+ }
+
+private:
+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final
+ {
+ SVGPreserveAspectRatioValue& animated = m_animated->animVal()->value();
+ m_function.progress(targetElement, percentage, repeatCount, animated);
+ }
+};
+
class SVGAnimatedRectAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedRect, SVGAnimationRectFunction> {
using Base = SVGAnimatedPropertyAnimator<SVGAnimatedRect, SVGAnimationRectFunction>;
Modified: trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h (243184 => 243185)
--- trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -32,11 +32,11 @@
#include "SVGAnimatedNumber.h"
#include "SVGAnimatedNumberList.h"
#include "SVGAnimatedPointList.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGAnimatedPrimitiveProperty.h"
#include "SVGAnimatedString.h"
#include "SVGAnimatedTransformList.h"
#include "SVGAnimatedValueProperty.h"
+#include "SVGPreserveAspectRatio.h"
#include "SVGRect.h"
namespace WebCore {
@@ -45,5 +45,6 @@
using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>;
using SVGAnimatedRect = SVGAnimatedValueProperty<SVGRect>;
+using SVGAnimatedPreserveAspectRatio = SVGAnimatedValueProperty<SVGPreserveAspectRatio>;
}
Modified: trunk/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h (243184 => 243185)
--- trunk/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -42,4 +42,28 @@
}
};
+class SVGAnimationPreserveAspectRatioFunction : public SVGAnimationDiscreteFunction<SVGPreserveAspectRatioValue> {
+public:
+ using Base = SVGAnimationDiscreteFunction<SVGPreserveAspectRatioValue>;
+ using Base::Base;
+
+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override
+ {
+ m_from = SVGPreserveAspectRatioValue(from);
+ m_to = SVGPreserveAspectRatioValue(to);
+ }
+};
+
+class SVGAnimationStringFunction : public SVGAnimationDiscreteFunction<String> {
+public:
+ using Base = SVGAnimationDiscreteFunction<String>;
+ using Base::Base;
+
+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override
+ {
+ m_from = from;
+ m_to = to;
+ }
+};
+
}
Modified: trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h (243184 => 243185)
--- trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/properties/SVGAttributeRegistry.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -31,7 +31,6 @@
#include "SVGAnimatedNumber.h"
#include "SVGAnimatedNumberList.h"
#include "SVGAnimatedPointList.h"
-#include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGAnimatedString.h"
#include "SVGAnimatedTransformList.h"
#include "SVGAttributeAccessor.h"
@@ -101,12 +100,6 @@
registerAttribute(SVGAnimatedPointListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
}
- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedPreserveAspectRatioAttribute OwnerType::*attribute>
- void registerAttribute()
- {
- registerAttribute(SVGAnimatedPreserveAspectRatioAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>());
- }
-
template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedStringAttribute OwnerType::*attribute>
void registerAttribute()
{
Modified: trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h (243184 => 243185)
--- trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h 2019-03-20 01:38:12 UTC (rev 243184)
+++ trunk/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h 2019-03-20 01:49:29 UTC (rev 243185)
@@ -55,16 +55,22 @@
registerProperty(attributeName, SVGAnimatedBooleanAccessor<OwnerType>::template singleton<property>());
}
- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedRect> OwnerType::*property>
+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property>
static void registerProperty()
{
- registerProperty(attributeName, SVGAnimatedRectAccessor<OwnerType>::template singleton<property>());
+ registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>());
}
+
+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property>
+ static void registerProperty()
+ {
+ registerProperty(attributeName, SVGAnimatedPreserveAspectRatioAccessor<OwnerType>::template singleton<property>());
+ }
- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property>
+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedRect> OwnerType::*property>
static void registerProperty()
{
- registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>());
+ registerProperty(attributeName, SVGAnimatedRectAccessor<OwnerType>::template singleton<property>());
}
template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property1, Ref<SVGAnimatedInteger> OwnerType::*property2>