haikuwebkit/Source/WebCore/svg/SVGAnimateElementBase.h

78 lines
3.1 KiB
C
Raw Permalink Normal View History

Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
/*
* Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
Remove SVG properties tear-off objects https://bugs.webkit.org/show_bug.cgi?id=191237 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-03 Reviewed by Simon Fraser. This patch cleans the code from unused SVG sources and get rid off the remaining SVG properties tear-off objects. Here are more details: -- Remove the SVGAttributeAnimationController and move its code to the SVGAnimateElementBase. SVGAttributeAnimationController was introduced to allow animating the SVG properties whether they are backed by tear off objects or not. Since there will be no tear off objects anymore, one animation controller will be needed. But in this case, it will be better if we make SVGAnimateElementBase is the animation controller and make it manage the animator directly. -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual function SVGElement::attributeOwnerProxy(). Remove also all the overriding functions attributeOwnerProxy() from all the SVGElements. -- Remove isKnownAttribute() from all the SVG header files except from four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace and SVGExternalResourcesRequired. -- Remove all the SVG animated properties classifying functions from SVGElement. This is now handled by SVGPropertyRegistry. -- There is no need for the enum AnimatedPropertyType anymore. The SVG property accessor knows its type, knows how to access it and know what animator it should be created for it. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::synchronizeAllAttributes const): (WebCore::Element::synchronizeAttribute const): (WebCore::Element::fastAttributeLookupAllowed const): These functions are surprisingly marked 'const'. They were calling 'const' functions in SVGElement and SVGElement was casting 'this' as non 'const' before calling the non 'const' functions through the non 'const' 'this' pointer. Change this by moving the casting to the Element functions. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * svg/SVGAElement.h: * svg/SVGAltGlyphElement.h: * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::animator const): (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): (WebCore::SVGAnimateElementBase::isDiscreteAnimator const): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimation): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted. (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted. (WebCore::SVGAnimateElementBase::isAdditive const): Deleted. * svg/SVGAnimateElementBase.h: (WebCore::SVGAnimateElementBase::animatorIfExists const): (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted. The order of the functions was changed to resemble the order of running the animation: -- Setting the animation range -- Starting the animation -- Progressing the animation -- Applying the the progressed animaVal() to the target element -- Stopping the animation * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::calculateDistance): * svg/SVGAnimateMotionElement.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeRegistry): Deleted. (WebCore::SVGAnimationElement::calculateDistance): Deleted. * svg/SVGAttributeAnimationController.cpp: Removed. * svg/SVGAttributeAnimationController.h: Removed. * svg/SVGAttributeAnimationControllerBase.cpp: Removed. * svg/SVGAttributeAnimationControllerBase.h: Removed. * svg/SVGCircleElement.h: * svg/SVGClipPathElement.h: * svg/SVGComponentTransferFunctionElement.h: * svg/SVGCursorElement.h: * svg/SVGDefsElement.h: * svg/SVGElement.cpp: (WebCore::SVGElement::synchronizeAttribute): (WebCore::SVGElement::synchronizeAllAttributes): (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted. (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted. (WebCore::SVGElement::isAnimatableCSSProperty): Deleted. (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted. * svg/SVGElement.h: (WebCore::SVGElement::attributeOwnerProxy const): Deleted. (WebCore::SVGElement::attributeRegistry): Deleted. (WebCore::SVGElement::synchronizeAttribute): Deleted. (WebCore::SVGElement::synchronizeAttributes): Deleted. (WebCore::SVGElement::animatedTypes const): Deleted. (WebCore::SVGElement::lookupAnimatedProperty const): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted. (WebCore::SVGElement::isKnownAttribute): Deleted. * svg/SVGEllipseElement.h: * svg/SVGExternalResourcesRequired.h: (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted. (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted. * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.h: * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.h: * svg/SVGFELightElement.h: * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.h: * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted. * svg/SVGFitToViewBox.h: (WebCore::SVGFitToViewBox::attributeRegistry): Deleted. * svg/SVGFontElement.h: * svg/SVGForeignObjectElement.h: * svg/SVGGElement.h: * svg/SVGGeometryElement.h: * svg/SVGGlyphRefElement.h: * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::svgAttributeChanged): * svg/SVGGradientElement.h: (WebCore::SVGGradientElement::attributeRegistry): Deleted. (WebCore::SVGGradientElement::isKnownAttribute): Deleted. * svg/SVGGraphicsElement.h: (WebCore::SVGGraphicsElement::attributeRegistry): Deleted. * svg/SVGImageElement.h: * svg/SVGLineElement.h: * svg/SVGLinearGradientElement.h: * svg/SVGMPathElement.h: * svg/SVGMarkerElement.cpp: * svg/SVGMarkerElement.h: * svg/SVGMaskElement.h: * svg/SVGPathElement.h: * svg/SVGPatternElement.h: * svg/SVGPolyElement.h: * svg/SVGRadialGradientElement.h: * svg/SVGRectElement.h: * svg/SVGSVGElement.h: * svg/SVGScriptElement.h: * svg/SVGStopElement.h: * svg/SVGSwitchElement.h: * svg/SVGSymbolElement.h: * svg/SVGTRefElement.h: * svg/SVGTests.cpp: (WebCore::SVGTests::svgAttributeChanged): (WebCore::SVGTests::attributeRegistry): Deleted. (WebCore::SVGTests::isKnownAttribute): Deleted. * svg/SVGTests.h: * svg/SVGTextContentElement.cpp: * svg/SVGTextContentElement.h: (WebCore::SVGTextContentElement::attributeRegistry): Deleted. * svg/SVGTextPathElement.h: * svg/SVGTextPositioningElement.h: (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted. * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::SVGURIReference): (WebCore::SVGURIReference::attributeRegistry): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.h: * svg/SVGViewElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): * svg/SVGViewSpec.h: * svg/SVGZoomAndPanType.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyAnimator.h: * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyPairAnimator.h: * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyType.h: Removed. * svg/properties/SVGAnimationAdditiveFunction.h: (WebCore::SVGAnimationAdditiveFunction::animate): (WebCore::SVGAnimationAdditiveFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: (WebCore::SVGAnimationLengthListFunction::animate): (WebCore::SVGAnimationNumberListFunction::animate): (WebCore::SVGAnimationPointListFunction::animate): (WebCore::SVGAnimationTransformListFunction::animate): (WebCore::SVGAnimationLengthListFunction::progress): Deleted. (WebCore::SVGAnimationNumberListFunction::progress): Deleted. (WebCore::SVGAnimationPointListFunction::progress): Deleted. (WebCore::SVGAnimationTransformListFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationAngleFunction::animate): (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationIntegerFunction::animate): (WebCore::SVGAnimationLengthFunction::animate): (WebCore::SVGAnimationNumberFunction::animate): (WebCore::SVGAnimationPathSegListFunction::animate): (WebCore::SVGAnimationRectFunction::animate): (WebCore::SVGAnimationAngleFunction::progress): Deleted. (WebCore::SVGAnimationColorFunction::progress): Deleted. (WebCore::SVGAnimationIntegerFunction::progress): Deleted. (WebCore::SVGAnimationLengthFunction::progress): Deleted. (WebCore::SVGAnimationNumberFunction::progress): Deleted. (WebCore::SVGAnimationPathSegListFunction::progress): Deleted. (WebCore::SVGAnimationRectFunction::progress): Deleted. * svg/properties/SVGAnimationDiscreteFunction.h: (WebCore::SVGAnimationDiscreteFunction::animate): (WebCore::SVGAnimationDiscreteFunction::progress): Deleted. * svg/properties/SVGAnimationFunction.h: (WebCore::SVGAnimationFunction::calculateDistance const): -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction to 'animate()'. -- Rename the argument 'percentage' of these function to 'progress' -- Make calculateDistance return Optional<float> so it does not have to return -1 in case of error. * svg/properties/SVGAttribute.h: Removed. * svg/properties/SVGAttributeAccessor.h: Removed. * svg/properties/SVGAttributeAnimator.h: (WebCore::SVGAttributeAnimator::calculateDistance const): * svg/properties/SVGAttributeOwnerProxy.cpp: Removed. * svg/properties/SVGAttributeOwnerProxy.h: Removed. * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed. * svg/properties/SVGAttributeRegistry.h: Removed. * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed. * svg/properties/SVGLegacyAnimatedProperty.h: Removed. * svg/properties/SVGLegacyProperty.h: Removed. * svg/properties/SVGListProperty.h: Removed. * svg/properties/SVGListPropertyTearOff.h: Removed. * svg/properties/SVGPrimitivePropertyAnimator.h: * svg/properties/SVGProperty.h: * svg/properties/SVGPropertyAnimator.h: * svg/properties/SVGPropertyTearOff.h: Removed. * svg/properties/SVGValuePropertyAnimator.h: * svg/properties/SVGValuePropertyListAnimator.h: Canonical link: https://commits.webkit.org/210826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-03 22:07:59 +00:00
* Copyright (C) 2008-2019 Apple Inc. All rights reserved.
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
* Copyright (C) Research In Motion Limited 2011. All rights reserved.
* Copyright (C) 2014 Adobe Systems Incorporated. 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
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
#include "SVGAnimationElement.h"
#include "SVGNames.h"
namespace WebCore {
Remove SVG properties tear-off objects https://bugs.webkit.org/show_bug.cgi?id=191237 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-03 Reviewed by Simon Fraser. This patch cleans the code from unused SVG sources and get rid off the remaining SVG properties tear-off objects. Here are more details: -- Remove the SVGAttributeAnimationController and move its code to the SVGAnimateElementBase. SVGAttributeAnimationController was introduced to allow animating the SVG properties whether they are backed by tear off objects or not. Since there will be no tear off objects anymore, one animation controller will be needed. But in this case, it will be better if we make SVGAnimateElementBase is the animation controller and make it manage the animator directly. -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual function SVGElement::attributeOwnerProxy(). Remove also all the overriding functions attributeOwnerProxy() from all the SVGElements. -- Remove isKnownAttribute() from all the SVG header files except from four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace and SVGExternalResourcesRequired. -- Remove all the SVG animated properties classifying functions from SVGElement. This is now handled by SVGPropertyRegistry. -- There is no need for the enum AnimatedPropertyType anymore. The SVG property accessor knows its type, knows how to access it and know what animator it should be created for it. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::synchronizeAllAttributes const): (WebCore::Element::synchronizeAttribute const): (WebCore::Element::fastAttributeLookupAllowed const): These functions are surprisingly marked 'const'. They were calling 'const' functions in SVGElement and SVGElement was casting 'this' as non 'const' before calling the non 'const' functions through the non 'const' 'this' pointer. Change this by moving the casting to the Element functions. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * svg/SVGAElement.h: * svg/SVGAltGlyphElement.h: * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::animator const): (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): (WebCore::SVGAnimateElementBase::isDiscreteAnimator const): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimation): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted. (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted. (WebCore::SVGAnimateElementBase::isAdditive const): Deleted. * svg/SVGAnimateElementBase.h: (WebCore::SVGAnimateElementBase::animatorIfExists const): (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted. The order of the functions was changed to resemble the order of running the animation: -- Setting the animation range -- Starting the animation -- Progressing the animation -- Applying the the progressed animaVal() to the target element -- Stopping the animation * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::calculateDistance): * svg/SVGAnimateMotionElement.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeRegistry): Deleted. (WebCore::SVGAnimationElement::calculateDistance): Deleted. * svg/SVGAttributeAnimationController.cpp: Removed. * svg/SVGAttributeAnimationController.h: Removed. * svg/SVGAttributeAnimationControllerBase.cpp: Removed. * svg/SVGAttributeAnimationControllerBase.h: Removed. * svg/SVGCircleElement.h: * svg/SVGClipPathElement.h: * svg/SVGComponentTransferFunctionElement.h: * svg/SVGCursorElement.h: * svg/SVGDefsElement.h: * svg/SVGElement.cpp: (WebCore::SVGElement::synchronizeAttribute): (WebCore::SVGElement::synchronizeAllAttributes): (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted. (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted. (WebCore::SVGElement::isAnimatableCSSProperty): Deleted. (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted. * svg/SVGElement.h: (WebCore::SVGElement::attributeOwnerProxy const): Deleted. (WebCore::SVGElement::attributeRegistry): Deleted. (WebCore::SVGElement::synchronizeAttribute): Deleted. (WebCore::SVGElement::synchronizeAttributes): Deleted. (WebCore::SVGElement::animatedTypes const): Deleted. (WebCore::SVGElement::lookupAnimatedProperty const): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted. (WebCore::SVGElement::isKnownAttribute): Deleted. * svg/SVGEllipseElement.h: * svg/SVGExternalResourcesRequired.h: (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted. (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted. * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.h: * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.h: * svg/SVGFELightElement.h: * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.h: * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted. * svg/SVGFitToViewBox.h: (WebCore::SVGFitToViewBox::attributeRegistry): Deleted. * svg/SVGFontElement.h: * svg/SVGForeignObjectElement.h: * svg/SVGGElement.h: * svg/SVGGeometryElement.h: * svg/SVGGlyphRefElement.h: * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::svgAttributeChanged): * svg/SVGGradientElement.h: (WebCore::SVGGradientElement::attributeRegistry): Deleted. (WebCore::SVGGradientElement::isKnownAttribute): Deleted. * svg/SVGGraphicsElement.h: (WebCore::SVGGraphicsElement::attributeRegistry): Deleted. * svg/SVGImageElement.h: * svg/SVGLineElement.h: * svg/SVGLinearGradientElement.h: * svg/SVGMPathElement.h: * svg/SVGMarkerElement.cpp: * svg/SVGMarkerElement.h: * svg/SVGMaskElement.h: * svg/SVGPathElement.h: * svg/SVGPatternElement.h: * svg/SVGPolyElement.h: * svg/SVGRadialGradientElement.h: * svg/SVGRectElement.h: * svg/SVGSVGElement.h: * svg/SVGScriptElement.h: * svg/SVGStopElement.h: * svg/SVGSwitchElement.h: * svg/SVGSymbolElement.h: * svg/SVGTRefElement.h: * svg/SVGTests.cpp: (WebCore::SVGTests::svgAttributeChanged): (WebCore::SVGTests::attributeRegistry): Deleted. (WebCore::SVGTests::isKnownAttribute): Deleted. * svg/SVGTests.h: * svg/SVGTextContentElement.cpp: * svg/SVGTextContentElement.h: (WebCore::SVGTextContentElement::attributeRegistry): Deleted. * svg/SVGTextPathElement.h: * svg/SVGTextPositioningElement.h: (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted. * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::SVGURIReference): (WebCore::SVGURIReference::attributeRegistry): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.h: * svg/SVGViewElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): * svg/SVGViewSpec.h: * svg/SVGZoomAndPanType.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyAnimator.h: * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyPairAnimator.h: * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyType.h: Removed. * svg/properties/SVGAnimationAdditiveFunction.h: (WebCore::SVGAnimationAdditiveFunction::animate): (WebCore::SVGAnimationAdditiveFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: (WebCore::SVGAnimationLengthListFunction::animate): (WebCore::SVGAnimationNumberListFunction::animate): (WebCore::SVGAnimationPointListFunction::animate): (WebCore::SVGAnimationTransformListFunction::animate): (WebCore::SVGAnimationLengthListFunction::progress): Deleted. (WebCore::SVGAnimationNumberListFunction::progress): Deleted. (WebCore::SVGAnimationPointListFunction::progress): Deleted. (WebCore::SVGAnimationTransformListFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationAngleFunction::animate): (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationIntegerFunction::animate): (WebCore::SVGAnimationLengthFunction::animate): (WebCore::SVGAnimationNumberFunction::animate): (WebCore::SVGAnimationPathSegListFunction::animate): (WebCore::SVGAnimationRectFunction::animate): (WebCore::SVGAnimationAngleFunction::progress): Deleted. (WebCore::SVGAnimationColorFunction::progress): Deleted. (WebCore::SVGAnimationIntegerFunction::progress): Deleted. (WebCore::SVGAnimationLengthFunction::progress): Deleted. (WebCore::SVGAnimationNumberFunction::progress): Deleted. (WebCore::SVGAnimationPathSegListFunction::progress): Deleted. (WebCore::SVGAnimationRectFunction::progress): Deleted. * svg/properties/SVGAnimationDiscreteFunction.h: (WebCore::SVGAnimationDiscreteFunction::animate): (WebCore::SVGAnimationDiscreteFunction::progress): Deleted. * svg/properties/SVGAnimationFunction.h: (WebCore::SVGAnimationFunction::calculateDistance const): -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction to 'animate()'. -- Rename the argument 'percentage' of these function to 'progress' -- Make calculateDistance return Optional<float> so it does not have to return -1 in case of error. * svg/properties/SVGAttribute.h: Removed. * svg/properties/SVGAttributeAccessor.h: Removed. * svg/properties/SVGAttributeAnimator.h: (WebCore::SVGAttributeAnimator::calculateDistance const): * svg/properties/SVGAttributeOwnerProxy.cpp: Removed. * svg/properties/SVGAttributeOwnerProxy.h: Removed. * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed. * svg/properties/SVGAttributeRegistry.h: Removed. * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed. * svg/properties/SVGLegacyAnimatedProperty.h: Removed. * svg/properties/SVGLegacyProperty.h: Removed. * svg/properties/SVGListProperty.h: Removed. * svg/properties/SVGListPropertyTearOff.h: Removed. * svg/properties/SVGPrimitivePropertyAnimator.h: * svg/properties/SVGProperty.h: * svg/properties/SVGPropertyAnimator.h: * svg/properties/SVGPropertyTearOff.h: Removed. * svg/properties/SVGValuePropertyAnimator.h: * svg/properties/SVGValuePropertyListAnimator.h: Canonical link: https://commits.webkit.org/210826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-03 22:07:59 +00:00
class SVGAttributeAnimator;
Remove the SVG property tear off objects for SVGAnimatedInteger https://bugs.webkit.org/show_bug.cgi?id=195722 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-03-16 Reviewed by Simon Fraser. Instead of saving a raw integer value in the SVGElement and then wrapping the pointer to this raw data in a tear off object, we will represent the integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the representation of the property in IDL file match the C++ header file. When the DOM requests the SVGAnimatedInteger, we get return a reference to the new animated property. When the rendering code asks for the current value of the this animated property, we return the animVal() or the baseVal() depending on whether the property is animating or not. A pointer to a member in the SVGElement will be registered along with the associated attribute name in SVGPropertyRegistry. Registering the property creates an SVGMemberAccessor and links to the associated attribute. The function of SVGMemberAccessor is to retrieve the value of the property given a pointer to an SVGElement. SVGPropertyRegistry manages all the properties of SVGElement. It takes into account the inherited properties as well. SVGElement will have a virtual method called propertyRegistry(). Every superclass will override this method to return a reference to its registry which includes all the registered properties of this class and its bases. One important function of the SVGPropertyRegistry and SVGAccessor is they create the appropriate SVGAttributeAnimator for this property. SVGAttributeAnimator is just a connection between the animated property and SVGAnimationFunction. SVGAnimationFunction calculates the values of the animated property within a time interval. SVGAnimatedPropertyAnimator updates animVal of the animated property and invalidates the associated SVGElement and all the instances that references this element. The plan is to remove all the SVG tear off objects like what this patch does for SVGAnimatedInteger. So for a period of time the old code and the new code will co-exist together. These things to consider when reviewing this patch: -- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase which is inherited by SVGLegacyAttributeAnimationController and SVGAttributeAnimationController. The tear-off properties code which uses SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The new code was added to SVGAttributeAnimationController. The plan is to remove the three animation controllers and to move the code of SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear off code is removed. -- SVGElement now keeps two registries one for the tear-off world and the other for the new world. Eventually we need to get rid of tear-off registry. -- SVGElement will differentiate between the type of the property by the the method isAnimatedAttribute(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::attributeAnimationController): (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists): (WebCore::SVGAnimateElementBase::hasValidAttributeType const): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::isAdditive const): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimation): (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): (WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted. (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElementBase::ensureAnimator): Deleted. * svg/SVGAnimateElementBase.h: * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::hasValidAttributeType const): (WebCore::SVGAnimateMotionElement::hasValidAttributeName const): (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted. * svg/SVGAnimateMotionElement.h: * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::hasValidAttributeType const): (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted. * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedInteger.cpp: Removed. * svg/SVGAnimatedInteger.h: Removed. * svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed. * svg/SVGAnimatedIntegerOptionalInteger.h: Removed. * svg/SVGAnimatedPointList.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::setAttributeType): (WebCore::SVGAnimationElement::resetAnimation): (WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimationElement::setTargetElement): Deleted. (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeType const): (WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted. * svg/SVGAnimatorFactory.h: (WebCore::SVGAnimatorFactory::create): * svg/SVGAttributeAnimationController.cpp: Added. (WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController): (WebCore::SVGAttributeAnimationController::animator const): (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const): (WebCore::SVGAttributeAnimationController::isAdditive const): (WebCore::SVGAttributeAnimationController::hasValidAttributeType const): (WebCore::SVGAttributeAnimationController::calculateFromAndToValues): (WebCore::SVGAttributeAnimationController::calculateFromAndByValues): (WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue): (WebCore::SVGAttributeAnimationController::resetAnimatedType): (WebCore::SVGAttributeAnimationController::calculateAnimatedValue): (WebCore::SVGAttributeAnimationController::applyResultsToTarget): (WebCore::SVGAttributeAnimationController::clearAnimatedType): (WebCore::SVGAttributeAnimationController::calculateDistance): * svg/SVGAttributeAnimationController.h: Added. (WebCore::SVGAttributeAnimationController::animatorIfExists const): * svg/SVGAttributeAnimationControllerBase.cpp: Added. (WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase): (WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType): * svg/SVGAttributeAnimationControllerBase.h: Added. * svg/SVGElement.cpp: (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): (WebCore::SVGElement::commitPropertyChange): (WebCore::SVGElement::isAnimatedPropertyAttribute const): (WebCore::SVGElement::isAnimatedAttribute const): (WebCore::SVGElement::createAnimator): * svg/SVGElement.h: (WebCore::SVGElement::propertyRegistry const): * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): (WebCore::SVGFEConvolveMatrixElement::registerAttributes): (WebCore::SVGFEConvolveMatrixElement::parseAttribute): (WebCore::SVGFEConvolveMatrixElement::setOrder): (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted. (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted. * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): (WebCore::SVGFETurbulenceElement::registerAttributes): (WebCore::SVGFETurbulenceElement::parseAttribute): (WebCore::SVGFETurbulenceElement::svgAttributeChanged): * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.h: * svg/SVGLegacyAttributeAnimationController.cpp: Added. (WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController): (WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator): (WebCore::SVGLegacyAttributeAnimationController::isAdditive const): (WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const): (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues): (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues): (WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue): (WebCore::propertyTypesAreConsistent): (WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType): (WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget): (WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType): (WebCore::SVGLegacyAttributeAnimationController::calculateDistance): * svg/SVGLegacyAttributeAnimationController.h: Added. * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::hasValidAttributeName const): (WebCore::SVGSMILElement::hasValidAttributeName): Deleted. * svg/animation/SVGSMILElement.h: * svg/properties/SVGAnimatedPrimitiveProperty.h: Added. (WebCore::SVGAnimatedPrimitiveProperty::create): (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal): (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal): (WebCore::SVGAnimatedPrimitiveProperty::baseVal const): (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal): (WebCore::SVGAnimatedPrimitiveProperty::animVal const): (WebCore::SVGAnimatedPrimitiveProperty::animVal): (WebCore::SVGAnimatedPrimitiveProperty::currentValue const): (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty): * svg/properties/SVGAnimatedProperty.cpp: Added. (WebCore::SVGAnimatedProperty::owner const): (WebCore::SVGAnimatedProperty::commitPropertyChange): * svg/properties/SVGAnimatedProperty.h: Added. (WebCore::SVGAnimatedProperty::isAttached const): (WebCore::SVGAnimatedProperty::detach): (WebCore::SVGAnimatedProperty::contextElement const): (WebCore::SVGAnimatedProperty::baseValAsString const): (WebCore::SVGAnimatedProperty::animValAsString const): (WebCore::SVGAnimatedProperty::isDirty const): (WebCore::SVGAnimatedProperty::setDirty): (WebCore::SVGAnimatedProperty::synchronize): (WebCore::SVGAnimatedProperty::isAnimating const): (WebCore::SVGAnimatedProperty::startAnimation): (WebCore::SVGAnimatedProperty::stopAnimation): (WebCore::SVGAnimatedProperty::instanceStartAnimation): (WebCore::SVGAnimatedProperty::instanceStopAnimation): (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): * svg/properties/SVGAnimatedPropertyAccessor.h: Added. * svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added. * svg/properties/SVGAnimatedPropertyAnimator.h: Added. (WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance): (WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator): * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added. * svg/properties/SVGAnimatedPropertyImpl.h: Added. * svg/properties/SVGAnimatedPropertyPairAccessor.h: Added. (WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor): (WebCore::SVGAnimatedPropertyPairAccessor::singleton): (WebCore::SVGAnimatedPropertyPairAccessor::property1 const): (WebCore::SVGAnimatedPropertyPairAccessor::property2 const): * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added. * svg/properties/SVGAnimatedPropertyPairAnimator.h: Added. (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance): (WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator): * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added. * svg/properties/SVGAnimationAdditiveFunction.h: Added. (WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction): (WebCore::SVGAnimationAdditiveFunction::progress): * svg/properties/SVGAnimationAdditiveValueFunction.h: Added. (WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const): * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added. (WebCore::SVGAnimationIntegerFunction::progress): * svg/properties/SVGAnimationFunction.h: Added. (WebCore::SVGAnimationFunction::isDiscrete const): (WebCore::SVGAnimationFunction::calculateDistance const): (WebCore::SVGAnimationFunction::SVGAnimationFunction): (WebCore::SVGAnimationFunction::addFromAndToValues): * svg/properties/SVGAttributeAnimator.cpp: Added. (WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange): * svg/properties/SVGAttributeAnimator.h: Added. (WebCore::SVGAttributeAnimator::SVGAttributeAnimator): (WebCore::SVGAttributeAnimator::isDiscrete const): (WebCore::SVGAttributeAnimator::setFromAndToValues): (WebCore::SVGAttributeAnimator::setFromAndByValues): (WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue): (WebCore::SVGAttributeAnimator::calculateDistance const): * svg/properties/SVGAttributeOwnerProxy.cpp: * svg/properties/SVGAttributeOwnerProxy.h: * svg/properties/SVGAttributeRegistry.h: * svg/properties/SVGMemberAccessor.h: Added. (WebCore::SVGMemberAccessor::detach const): (WebCore::SVGMemberAccessor::isAnimatedProperty const): (WebCore::SVGMemberAccessor::isAnimatedLength const): (WebCore::SVGMemberAccessor::matches const): (WebCore::SVGMemberAccessor::synchronize const): (WebCore::SVGMemberAccessor::createAnimator const): (WebCore::SVGMemberAccessor::appendAnimatedInstance const): * svg/properties/SVGPointerMemberAccessor.h: Added. (WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor): (WebCore::SVGPointerMemberAccessor::property const): (WebCore::SVGPointerMemberAccessor::singleton): * svg/properties/SVGProperty.h: Added. * svg/properties/SVGPropertyOwner.h: Added. (WebCore::SVGPropertyOwner::owner const): (WebCore::SVGPropertyOwner::attributeContextElement const): (WebCore::SVGPropertyOwner::commitPropertyChange): * svg/properties/SVGPropertyOwnerRegistry.h: Added. (WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry): (WebCore::SVGPropertyOwnerRegistry::registerProperty): (WebCore::SVGPropertyOwnerRegistry::enumerateRecursively): (WebCore::SVGPropertyOwnerRegistry::isKnownAttribute): (WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes): (WebCore::SVGPropertyOwnerRegistry::findAccessor): * svg/properties/SVGPropertyRegistry.h: Added. Canonical link: https://commits.webkit.org/210119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-16 07:42:41 +00:00
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
class SVGAnimateElementBase : public SVGAnimationElement {
Put the DOM in IsoHeaps https://bugs.webkit.org/show_bug.cgi?id=183546 Source/bmalloc: Reviewed by Simon Fraser. Make it easy to runtime-disable IsoHeaps. * bmalloc/Allocator.h: * bmalloc/IsoTLS.cpp: (bmalloc::IsoTLS::determineMallocFallbackState): * bmalloc/IsoTLS.h: * bmalloc/IsoTLSInlines.h: (bmalloc::IsoTLS::allocateSlow): (bmalloc::IsoTLS::deallocateSlow): Source/WebCore: Reviewed by Daniel Bates. No new tests because no change in behavior. This puts all descendants of WebCore::Node in isoheaps, so that UAFs on the DOM cannot be used for RCE attacks. This probably also makes it harder to use UAFs for UXSS, since it means that DOM UAFs cannot be used for universal read gadgets. This looks neutral on Speedometer and membuster, though I did have one round of testing that led me to believe that membuster was regressed - I just wasn't able to reproduce that result on subsequent testing. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Attr.cpp: * dom/Attr.h: * dom/CDATASection.cpp: * dom/CDATASection.h: * dom/CharacterData.cpp: * dom/CharacterData.h: * dom/Comment.cpp: * dom/Comment.h: * dom/ContainerNode.cpp: * dom/ContainerNode.h: * dom/Document.cpp: * dom/Document.h: * dom/DocumentFragment.cpp: * dom/DocumentFragment.h: * dom/DocumentType.cpp: * dom/DocumentType.h: * dom/Node.cpp: * dom/Node.h: * dom/ProcessingInstruction.cpp: * dom/ProcessingInstruction.h: * dom/PseudoElement.cpp: * dom/PseudoElement.h: * dom/ShadowRoot.cpp: * dom/ShadowRoot.h: * dom/StyledElement.cpp: * dom/StyledElement.h: * dom/TemplateContentDocumentFragment.cpp: Added. * dom/TemplateContentDocumentFragment.h: * dom/Text.cpp: * dom/Text.h: * dom/XMLDocument.cpp: Added. * dom/XMLDocument.h: * html/FTPDirectoryDocument.cpp: * html/FTPDirectoryDocument.h: * html/FileInputType.cpp: * html/HTMLAnchorElement.cpp: * html/HTMLAnchorElement.h: * html/HTMLAppletElement.cpp: * html/HTMLAppletElement.h: * html/HTMLAreaElement.cpp: * html/HTMLAreaElement.h: * html/HTMLAttachmentElement.cpp: * html/HTMLAttachmentElement.h: * html/HTMLBDIElement.cpp: Added. * html/HTMLBDIElement.h: * html/HTMLBRElement.cpp: * html/HTMLBRElement.h: * html/HTMLBaseElement.cpp: * html/HTMLBaseElement.h: * html/HTMLBodyElement.cpp: * html/HTMLBodyElement.h: * html/HTMLButtonElement.cpp: * html/HTMLButtonElement.h: * html/HTMLCanvasElement.cpp: * html/HTMLCanvasElement.h: * html/HTMLDListElement.cpp: * html/HTMLDListElement.h: * html/HTMLDataElement.cpp: * html/HTMLDataElement.h: * html/HTMLDataListElement.cpp: * html/HTMLDataListElement.h: * html/HTMLDetailsElement.cpp: * html/HTMLDetailsElement.h: * html/HTMLDirectoryElement.cpp: * html/HTMLDirectoryElement.h: * html/HTMLDivElement.cpp: * html/HTMLDivElement.h: * html/HTMLDocument.cpp: * html/HTMLDocument.h: * html/HTMLElement.cpp: * html/HTMLElement.h: * html/HTMLEmbedElement.cpp: * html/HTMLEmbedElement.h: * html/HTMLFieldSetElement.cpp: * html/HTMLFieldSetElement.h: * html/HTMLFontElement.cpp: * html/HTMLFontElement.h: * html/HTMLFormControlElement.cpp: * html/HTMLFormControlElement.h: * html/HTMLFormControlElementWithState.cpp: * html/HTMLFormControlElementWithState.h: * html/HTMLFormElement.cpp: * html/HTMLFormElement.h: * html/HTMLFrameElement.cpp: * html/HTMLFrameElement.h: * html/HTMLFrameElementBase.cpp: * html/HTMLFrameElementBase.h: * html/HTMLFrameOwnerElement.cpp: * html/HTMLFrameOwnerElement.h: * html/HTMLFrameSetElement.cpp: * html/HTMLFrameSetElement.h: * html/HTMLHRElement.cpp: * html/HTMLHRElement.h: * html/HTMLHeadElement.cpp: * html/HTMLHeadElement.h: * html/HTMLHeadingElement.cpp: * html/HTMLHeadingElement.h: * html/HTMLHtmlElement.cpp: * html/HTMLHtmlElement.h: * html/HTMLIFrameElement.cpp: * html/HTMLIFrameElement.h: * html/HTMLImageElement.cpp: * html/HTMLImageElement.h: * html/HTMLInputElement.cpp: * html/HTMLInputElement.h: * html/HTMLKeygenElement.cpp: * html/HTMLKeygenElement.h: * html/HTMLLIElement.cpp: * html/HTMLLIElement.h: * html/HTMLLabelElement.cpp: * html/HTMLLabelElement.h: * html/HTMLLegendElement.cpp: * html/HTMLLegendElement.h: * html/HTMLLinkElement.cpp: * html/HTMLLinkElement.h: * html/HTMLMapElement.cpp: * html/HTMLMapElement.h: * html/HTMLMarqueeElement.cpp: * html/HTMLMarqueeElement.h: * html/HTMLMenuElement.cpp: * html/HTMLMenuElement.h: * html/HTMLMenuItemElement.cpp: * html/HTMLMenuItemElement.h: * html/HTMLMetaElement.cpp: * html/HTMLMetaElement.h: * html/HTMLMeterElement.cpp: * html/HTMLMeterElement.h: * html/HTMLModElement.cpp: * html/HTMLModElement.h: * html/HTMLOListElement.cpp: * html/HTMLOListElement.h: * html/HTMLObjectElement.cpp: * html/HTMLObjectElement.h: * html/HTMLOptGroupElement.cpp: * html/HTMLOptGroupElement.h: * html/HTMLOptionElement.cpp: * html/HTMLOptionElement.h: * html/HTMLOutputElement.cpp: * html/HTMLOutputElement.h: * html/HTMLParagraphElement.cpp: * html/HTMLParagraphElement.h: * html/HTMLParamElement.cpp: * html/HTMLParamElement.h: * html/HTMLPictureElement.cpp: * html/HTMLPictureElement.h: * html/HTMLPlugInElement.cpp: * html/HTMLPlugInElement.h: * html/HTMLPlugInImageElement.cpp: * html/HTMLPlugInImageElement.h: * html/HTMLPreElement.cpp: * html/HTMLPreElement.h: * html/HTMLProgressElement.cpp: * html/HTMLProgressElement.h: * html/HTMLQuoteElement.cpp: * html/HTMLQuoteElement.h: * html/HTMLScriptElement.cpp: * html/HTMLScriptElement.h: * html/HTMLSelectElement.cpp: * html/HTMLSelectElement.h: * html/HTMLSlotElement.cpp: * html/HTMLSlotElement.h: * html/HTMLSourceElement.cpp: * html/HTMLSourceElement.h: * html/HTMLSpanElement.cpp: * html/HTMLSpanElement.h: * html/HTMLStyleElement.cpp: * html/HTMLStyleElement.h: * html/HTMLSummaryElement.cpp: * html/HTMLSummaryElement.h: * html/HTMLTableCaptionElement.cpp: * html/HTMLTableCaptionElement.h: * html/HTMLTableCellElement.cpp: * html/HTMLTableCellElement.h: * html/HTMLTableColElement.cpp: * html/HTMLTableColElement.h: * html/HTMLTableElement.cpp: * html/HTMLTableElement.h: * html/HTMLTablePartElement.cpp: * html/HTMLTablePartElement.h: * html/HTMLTableRowElement.cpp: * html/HTMLTableRowElement.h: * html/HTMLTableSectionElement.cpp: * html/HTMLTableSectionElement.h: * html/HTMLTemplateElement.cpp: * html/HTMLTemplateElement.h: * html/HTMLTextAreaElement.cpp: * html/HTMLTextAreaElement.h: * html/HTMLTextFormControlElement.cpp: * html/HTMLTextFormControlElement.h: * html/HTMLTimeElement.cpp: * html/HTMLTimeElement.h: * html/HTMLTitleElement.cpp: * html/HTMLTitleElement.h: * html/HTMLTrackElement.cpp: * html/HTMLTrackElement.h: * html/HTMLUListElement.cpp: * html/HTMLUListElement.h: * html/HTMLUnknownElement.cpp: Added. * html/HTMLUnknownElement.h: * html/HTMLWBRElement.cpp: * html/HTMLWBRElement.h: * html/ImageDocument.cpp: * html/ImageDocument.h: * html/LabelableElement.cpp: * html/LabelableElement.h: * html/MediaController.cpp: (MediaController::create): Deleted. (MediaController::MediaController): Deleted. (MediaController::addMediaElement): Deleted. (MediaController::removeMediaElement): Deleted. (MediaController::containsMediaElement const): Deleted. (MediaController::buffered const): Deleted. (MediaController::seekable const): Deleted. (MediaController::played): Deleted. (MediaController::duration const): Deleted. (MediaController::currentTime const): Deleted. (MediaController::setCurrentTime): Deleted. (MediaController::unpause): Deleted. (MediaController::play): Deleted. (MediaController::pause): Deleted. (MediaController::setDefaultPlaybackRate): Deleted. (MediaController::playbackRate const): Deleted. (MediaController::setPlaybackRate): Deleted. (MediaController::setVolume): Deleted. (MediaController::setMuted): Deleted. (playbackStateWaiting): Deleted. (playbackStatePlaying): Deleted. (playbackStateEnded): Deleted. (MediaController::playbackState const): Deleted. (MediaController::reportControllerState): Deleted. (eventNameForReadyState): Deleted. (MediaController::updateReadyState): Deleted. (MediaController::updatePlaybackState): Deleted. (MediaController::updateMediaElements): Deleted. (MediaController::bringElementUpToSpeed): Deleted. (MediaController::isBlocked const): Deleted. (MediaController::hasEnded const): Deleted. (MediaController::scheduleEvent): Deleted. (MediaController::asyncEventTimerFired): Deleted. (MediaController::clearPositionTimerFired): Deleted. (MediaController::hasAudio const): Deleted. (MediaController::hasVideo const): Deleted. (MediaController::hasClosedCaptions const): Deleted. (MediaController::setClosedCaptionsVisible): Deleted. (MediaController::supportsScanning const): Deleted. (MediaController::beginScrubbing): Deleted. (MediaController::endScrubbing): Deleted. (MediaController::beginScanning): Deleted. (MediaController::endScanning): Deleted. (MediaController::canPlay const): Deleted. (MediaController::isLiveStream const): Deleted. (MediaController::hasCurrentSrc const): Deleted. (MediaController::returnToRealtime): Deleted. (MediaController::startTimeupdateTimer): Deleted. (MediaController::scheduleTimeupdateEvent): Deleted. * html/MediaDocument.cpp: * html/MediaDocument.h: * html/PluginDocument.cpp: * html/PluginDocument.h: * html/RubyElement.cpp: * html/RubyElement.h: * html/RubyTextElement.cpp: * html/RubyTextElement.h: * html/TextDocument.cpp: * html/TextDocument.h: * html/shadow/AutoFillButtonElement.cpp: * html/shadow/AutoFillButtonElement.h: * html/shadow/DetailsMarkerControl.cpp: * html/shadow/DetailsMarkerControl.h: * html/shadow/ImageControlsRootElement.cpp: * html/shadow/ImageControlsRootElement.h: * html/shadow/MediaControlElementTypes.cpp: * html/shadow/MediaControlElementTypes.h: * html/shadow/MediaControlElements.cpp: * html/shadow/MediaControlElements.h: * html/shadow/MediaControls.cpp: * html/shadow/MediaControls.h: * html/shadow/ProgressShadowElement.cpp: * html/shadow/ProgressShadowElement.h: * html/shadow/SliderThumbElement.cpp: * html/shadow/SliderThumbElement.h: * html/shadow/SpinButtonElement.cpp: * html/shadow/SpinButtonElement.h: * html/shadow/TextControlInnerElements.cpp: * html/shadow/TextControlInnerElements.h: * html/shadow/YouTubeEmbedShadowElement.cpp: * html/shadow/YouTubeEmbedShadowElement.h: * html/shadow/mac/ImageControlsButtonElementMac.cpp: * html/shadow/mac/ImageControlsButtonElementMac.h: * html/shadow/mac/ImageControlsRootElementMac.cpp: * html/shadow/mac/ImageControlsRootElementMac.h: * html/track/TextTrackCueGeneric.cpp: * html/track/VTTCue.cpp: * html/track/VTTCue.h: * html/track/WebVTTElement.cpp: * html/track/WebVTTElement.h: * loader/SinkDocument.cpp: * loader/SinkDocument.h: * mathml/MathMLAnnotationElement.cpp: * mathml/MathMLAnnotationElement.h: * mathml/MathMLElement.cpp: * mathml/MathMLElement.h: * mathml/MathMLFractionElement.cpp: * mathml/MathMLFractionElement.h: * mathml/MathMLMathElement.cpp: * mathml/MathMLMathElement.h: * mathml/MathMLMencloseElement.cpp: * mathml/MathMLMencloseElement.h: * mathml/MathMLOperatorElement.cpp: * mathml/MathMLOperatorElement.h: * mathml/MathMLPaddedElement.cpp: * mathml/MathMLPaddedElement.h: * mathml/MathMLPresentationElement.cpp: * mathml/MathMLPresentationElement.h: * mathml/MathMLRootElement.cpp: * mathml/MathMLRootElement.h: * mathml/MathMLRowElement.cpp: * mathml/MathMLRowElement.h: * mathml/MathMLScriptsElement.cpp: * mathml/MathMLScriptsElement.h: * mathml/MathMLSelectElement.cpp: * mathml/MathMLSelectElement.h: * mathml/MathMLSpaceElement.cpp: * mathml/MathMLSpaceElement.h: * mathml/MathMLTokenElement.cpp: * mathml/MathMLTokenElement.h: * mathml/MathMLUnderOverElement.cpp: * mathml/MathMLUnderOverElement.h: * mathml/MathMLUnknownElement.cpp: Added. * mathml/MathMLUnknownElement.h: * svg/SVGAElement.cpp: * svg/SVGAElement.h: * svg/SVGAltGlyphDefElement.cpp: * svg/SVGAltGlyphDefElement.h: * svg/SVGAltGlyphElement.cpp: * svg/SVGAltGlyphElement.h: * svg/SVGAltGlyphItemElement.cpp: * svg/SVGAltGlyphItemElement.h: * svg/SVGAnimateColorElement.cpp: * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: * svg/SVGAnimateElement.h: * svg/SVGAnimateElementBase.cpp: * svg/SVGAnimateElementBase.h: * svg/SVGAnimateMotionElement.cpp: * svg/SVGAnimateMotionElement.h: * svg/SVGAnimateTransformElement.cpp: * svg/SVGAnimateTransformElement.h: * svg/SVGAnimationElement.cpp: * svg/SVGAnimationElement.h: * svg/SVGCircleElement.cpp: * svg/SVGCircleElement.h: * svg/SVGClipPathElement.cpp: * svg/SVGClipPathElement.h: * svg/SVGComponentTransferFunctionElement.cpp: * svg/SVGComponentTransferFunctionElement.h: * svg/SVGCursorElement.cpp: * svg/SVGCursorElement.h: * svg/SVGDefsElement.cpp: * svg/SVGDefsElement.h: * svg/SVGDescElement.cpp: * svg/SVGDescElement.h: * svg/SVGDocument.cpp: * svg/SVGDocument.h: * svg/SVGElement.cpp: * svg/SVGElement.h: * svg/SVGEllipseElement.cpp: * svg/SVGEllipseElement.h: * svg/SVGFEBlendElement.cpp: * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.cpp: * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.cpp: * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.cpp: * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.cpp: * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFEDiffuseLightingElement.cpp: * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.cpp: * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.cpp: * svg/SVGFEDropShadowElement.h: * svg/SVGFEFloodElement.cpp: * svg/SVGFEFloodElement.h: * svg/SVGFEGaussianBlurElement.cpp: * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.cpp: * svg/SVGFEImageElement.h: * svg/SVGFELightElement.cpp: * svg/SVGFELightElement.h: * svg/SVGFEMergeElement.cpp: * svg/SVGFEMergeElement.h: * svg/SVGFEMergeNodeElement.cpp: * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.cpp: * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.cpp: * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.cpp: * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.cpp: * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.cpp: * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.cpp: * svg/SVGFilterElement.h: * svg/SVGFilterPrimitiveStandardAttributes.cpp: * svg/SVGFilterPrimitiveStandardAttributes.h: * svg/SVGFontFaceElement.cpp: * svg/SVGFontFaceElement.h: * svg/SVGFontFaceFormatElement.cpp: * svg/SVGFontFaceFormatElement.h: * svg/SVGFontFaceNameElement.cpp: * svg/SVGFontFaceNameElement.h: * svg/SVGFontFaceSrcElement.cpp: * svg/SVGFontFaceSrcElement.h: * svg/SVGFontFaceUriElement.cpp: * svg/SVGFontFaceUriElement.h: * svg/SVGForeignObjectElement.cpp: * svg/SVGForeignObjectElement.h: * svg/SVGGElement.cpp: * svg/SVGGElement.h: * svg/SVGGlyphElement.cpp: * svg/SVGGlyphElement.h: * svg/SVGGlyphRefElement.cpp: * svg/SVGGlyphRefElement.h: * svg/SVGGradientElement.cpp: * svg/SVGGradientElement.h: * svg/SVGGraphicsElement.cpp: * svg/SVGGraphicsElement.h: * svg/SVGHKernElement.cpp: * svg/SVGHKernElement.h: * svg/SVGImageElement.cpp: * svg/SVGImageElement.h: * svg/SVGLineElement.cpp: * svg/SVGLineElement.h: * svg/SVGLinearGradientElement.cpp: * svg/SVGLinearGradientElement.h: * svg/SVGMPathElement.cpp: * svg/SVGMPathElement.h: * svg/SVGMarkerElement.cpp: * svg/SVGMarkerElement.h: * svg/SVGMaskElement.cpp: * svg/SVGMaskElement.h: * svg/SVGMetadataElement.cpp: * svg/SVGMetadataElement.h: * svg/SVGMissingGlyphElement.cpp: * svg/SVGMissingGlyphElement.h: * svg/SVGPathElement.cpp: * svg/SVGPathElement.h: * svg/SVGPatternElement.cpp: * svg/SVGPatternElement.h: * svg/SVGPolyElement.cpp: * svg/SVGPolyElement.h: * svg/SVGPolygonElement.cpp: * svg/SVGPolygonElement.h: * svg/SVGPolylineElement.cpp: * svg/SVGPolylineElement.h: * svg/SVGRadialGradientElement.cpp: * svg/SVGRadialGradientElement.h: * svg/SVGRectElement.cpp: * svg/SVGRectElement.h: * svg/SVGSVGElement.cpp: * svg/SVGSVGElement.h: * svg/SVGScriptElement.cpp: * svg/SVGScriptElement.h: * svg/SVGSetElement.cpp: * svg/SVGSetElement.h: * svg/SVGStopElement.cpp: * svg/SVGStopElement.h: * svg/SVGStyleElement.cpp: * svg/SVGStyleElement.h: * svg/SVGSwitchElement.cpp: * svg/SVGSwitchElement.h: * svg/SVGSymbolElement.cpp: * svg/SVGSymbolElement.h: * svg/SVGTRefElement.cpp: * svg/SVGTRefElement.h: * svg/SVGTSpanElement.cpp: * svg/SVGTSpanElement.h: * svg/SVGTextContentElement.cpp: * svg/SVGTextContentElement.h: * svg/SVGTextElement.cpp: * svg/SVGTextElement.h: * svg/SVGTextPathElement.cpp: * svg/SVGTextPathElement.h: * svg/SVGTextPositioningElement.cpp: * svg/SVGTextPositioningElement.h: * svg/SVGTitleElement.cpp: * svg/SVGTitleElement.h: * svg/SVGUnknownElement.cpp: Added. * svg/SVGUnknownElement.h: * svg/SVGUseElement.cpp: * svg/SVGUseElement.h: * svg/SVGVKernElement.cpp: * svg/SVGVKernElement.h: * svg/SVGViewElement.cpp: * svg/SVGViewElement.h: * svg/animation/SVGSMILElement.cpp: * svg/animation/SVGSMILElement.h: Canonical link: https://commits.webkit.org/199361@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-03-17 06:11:00 +00:00
WTF_MAKE_ISO_ALLOCATED(SVGAnimateElementBase);
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
public:
Remove the SVG property tear off objects for SVGAnimatedString https://bugs.webkit.org/show_bug.cgi?id=196065 Patch by Said Abou-Hallawa <said@apple.com> on 2019-03-21 Reviewed by Simon Fraser. -- Define SVGAnimatedString to be SVGAnimatedPrimitiveProperty<String>. -- Add SVGAnimatedStringAccessor to associate an attribute name with a pointer to an SVGAnimatedString member of an SVGElement. Given a pointer to an SVGElement, this accessor will and create an animator for the animated property. -- Add SVGAnimatedStringAnimator to animated an SVGAnimatedString. -- Add SVGAnimationStringFunction which is a discrete function and is responsible for progressing an animated String over a period of time. -- Define SVGStringAnimator to be SVGPrimitivePropertyAnimator<String, SVGAnimationStringFunction>. SVGStringAnimator is responsible for animating attributes with no reflecting animated properties, e.g. "font-family". * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * svg/SVGAElement.cpp: (WebCore::SVGAElement::SVGAElement): (WebCore::SVGAElement::parseAttribute): (WebCore::SVGAElement::registerAttributes): Deleted. * svg/SVGAElement.h: * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::hasValidAttributeType const): (WebCore::SVGAnimateElementBase::isDiscreteAnimator const): * svg/SVGAnimateElementBase.h: * svg/SVGAnimatedString.cpp: Removed. * svg/SVGAnimatedString.h: Removed. * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): The animation controller has to tell whether the animator is discrete or not. The properties are now registered either in SVGAttributeRegistry which relies on the tear off objects to know the AnimatedPropertyType of the property. Or it is registered in SVGPropertyOwnerRegistry which creates the animators through the accessors. Each animator knows whether it is discrete or not. * svg/SVGAnimatorFactory.h: (WebCore::SVGAnimatorFactory::create): * svg/SVGAttributeAnimationController.cpp: (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const): * svg/SVGAttributeAnimationController.h: * svg/SVGAttributeAnimationControllerBase.h: * svg/SVGCursorElement.h: * svg/SVGElement.cpp: (WebCore::SVGElement::SVGElement): (WebCore::SVGElement::parseAttribute): (WebCore::SVGElement::registerAttributes): Deleted. * svg/SVGElement.h: (WebCore::SVGElement::isKnownAttribute): (WebCore::SVGElement::className const): (WebCore::SVGElement::classNameAnimated): (WebCore::SVGElement::attributeRegistry): Deleted. * svg/SVGExternalResourcesRequired.cpp: * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::SVGFEBlendElement): (WebCore::SVGFEBlendElement::registerAttributes): (WebCore::SVGFEBlendElement::parseAttribute): * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement): (WebCore::SVGFEColorMatrixElement::registerAttributes): (WebCore::SVGFEColorMatrixElement::parseAttribute): * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement): (WebCore::SVGFEComponentTransferElement::parseAttribute): (WebCore::SVGFEComponentTransferElement::registerAttributes): Deleted. * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::SVGFECompositeElement): (WebCore::SVGFECompositeElement::registerAttributes): (WebCore::SVGFECompositeElement::parseAttribute): * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): (WebCore::SVGFEConvolveMatrixElement::registerAttributes): (WebCore::SVGFEConvolveMatrixElement::parseAttribute): * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement): (WebCore::SVGFEDiffuseLightingElement::parseAttribute): (WebCore::SVGFEDiffuseLightingElement::registerAttributes): Deleted. * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement): (WebCore::SVGFEDisplacementMapElement::registerAttributes): (WebCore::SVGFEDisplacementMapElement::parseAttribute): * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement): (WebCore::SVGFEDropShadowElement::parseAttribute): (WebCore::SVGFEDropShadowElement::svgAttributeChanged): (WebCore::SVGFEDropShadowElement::registerAttributes): Deleted. * svg/SVGFEDropShadowElement.h: * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement): (WebCore::SVGFEGaussianBlurElement::registerAttributes): (WebCore::SVGFEGaussianBlurElement::parseAttribute): * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEMergeNodeElement.cpp: (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement): (WebCore::SVGFEMergeNodeElement::parseAttribute): (WebCore::SVGFEMergeNodeElement::registerAttributes): Deleted. * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement): (WebCore::SVGFEMorphologyElement::registerAttributes): (WebCore::SVGFEMorphologyElement::parseAttribute): * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.cpp: (WebCore::SVGFEOffsetElement::SVGFEOffsetElement): (WebCore::SVGFEOffsetElement::parseAttribute): (WebCore::SVGFEOffsetElement::svgAttributeChanged): (WebCore::SVGFEOffsetElement::registerAttributes): Deleted. * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement): (WebCore::SVGFESpecularLightingElement::parseAttribute): (WebCore::SVGFESpecularLightingElement::registerAttributes): Deleted. * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.cpp: (WebCore::SVGFETileElement::SVGFETileElement): (WebCore::SVGFETileElement::parseAttribute): (WebCore::SVGFETileElement::registerAttributes): Deleted. * svg/SVGFETileElement.h: * svg/SVGFilterPrimitiveStandardAttributes.cpp: (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes): (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes): (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::result const): (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated): * svg/SVGLegacyAttributeAnimationController.cpp: (WebCore::SVGLegacyAttributeAnimationController::isDiscreteAnimator const): * svg/SVGLegacyAttributeAnimationController.h: * svg/SVGMPathElement.h: * svg/SVGScriptElement.h: * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::SVGURIReference): (WebCore::SVGURIReference::isKnownAttribute): (WebCore::SVGURIReference::parseAttribute): (WebCore::SVGURIReference::registerAttributes): Deleted. (WebCore::SVGURIReference::href const): Deleted. (WebCore::SVGURIReference::hrefAnimated): Deleted. * svg/SVGURIReference.h: (WebCore::SVGURIReference::href const): (WebCore::SVGURIReference::hrefAnimated): * svg/properties/SVGAnimatedPropertyAccessorImpl.h: * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyImpl.h: * svg/properties/SVGAttributeRegistry.h: * svg/properties/SVGPrimitivePropertyAnimatorImpl.h: * svg/properties/SVGPropertyAnimatorFactory.h: (WebCore::SVGPropertyAnimatorFactory::createStringAnimator): (WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator): * svg/properties/SVGPropertyOwnerRegistry.h: (WebCore::SVGPropertyOwnerRegistry::registerProperty): Canonical link: https://commits.webkit.org/210397@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-21 21:46:39 +00:00
bool isDiscreteAnimator() const;
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
protected:
SVGAnimateElementBase(const QualifiedName&, Document&);
Assertion fires when animating a discrete property with values range and multiple animators https://bugs.webkit.org/show_bug.cgi?id=201926 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-09-20 Reviewed by Darin Adler. Source/WebCore: The first animator of a property is considered the result element. The other animators will be just contributers to the first animator. For the first animator and in SVGSMILElement::progress(), we call resetAnimatedType() which creates m_animator in SVGAnimateElementBase::animator(). But for the other animators we do not call resetAnimatedType(). So their m_animator will stay null until they are used for the first time. If SVGAnimationElement::startedActiveInterval() calls calculateToAtEndOfDurationValue() for a discrete property this will have no effect and the call should be ignored. So SVGAnimateElementBase::calculateToAtEndOfDurationValue() should bail out early if isDiscreteAnimator() is true. The bug is isDiscreteAnimator() will return false if the m_animator is null even if the animated property is discrete, e.g. SVGAnimatedString. The fix is to make isDiscreteAnimator() ensure m_animator is created. Unrelated change: Make most of the protected methods of SVGAnimateElementBase be private. Test: svg/animations/multiple-discrete-values-animate.svg * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): LayoutTests: Animate a discrete property, such as SVGAnimatedString. There should be multiple animators and the range of animation has to be set by the 'values' attribute. * svg/animations/multiple-discrete-values-animate-expected.txt: Added. * svg/animations/multiple-discrete-values-animate.svg: Added. Canonical link: https://commits.webkit.org/215674@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-21 01:24:45 +00:00
bool hasValidAttributeType() const override;
virtual String animateRangeString(const String& string) const { return string; }
private:
Remove SVG properties tear-off objects https://bugs.webkit.org/show_bug.cgi?id=191237 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-03 Reviewed by Simon Fraser. This patch cleans the code from unused SVG sources and get rid off the remaining SVG properties tear-off objects. Here are more details: -- Remove the SVGAttributeAnimationController and move its code to the SVGAnimateElementBase. SVGAttributeAnimationController was introduced to allow animating the SVG properties whether they are backed by tear off objects or not. Since there will be no tear off objects anymore, one animation controller will be needed. But in this case, it will be better if we make SVGAnimateElementBase is the animation controller and make it manage the animator directly. -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual function SVGElement::attributeOwnerProxy(). Remove also all the overriding functions attributeOwnerProxy() from all the SVGElements. -- Remove isKnownAttribute() from all the SVG header files except from four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace and SVGExternalResourcesRequired. -- Remove all the SVG animated properties classifying functions from SVGElement. This is now handled by SVGPropertyRegistry. -- There is no need for the enum AnimatedPropertyType anymore. The SVG property accessor knows its type, knows how to access it and know what animator it should be created for it. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::synchronizeAllAttributes const): (WebCore::Element::synchronizeAttribute const): (WebCore::Element::fastAttributeLookupAllowed const): These functions are surprisingly marked 'const'. They were calling 'const' functions in SVGElement and SVGElement was casting 'this' as non 'const' before calling the non 'const' functions through the non 'const' 'this' pointer. Change this by moving the casting to the Element functions. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * svg/SVGAElement.h: * svg/SVGAltGlyphElement.h: * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::animator const): (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): (WebCore::SVGAnimateElementBase::isDiscreteAnimator const): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimation): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted. (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted. (WebCore::SVGAnimateElementBase::isAdditive const): Deleted. * svg/SVGAnimateElementBase.h: (WebCore::SVGAnimateElementBase::animatorIfExists const): (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted. The order of the functions was changed to resemble the order of running the animation: -- Setting the animation range -- Starting the animation -- Progressing the animation -- Applying the the progressed animaVal() to the target element -- Stopping the animation * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::calculateDistance): * svg/SVGAnimateMotionElement.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeRegistry): Deleted. (WebCore::SVGAnimationElement::calculateDistance): Deleted. * svg/SVGAttributeAnimationController.cpp: Removed. * svg/SVGAttributeAnimationController.h: Removed. * svg/SVGAttributeAnimationControllerBase.cpp: Removed. * svg/SVGAttributeAnimationControllerBase.h: Removed. * svg/SVGCircleElement.h: * svg/SVGClipPathElement.h: * svg/SVGComponentTransferFunctionElement.h: * svg/SVGCursorElement.h: * svg/SVGDefsElement.h: * svg/SVGElement.cpp: (WebCore::SVGElement::synchronizeAttribute): (WebCore::SVGElement::synchronizeAllAttributes): (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted. (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted. (WebCore::SVGElement::isAnimatableCSSProperty): Deleted. (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted. * svg/SVGElement.h: (WebCore::SVGElement::attributeOwnerProxy const): Deleted. (WebCore::SVGElement::attributeRegistry): Deleted. (WebCore::SVGElement::synchronizeAttribute): Deleted. (WebCore::SVGElement::synchronizeAttributes): Deleted. (WebCore::SVGElement::animatedTypes const): Deleted. (WebCore::SVGElement::lookupAnimatedProperty const): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted. (WebCore::SVGElement::isKnownAttribute): Deleted. * svg/SVGEllipseElement.h: * svg/SVGExternalResourcesRequired.h: (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted. (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted. * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.h: * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.h: * svg/SVGFELightElement.h: * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.h: * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted. * svg/SVGFitToViewBox.h: (WebCore::SVGFitToViewBox::attributeRegistry): Deleted. * svg/SVGFontElement.h: * svg/SVGForeignObjectElement.h: * svg/SVGGElement.h: * svg/SVGGeometryElement.h: * svg/SVGGlyphRefElement.h: * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::svgAttributeChanged): * svg/SVGGradientElement.h: (WebCore::SVGGradientElement::attributeRegistry): Deleted. (WebCore::SVGGradientElement::isKnownAttribute): Deleted. * svg/SVGGraphicsElement.h: (WebCore::SVGGraphicsElement::attributeRegistry): Deleted. * svg/SVGImageElement.h: * svg/SVGLineElement.h: * svg/SVGLinearGradientElement.h: * svg/SVGMPathElement.h: * svg/SVGMarkerElement.cpp: * svg/SVGMarkerElement.h: * svg/SVGMaskElement.h: * svg/SVGPathElement.h: * svg/SVGPatternElement.h: * svg/SVGPolyElement.h: * svg/SVGRadialGradientElement.h: * svg/SVGRectElement.h: * svg/SVGSVGElement.h: * svg/SVGScriptElement.h: * svg/SVGStopElement.h: * svg/SVGSwitchElement.h: * svg/SVGSymbolElement.h: * svg/SVGTRefElement.h: * svg/SVGTests.cpp: (WebCore::SVGTests::svgAttributeChanged): (WebCore::SVGTests::attributeRegistry): Deleted. (WebCore::SVGTests::isKnownAttribute): Deleted. * svg/SVGTests.h: * svg/SVGTextContentElement.cpp: * svg/SVGTextContentElement.h: (WebCore::SVGTextContentElement::attributeRegistry): Deleted. * svg/SVGTextPathElement.h: * svg/SVGTextPositioningElement.h: (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted. * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::SVGURIReference): (WebCore::SVGURIReference::attributeRegistry): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.h: * svg/SVGViewElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): * svg/SVGViewSpec.h: * svg/SVGZoomAndPanType.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyAnimator.h: * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyPairAnimator.h: * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyType.h: Removed. * svg/properties/SVGAnimationAdditiveFunction.h: (WebCore::SVGAnimationAdditiveFunction::animate): (WebCore::SVGAnimationAdditiveFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: (WebCore::SVGAnimationLengthListFunction::animate): (WebCore::SVGAnimationNumberListFunction::animate): (WebCore::SVGAnimationPointListFunction::animate): (WebCore::SVGAnimationTransformListFunction::animate): (WebCore::SVGAnimationLengthListFunction::progress): Deleted. (WebCore::SVGAnimationNumberListFunction::progress): Deleted. (WebCore::SVGAnimationPointListFunction::progress): Deleted. (WebCore::SVGAnimationTransformListFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationAngleFunction::animate): (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationIntegerFunction::animate): (WebCore::SVGAnimationLengthFunction::animate): (WebCore::SVGAnimationNumberFunction::animate): (WebCore::SVGAnimationPathSegListFunction::animate): (WebCore::SVGAnimationRectFunction::animate): (WebCore::SVGAnimationAngleFunction::progress): Deleted. (WebCore::SVGAnimationColorFunction::progress): Deleted. (WebCore::SVGAnimationIntegerFunction::progress): Deleted. (WebCore::SVGAnimationLengthFunction::progress): Deleted. (WebCore::SVGAnimationNumberFunction::progress): Deleted. (WebCore::SVGAnimationPathSegListFunction::progress): Deleted. (WebCore::SVGAnimationRectFunction::progress): Deleted. * svg/properties/SVGAnimationDiscreteFunction.h: (WebCore::SVGAnimationDiscreteFunction::animate): (WebCore::SVGAnimationDiscreteFunction::progress): Deleted. * svg/properties/SVGAnimationFunction.h: (WebCore::SVGAnimationFunction::calculateDistance const): -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction to 'animate()'. -- Rename the argument 'percentage' of these function to 'progress' -- Make calculateDistance return Optional<float> so it does not have to return -1 in case of error. * svg/properties/SVGAttribute.h: Removed. * svg/properties/SVGAttributeAccessor.h: Removed. * svg/properties/SVGAttributeAnimator.h: (WebCore::SVGAttributeAnimator::calculateDistance const): * svg/properties/SVGAttributeOwnerProxy.cpp: Removed. * svg/properties/SVGAttributeOwnerProxy.h: Removed. * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed. * svg/properties/SVGAttributeRegistry.h: Removed. * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed. * svg/properties/SVGLegacyAnimatedProperty.h: Removed. * svg/properties/SVGLegacyProperty.h: Removed. * svg/properties/SVGListProperty.h: Removed. * svg/properties/SVGListPropertyTearOff.h: Removed. * svg/properties/SVGPrimitivePropertyAnimator.h: * svg/properties/SVGProperty.h: * svg/properties/SVGPropertyAnimator.h: * svg/properties/SVGPropertyTearOff.h: Removed. * svg/properties/SVGValuePropertyAnimator.h: * svg/properties/SVGValuePropertyListAnimator.h: Canonical link: https://commits.webkit.org/210826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-03 22:07:59 +00:00
SVGAttributeAnimator* animator() const;
SVGAttributeAnimator* animatorIfExists() const { return m_animator.get(); }
void setTargetElement(SVGElement*) override;
void setAttributeName(const QualifiedName&) override;
void resetAnimation() override;
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
bool calculateFromAndToValues(const String& fromString, const String& toString) override;
bool calculateFromAndByValues(const String& fromString, const String& byString) override;
Remove SVG properties tear-off objects https://bugs.webkit.org/show_bug.cgi?id=191237 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-03 Reviewed by Simon Fraser. This patch cleans the code from unused SVG sources and get rid off the remaining SVG properties tear-off objects. Here are more details: -- Remove the SVGAttributeAnimationController and move its code to the SVGAnimateElementBase. SVGAttributeAnimationController was introduced to allow animating the SVG properties whether they are backed by tear off objects or not. Since there will be no tear off objects anymore, one animation controller will be needed. But in this case, it will be better if we make SVGAnimateElementBase is the animation controller and make it manage the animator directly. -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual function SVGElement::attributeOwnerProxy(). Remove also all the overriding functions attributeOwnerProxy() from all the SVGElements. -- Remove isKnownAttribute() from all the SVG header files except from four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace and SVGExternalResourcesRequired. -- Remove all the SVG animated properties classifying functions from SVGElement. This is now handled by SVGPropertyRegistry. -- There is no need for the enum AnimatedPropertyType anymore. The SVG property accessor knows its type, knows how to access it and know what animator it should be created for it. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::synchronizeAllAttributes const): (WebCore::Element::synchronizeAttribute const): (WebCore::Element::fastAttributeLookupAllowed const): These functions are surprisingly marked 'const'. They were calling 'const' functions in SVGElement and SVGElement was casting 'this' as non 'const' before calling the non 'const' functions through the non 'const' 'this' pointer. Change this by moving the casting to the Element functions. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * svg/SVGAElement.h: * svg/SVGAltGlyphElement.h: * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::animator const): (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): (WebCore::SVGAnimateElementBase::isDiscreteAnimator const): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimation): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted. (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted. (WebCore::SVGAnimateElementBase::isAdditive const): Deleted. * svg/SVGAnimateElementBase.h: (WebCore::SVGAnimateElementBase::animatorIfExists const): (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted. The order of the functions was changed to resemble the order of running the animation: -- Setting the animation range -- Starting the animation -- Progressing the animation -- Applying the the progressed animaVal() to the target element -- Stopping the animation * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::calculateDistance): * svg/SVGAnimateMotionElement.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeRegistry): Deleted. (WebCore::SVGAnimationElement::calculateDistance): Deleted. * svg/SVGAttributeAnimationController.cpp: Removed. * svg/SVGAttributeAnimationController.h: Removed. * svg/SVGAttributeAnimationControllerBase.cpp: Removed. * svg/SVGAttributeAnimationControllerBase.h: Removed. * svg/SVGCircleElement.h: * svg/SVGClipPathElement.h: * svg/SVGComponentTransferFunctionElement.h: * svg/SVGCursorElement.h: * svg/SVGDefsElement.h: * svg/SVGElement.cpp: (WebCore::SVGElement::synchronizeAttribute): (WebCore::SVGElement::synchronizeAllAttributes): (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted. (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted. (WebCore::SVGElement::isAnimatableCSSProperty): Deleted. (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted. * svg/SVGElement.h: (WebCore::SVGElement::attributeOwnerProxy const): Deleted. (WebCore::SVGElement::attributeRegistry): Deleted. (WebCore::SVGElement::synchronizeAttribute): Deleted. (WebCore::SVGElement::synchronizeAttributes): Deleted. (WebCore::SVGElement::animatedTypes const): Deleted. (WebCore::SVGElement::lookupAnimatedProperty const): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted. (WebCore::SVGElement::isKnownAttribute): Deleted. * svg/SVGEllipseElement.h: * svg/SVGExternalResourcesRequired.h: (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted. (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted. * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.h: * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.h: * svg/SVGFELightElement.h: * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.h: * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted. * svg/SVGFitToViewBox.h: (WebCore::SVGFitToViewBox::attributeRegistry): Deleted. * svg/SVGFontElement.h: * svg/SVGForeignObjectElement.h: * svg/SVGGElement.h: * svg/SVGGeometryElement.h: * svg/SVGGlyphRefElement.h: * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::svgAttributeChanged): * svg/SVGGradientElement.h: (WebCore::SVGGradientElement::attributeRegistry): Deleted. (WebCore::SVGGradientElement::isKnownAttribute): Deleted. * svg/SVGGraphicsElement.h: (WebCore::SVGGraphicsElement::attributeRegistry): Deleted. * svg/SVGImageElement.h: * svg/SVGLineElement.h: * svg/SVGLinearGradientElement.h: * svg/SVGMPathElement.h: * svg/SVGMarkerElement.cpp: * svg/SVGMarkerElement.h: * svg/SVGMaskElement.h: * svg/SVGPathElement.h: * svg/SVGPatternElement.h: * svg/SVGPolyElement.h: * svg/SVGRadialGradientElement.h: * svg/SVGRectElement.h: * svg/SVGSVGElement.h: * svg/SVGScriptElement.h: * svg/SVGStopElement.h: * svg/SVGSwitchElement.h: * svg/SVGSymbolElement.h: * svg/SVGTRefElement.h: * svg/SVGTests.cpp: (WebCore::SVGTests::svgAttributeChanged): (WebCore::SVGTests::attributeRegistry): Deleted. (WebCore::SVGTests::isKnownAttribute): Deleted. * svg/SVGTests.h: * svg/SVGTextContentElement.cpp: * svg/SVGTextContentElement.h: (WebCore::SVGTextContentElement::attributeRegistry): Deleted. * svg/SVGTextPathElement.h: * svg/SVGTextPositioningElement.h: (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted. * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::SVGURIReference): (WebCore::SVGURIReference::attributeRegistry): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.h: * svg/SVGViewElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): * svg/SVGViewSpec.h: * svg/SVGZoomAndPanType.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyAnimator.h: * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyPairAnimator.h: * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyType.h: Removed. * svg/properties/SVGAnimationAdditiveFunction.h: (WebCore::SVGAnimationAdditiveFunction::animate): (WebCore::SVGAnimationAdditiveFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: (WebCore::SVGAnimationLengthListFunction::animate): (WebCore::SVGAnimationNumberListFunction::animate): (WebCore::SVGAnimationPointListFunction::animate): (WebCore::SVGAnimationTransformListFunction::animate): (WebCore::SVGAnimationLengthListFunction::progress): Deleted. (WebCore::SVGAnimationNumberListFunction::progress): Deleted. (WebCore::SVGAnimationPointListFunction::progress): Deleted. (WebCore::SVGAnimationTransformListFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationAngleFunction::animate): (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationIntegerFunction::animate): (WebCore::SVGAnimationLengthFunction::animate): (WebCore::SVGAnimationNumberFunction::animate): (WebCore::SVGAnimationPathSegListFunction::animate): (WebCore::SVGAnimationRectFunction::animate): (WebCore::SVGAnimationAngleFunction::progress): Deleted. (WebCore::SVGAnimationColorFunction::progress): Deleted. (WebCore::SVGAnimationIntegerFunction::progress): Deleted. (WebCore::SVGAnimationLengthFunction::progress): Deleted. (WebCore::SVGAnimationNumberFunction::progress): Deleted. (WebCore::SVGAnimationPathSegListFunction::progress): Deleted. (WebCore::SVGAnimationRectFunction::progress): Deleted. * svg/properties/SVGAnimationDiscreteFunction.h: (WebCore::SVGAnimationDiscreteFunction::animate): (WebCore::SVGAnimationDiscreteFunction::progress): Deleted. * svg/properties/SVGAnimationFunction.h: (WebCore::SVGAnimationFunction::calculateDistance const): -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction to 'animate()'. -- Rename the argument 'percentage' of these function to 'progress' -- Make calculateDistance return Optional<float> so it does not have to return -1 in case of error. * svg/properties/SVGAttribute.h: Removed. * svg/properties/SVGAttributeAccessor.h: Removed. * svg/properties/SVGAttributeAnimator.h: (WebCore::SVGAttributeAnimator::calculateDistance const): * svg/properties/SVGAttributeOwnerProxy.cpp: Removed. * svg/properties/SVGAttributeOwnerProxy.h: Removed. * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed. * svg/properties/SVGAttributeRegistry.h: Removed. * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed. * svg/properties/SVGLegacyAnimatedProperty.h: Removed. * svg/properties/SVGLegacyProperty.h: Removed. * svg/properties/SVGListProperty.h: Removed. * svg/properties/SVGListPropertyTearOff.h: Removed. * svg/properties/SVGPrimitivePropertyAnimator.h: * svg/properties/SVGProperty.h: * svg/properties/SVGPropertyAnimator.h: * svg/properties/SVGPropertyTearOff.h: Removed. * svg/properties/SVGValuePropertyAnimator.h: * svg/properties/SVGValuePropertyListAnimator.h: Canonical link: https://commits.webkit.org/210826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-03 22:07:59 +00:00
bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) override;
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
Remove the argument 'resultElement' from the SVG animation functions https://bugs.webkit.org/show_bug.cgi?id=202052 Reviewed by Simon Fraser. This is a clean-up patch, which does the following: -- It removes the argument 'resultElement' from all the SVG animation functions except from SVGSMILElement::progress(). In this function, we need to start the animation only with the first animation. -- It renames resetAnimatedType() and clearAnimatedType() to startAnimation() and stopAnimation() respectively. These functions were named for the type SVGAnimatedType which had been deleted. The real purpose of these functions is to start/stop the animation. Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-10-30 * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::startAnimation): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::stopAnimation): (WebCore::SVGAnimateElementBase::resetAnimatedType): Deleted. (WebCore::SVGAnimateElementBase::clearAnimatedType): Deleted. * svg/SVGAnimateElementBase.h: * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::startAnimation): (WebCore::SVGAnimateMotionElement::stopAnimation): (WebCore::SVGAnimateMotionElement::calculateAnimatedValue): (WebCore::SVGAnimateMotionElement::resetAnimatedType): Deleted. (WebCore::SVGAnimateMotionElement::clearAnimatedType): Deleted. * svg/SVGAnimateMotionElement.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::updateAnimation): * svg/SVGAnimationElement.h: * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::updateAnimations): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::reset): (WebCore::SVGSMILElement::setAttributeName): (WebCore::SVGSMILElement::setTargetElement): (WebCore::SVGSMILElement::progress): * svg/animation/SVGSMILElement.h: Canonical link: https://commits.webkit.org/217002@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-30 22:15:17 +00:00
void startAnimation() override;
void calculateAnimatedValue(float progress, unsigned repeatCount) override;
Remove SVG properties tear-off objects https://bugs.webkit.org/show_bug.cgi?id=191237 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-03 Reviewed by Simon Fraser. This patch cleans the code from unused SVG sources and get rid off the remaining SVG properties tear-off objects. Here are more details: -- Remove the SVGAttributeAnimationController and move its code to the SVGAnimateElementBase. SVGAttributeAnimationController was introduced to allow animating the SVG properties whether they are backed by tear off objects or not. Since there will be no tear off objects anymore, one animation controller will be needed. But in this case, it will be better if we make SVGAnimateElementBase is the animation controller and make it manage the animator directly. -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual function SVGElement::attributeOwnerProxy(). Remove also all the overriding functions attributeOwnerProxy() from all the SVGElements. -- Remove isKnownAttribute() from all the SVG header files except from four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace and SVGExternalResourcesRequired. -- Remove all the SVG animated properties classifying functions from SVGElement. This is now handled by SVGPropertyRegistry. -- There is no need for the enum AnimatedPropertyType anymore. The SVG property accessor knows its type, knows how to access it and know what animator it should be created for it. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/Element.cpp: (WebCore::Element::synchronizeAllAttributes const): (WebCore::Element::synchronizeAttribute const): (WebCore::Element::fastAttributeLookupAllowed const): These functions are surprisingly marked 'const'. They were calling 'const' functions in SVGElement and SVGElement was casting 'this' as non 'const' before calling the non 'const' functions through the non 'const' 'this' pointer. Change this by moving the casting to the Element functions. * rendering/svg/RenderSVGResourceGradient.cpp: (WebCore::RenderSVGResourceGradient::applyResource): * rendering/svg/RenderSVGResourcePattern.cpp: (WebCore::RenderSVGResourcePattern::applyResource): * svg/SVGAElement.h: * svg/SVGAltGlyphElement.h: * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::animator const): (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): (WebCore::SVGAnimateElementBase::isDiscreteAnimator const): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimation): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted. (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted. (WebCore::SVGAnimateElementBase::isAdditive const): Deleted. * svg/SVGAnimateElementBase.h: (WebCore::SVGAnimateElementBase::animatorIfExists const): (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted. The order of the functions was changed to resemble the order of running the animation: -- Setting the animation range -- Starting the animation -- Progressing the animation -- Applying the the progressed animaVal() to the target element -- Stopping the animation * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::calculateDistance): * svg/SVGAnimateMotionElement.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeRegistry): Deleted. (WebCore::SVGAnimationElement::calculateDistance): Deleted. * svg/SVGAttributeAnimationController.cpp: Removed. * svg/SVGAttributeAnimationController.h: Removed. * svg/SVGAttributeAnimationControllerBase.cpp: Removed. * svg/SVGAttributeAnimationControllerBase.h: Removed. * svg/SVGCircleElement.h: * svg/SVGClipPathElement.h: * svg/SVGComponentTransferFunctionElement.h: * svg/SVGCursorElement.h: * svg/SVGDefsElement.h: * svg/SVGElement.cpp: (WebCore::SVGElement::synchronizeAttribute): (WebCore::SVGElement::synchronizeAllAttributes): (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted. (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted. (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted. (WebCore::SVGElement::isAnimatableCSSProperty): Deleted. (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted. * svg/SVGElement.h: (WebCore::SVGElement::attributeOwnerProxy const): Deleted. (WebCore::SVGElement::attributeRegistry): Deleted. (WebCore::SVGElement::synchronizeAttribute): Deleted. (WebCore::SVGElement::synchronizeAttributes): Deleted. (WebCore::SVGElement::animatedTypes const): Deleted. (WebCore::SVGElement::lookupAnimatedProperty const): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted. (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted. (WebCore::SVGElement::isKnownAttribute): Deleted. * svg/SVGEllipseElement.h: * svg/SVGExternalResourcesRequired.h: (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted. (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted. * svg/SVGFEBlendElement.h: * svg/SVGFEColorMatrixElement.h: * svg/SVGFEComponentTransferElement.h: * svg/SVGFECompositeElement.h: * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFEDiffuseLightingElement.h: * svg/SVGFEDisplacementMapElement.h: * svg/SVGFEDropShadowElement.h: * svg/SVGFEGaussianBlurElement.h: * svg/SVGFEImageElement.h: * svg/SVGFELightElement.h: * svg/SVGFEMergeNodeElement.h: * svg/SVGFEMorphologyElement.h: * svg/SVGFEOffsetElement.h: * svg/SVGFESpecularLightingElement.h: * svg/SVGFETileElement.h: * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.h: * svg/SVGFilterPrimitiveStandardAttributes.h: (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted. * svg/SVGFitToViewBox.h: (WebCore::SVGFitToViewBox::attributeRegistry): Deleted. * svg/SVGFontElement.h: * svg/SVGForeignObjectElement.h: * svg/SVGGElement.h: * svg/SVGGeometryElement.h: * svg/SVGGlyphRefElement.h: * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::svgAttributeChanged): * svg/SVGGradientElement.h: (WebCore::SVGGradientElement::attributeRegistry): Deleted. (WebCore::SVGGradientElement::isKnownAttribute): Deleted. * svg/SVGGraphicsElement.h: (WebCore::SVGGraphicsElement::attributeRegistry): Deleted. * svg/SVGImageElement.h: * svg/SVGLineElement.h: * svg/SVGLinearGradientElement.h: * svg/SVGMPathElement.h: * svg/SVGMarkerElement.cpp: * svg/SVGMarkerElement.h: * svg/SVGMaskElement.h: * svg/SVGPathElement.h: * svg/SVGPatternElement.h: * svg/SVGPolyElement.h: * svg/SVGRadialGradientElement.h: * svg/SVGRectElement.h: * svg/SVGSVGElement.h: * svg/SVGScriptElement.h: * svg/SVGStopElement.h: * svg/SVGSwitchElement.h: * svg/SVGSymbolElement.h: * svg/SVGTRefElement.h: * svg/SVGTests.cpp: (WebCore::SVGTests::svgAttributeChanged): (WebCore::SVGTests::attributeRegistry): Deleted. (WebCore::SVGTests::isKnownAttribute): Deleted. * svg/SVGTests.h: * svg/SVGTextContentElement.cpp: * svg/SVGTextContentElement.h: (WebCore::SVGTextContentElement::attributeRegistry): Deleted. * svg/SVGTextPathElement.h: * svg/SVGTextPositioningElement.h: (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted. * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::SVGURIReference): (WebCore::SVGURIReference::attributeRegistry): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.h: * svg/SVGViewElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): * svg/SVGViewSpec.h: * svg/SVGZoomAndPanType.h: * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyAnimator.h: * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyPairAnimator.h: * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyTearOff.h: Removed. * svg/properties/SVGAnimatedPropertyType.h: Removed. * svg/properties/SVGAnimationAdditiveFunction.h: (WebCore::SVGAnimationAdditiveFunction::animate): (WebCore::SVGAnimationAdditiveFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: (WebCore::SVGAnimationLengthListFunction::animate): (WebCore::SVGAnimationNumberListFunction::animate): (WebCore::SVGAnimationPointListFunction::animate): (WebCore::SVGAnimationTransformListFunction::animate): (WebCore::SVGAnimationLengthListFunction::progress): Deleted. (WebCore::SVGAnimationNumberListFunction::progress): Deleted. (WebCore::SVGAnimationPointListFunction::progress): Deleted. (WebCore::SVGAnimationTransformListFunction::progress): Deleted. * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: (WebCore::SVGAnimationAngleFunction::animate): (WebCore::SVGAnimationColorFunction::animate): (WebCore::SVGAnimationIntegerFunction::animate): (WebCore::SVGAnimationLengthFunction::animate): (WebCore::SVGAnimationNumberFunction::animate): (WebCore::SVGAnimationPathSegListFunction::animate): (WebCore::SVGAnimationRectFunction::animate): (WebCore::SVGAnimationAngleFunction::progress): Deleted. (WebCore::SVGAnimationColorFunction::progress): Deleted. (WebCore::SVGAnimationIntegerFunction::progress): Deleted. (WebCore::SVGAnimationLengthFunction::progress): Deleted. (WebCore::SVGAnimationNumberFunction::progress): Deleted. (WebCore::SVGAnimationPathSegListFunction::progress): Deleted. (WebCore::SVGAnimationRectFunction::progress): Deleted. * svg/properties/SVGAnimationDiscreteFunction.h: (WebCore::SVGAnimationDiscreteFunction::animate): (WebCore::SVGAnimationDiscreteFunction::progress): Deleted. * svg/properties/SVGAnimationFunction.h: (WebCore::SVGAnimationFunction::calculateDistance const): -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction to 'animate()'. -- Rename the argument 'percentage' of these function to 'progress' -- Make calculateDistance return Optional<float> so it does not have to return -1 in case of error. * svg/properties/SVGAttribute.h: Removed. * svg/properties/SVGAttributeAccessor.h: Removed. * svg/properties/SVGAttributeAnimator.h: (WebCore::SVGAttributeAnimator::calculateDistance const): * svg/properties/SVGAttributeOwnerProxy.cpp: Removed. * svg/properties/SVGAttributeOwnerProxy.h: Removed. * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed. * svg/properties/SVGAttributeRegistry.h: Removed. * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed. * svg/properties/SVGLegacyAnimatedProperty.h: Removed. * svg/properties/SVGLegacyProperty.h: Removed. * svg/properties/SVGListProperty.h: Removed. * svg/properties/SVGListPropertyTearOff.h: Removed. * svg/properties/SVGPrimitivePropertyAnimator.h: * svg/properties/SVGProperty.h: * svg/properties/SVGPropertyAnimator.h: * svg/properties/SVGPropertyTearOff.h: Removed. * svg/properties/SVGValuePropertyAnimator.h: * svg/properties/SVGValuePropertyListAnimator.h: Canonical link: https://commits.webkit.org/210826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-03 22:07:59 +00:00
void applyResultsToTarget() override;
Remove the argument 'resultElement' from the SVG animation functions https://bugs.webkit.org/show_bug.cgi?id=202052 Reviewed by Simon Fraser. This is a clean-up patch, which does the following: -- It removes the argument 'resultElement' from all the SVG animation functions except from SVGSMILElement::progress(). In this function, we need to start the animation only with the first animation. -- It renames resetAnimatedType() and clearAnimatedType() to startAnimation() and stopAnimation() respectively. These functions were named for the type SVGAnimatedType which had been deleted. The real purpose of these functions is to start/stop the animation. Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-10-30 * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::startAnimation): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::stopAnimation): (WebCore::SVGAnimateElementBase::resetAnimatedType): Deleted. (WebCore::SVGAnimateElementBase::clearAnimatedType): Deleted. * svg/SVGAnimateElementBase.h: * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::startAnimation): (WebCore::SVGAnimateMotionElement::stopAnimation): (WebCore::SVGAnimateMotionElement::calculateAnimatedValue): (WebCore::SVGAnimateMotionElement::resetAnimatedType): Deleted. (WebCore::SVGAnimateMotionElement::clearAnimatedType): Deleted. * svg/SVGAnimateMotionElement.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::updateAnimation): * svg/SVGAnimationElement.h: * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::updateAnimations): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::reset): (WebCore::SVGSMILElement::setAttributeName): (WebCore::SVGSMILElement::setTargetElement): (WebCore::SVGSMILElement::progress): * svg/animation/SVGSMILElement.h: Canonical link: https://commits.webkit.org/217002@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-30 22:15:17 +00:00
void stopAnimation(SVGElement* targetElement) override;
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
std::optional<float> calculateDistance(const String& fromString, const String& toString) override;
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
Remove the SVG property tear off objects for SVGAnimatedInteger https://bugs.webkit.org/show_bug.cgi?id=195722 Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-03-16 Reviewed by Simon Fraser. Instead of saving a raw integer value in the SVGElement and then wrapping the pointer to this raw data in a tear off object, we will represent the integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the representation of the property in IDL file match the C++ header file. When the DOM requests the SVGAnimatedInteger, we get return a reference to the new animated property. When the rendering code asks for the current value of the this animated property, we return the animVal() or the baseVal() depending on whether the property is animating or not. A pointer to a member in the SVGElement will be registered along with the associated attribute name in SVGPropertyRegistry. Registering the property creates an SVGMemberAccessor and links to the associated attribute. The function of SVGMemberAccessor is to retrieve the value of the property given a pointer to an SVGElement. SVGPropertyRegistry manages all the properties of SVGElement. It takes into account the inherited properties as well. SVGElement will have a virtual method called propertyRegistry(). Every superclass will override this method to return a reference to its registry which includes all the registered properties of this class and its bases. One important function of the SVGPropertyRegistry and SVGAccessor is they create the appropriate SVGAttributeAnimator for this property. SVGAttributeAnimator is just a connection between the animated property and SVGAnimationFunction. SVGAnimationFunction calculates the values of the animated property within a time interval. SVGAnimatedPropertyAnimator updates animVal of the animated property and invalidates the associated SVGElement and all the instances that references this element. The plan is to remove all the SVG tear off objects like what this patch does for SVGAnimatedInteger. So for a period of time the old code and the new code will co-exist together. These things to consider when reviewing this patch: -- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase which is inherited by SVGLegacyAttributeAnimationController and SVGAttributeAnimationController. The tear-off properties code which uses SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The new code was added to SVGAttributeAnimationController. The plan is to remove the three animation controllers and to move the code of SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear off code is removed. -- SVGElement now keeps two registries one for the tear-off world and the other for the new world. Eventually we need to get rid of tear-off registry. -- SVGElement will differentiate between the type of the property by the the method isAnimatedAttribute(). * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::attributeAnimationController): (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists): (WebCore::SVGAnimateElementBase::hasValidAttributeType const): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::isAdditive const): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimation): (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): (WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted. (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElementBase::ensureAnimator): Deleted. * svg/SVGAnimateElementBase.h: * svg/SVGAnimateMotionElement.cpp: (WebCore::SVGAnimateMotionElement::hasValidAttributeType const): (WebCore::SVGAnimateMotionElement::hasValidAttributeName const): (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted. * svg/SVGAnimateMotionElement.h: * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::hasValidAttributeType const): (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted. * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedInteger.cpp: Removed. * svg/SVGAnimatedInteger.h: Removed. * svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed. * svg/SVGAnimatedIntegerOptionalInteger.h: Removed. * svg/SVGAnimatedPointList.h: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::setAttributeType): (WebCore::SVGAnimationElement::resetAnimation): (WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimationElement::setTargetElement): Deleted. (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted. * svg/SVGAnimationElement.h: (WebCore::SVGAnimationElement::attributeType const): (WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted. * svg/SVGAnimatorFactory.h: (WebCore::SVGAnimatorFactory::create): * svg/SVGAttributeAnimationController.cpp: Added. (WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController): (WebCore::SVGAttributeAnimationController::animator const): (WebCore::SVGAttributeAnimationController::isDiscreteAnimator const): (WebCore::SVGAttributeAnimationController::isAdditive const): (WebCore::SVGAttributeAnimationController::hasValidAttributeType const): (WebCore::SVGAttributeAnimationController::calculateFromAndToValues): (WebCore::SVGAttributeAnimationController::calculateFromAndByValues): (WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue): (WebCore::SVGAttributeAnimationController::resetAnimatedType): (WebCore::SVGAttributeAnimationController::calculateAnimatedValue): (WebCore::SVGAttributeAnimationController::applyResultsToTarget): (WebCore::SVGAttributeAnimationController::clearAnimatedType): (WebCore::SVGAttributeAnimationController::calculateDistance): * svg/SVGAttributeAnimationController.h: Added. (WebCore::SVGAttributeAnimationController::animatorIfExists const): * svg/SVGAttributeAnimationControllerBase.cpp: Added. (WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase): (WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType): * svg/SVGAttributeAnimationControllerBase.h: Added. * svg/SVGElement.cpp: (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): (WebCore::SVGElement::commitPropertyChange): (WebCore::SVGElement::isAnimatedPropertyAttribute const): (WebCore::SVGElement::isAnimatedAttribute const): (WebCore::SVGElement::createAnimator): * svg/SVGElement.h: (WebCore::SVGElement::propertyRegistry const): * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): (WebCore::SVGFEConvolveMatrixElement::registerAttributes): (WebCore::SVGFEConvolveMatrixElement::parseAttribute): (WebCore::SVGFEConvolveMatrixElement::setOrder): (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted. (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted. * svg/SVGFEConvolveMatrixElement.h: * svg/SVGFETurbulenceElement.cpp: (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): (WebCore::SVGFETurbulenceElement::registerAttributes): (WebCore::SVGFETurbulenceElement::parseAttribute): (WebCore::SVGFETurbulenceElement::svgAttributeChanged): * svg/SVGFETurbulenceElement.h: * svg/SVGFilterElement.h: * svg/SVGLegacyAttributeAnimationController.cpp: Added. (WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController): (WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator): (WebCore::SVGLegacyAttributeAnimationController::isAdditive const): (WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const): (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues): (WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues): (WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue): (WebCore::propertyTypesAreConsistent): (WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType): (WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget): (WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType): (WebCore::SVGLegacyAttributeAnimationController::calculateDistance): * svg/SVGLegacyAttributeAnimationController.h: Added. * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::hasValidAttributeName const): (WebCore::SVGSMILElement::hasValidAttributeName): Deleted. * svg/animation/SVGSMILElement.h: * svg/properties/SVGAnimatedPrimitiveProperty.h: Added. (WebCore::SVGAnimatedPrimitiveProperty::create): (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal): (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal): (WebCore::SVGAnimatedPrimitiveProperty::baseVal const): (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal): (WebCore::SVGAnimatedPrimitiveProperty::animVal const): (WebCore::SVGAnimatedPrimitiveProperty::animVal): (WebCore::SVGAnimatedPrimitiveProperty::currentValue const): (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty): * svg/properties/SVGAnimatedProperty.cpp: Added. (WebCore::SVGAnimatedProperty::owner const): (WebCore::SVGAnimatedProperty::commitPropertyChange): * svg/properties/SVGAnimatedProperty.h: Added. (WebCore::SVGAnimatedProperty::isAttached const): (WebCore::SVGAnimatedProperty::detach): (WebCore::SVGAnimatedProperty::contextElement const): (WebCore::SVGAnimatedProperty::baseValAsString const): (WebCore::SVGAnimatedProperty::animValAsString const): (WebCore::SVGAnimatedProperty::isDirty const): (WebCore::SVGAnimatedProperty::setDirty): (WebCore::SVGAnimatedProperty::synchronize): (WebCore::SVGAnimatedProperty::isAnimating const): (WebCore::SVGAnimatedProperty::startAnimation): (WebCore::SVGAnimatedProperty::stopAnimation): (WebCore::SVGAnimatedProperty::instanceStartAnimation): (WebCore::SVGAnimatedProperty::instanceStopAnimation): (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): * svg/properties/SVGAnimatedPropertyAccessor.h: Added. * svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added. * svg/properties/SVGAnimatedPropertyAnimator.h: Added. (WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance): (WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator): * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added. * svg/properties/SVGAnimatedPropertyImpl.h: Added. * svg/properties/SVGAnimatedPropertyPairAccessor.h: Added. (WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor): (WebCore::SVGAnimatedPropertyPairAccessor::singleton): (WebCore::SVGAnimatedPropertyPairAccessor::property1 const): (WebCore::SVGAnimatedPropertyPairAccessor::property2 const): * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added. * svg/properties/SVGAnimatedPropertyPairAnimator.h: Added. (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance): (WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator): * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added. * svg/properties/SVGAnimationAdditiveFunction.h: Added. (WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction): (WebCore::SVGAnimationAdditiveFunction::progress): * svg/properties/SVGAnimationAdditiveValueFunction.h: Added. (WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const): * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added. (WebCore::SVGAnimationIntegerFunction::progress): * svg/properties/SVGAnimationFunction.h: Added. (WebCore::SVGAnimationFunction::isDiscrete const): (WebCore::SVGAnimationFunction::calculateDistance const): (WebCore::SVGAnimationFunction::SVGAnimationFunction): (WebCore::SVGAnimationFunction::addFromAndToValues): * svg/properties/SVGAttributeAnimator.cpp: Added. (WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange): * svg/properties/SVGAttributeAnimator.h: Added. (WebCore::SVGAttributeAnimator::SVGAttributeAnimator): (WebCore::SVGAttributeAnimator::isDiscrete const): (WebCore::SVGAttributeAnimator::setFromAndToValues): (WebCore::SVGAttributeAnimator::setFromAndByValues): (WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue): (WebCore::SVGAttributeAnimator::calculateDistance const): * svg/properties/SVGAttributeOwnerProxy.cpp: * svg/properties/SVGAttributeOwnerProxy.h: * svg/properties/SVGAttributeRegistry.h: * svg/properties/SVGMemberAccessor.h: Added. (WebCore::SVGMemberAccessor::detach const): (WebCore::SVGMemberAccessor::isAnimatedProperty const): (WebCore::SVGMemberAccessor::isAnimatedLength const): (WebCore::SVGMemberAccessor::matches const): (WebCore::SVGMemberAccessor::synchronize const): (WebCore::SVGMemberAccessor::createAnimator const): (WebCore::SVGMemberAccessor::appendAnimatedInstance const): * svg/properties/SVGPointerMemberAccessor.h: Added. (WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor): (WebCore::SVGPointerMemberAccessor::property const): (WebCore::SVGPointerMemberAccessor::singleton): * svg/properties/SVGProperty.h: Added. * svg/properties/SVGPropertyOwner.h: Added. (WebCore::SVGPropertyOwner::owner const): (WebCore::SVGPropertyOwner::attributeContextElement const): (WebCore::SVGPropertyOwner::commitPropertyChange): * svg/properties/SVGPropertyOwnerRegistry.h: Added. (WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry): (WebCore::SVGPropertyOwnerRegistry::registerProperty): (WebCore::SVGPropertyOwnerRegistry::enumerateRecursively): (WebCore::SVGPropertyOwnerRegistry::isKnownAttribute): (WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes): (WebCore::SVGPropertyOwnerRegistry::findAccessor): * svg/properties/SVGPropertyRegistry.h: Added. Canonical link: https://commits.webkit.org/210119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-16 07:42:41 +00:00
bool hasInvalidCSSAttributeType() const;
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
Crash when removing the target element while animating its attributes https://bugs.webkit.org/show_bug.cgi?id=202247 Reviewed by Darin Adler. Source/WebCore: If SMIL is animating a CSS attribute, there is a chance the animation is ended while it is being started or progressed. For that reason, the member SVGAnimateElementBase::m_animator has to be made RefPtr and it has to be be protected in resetAnimatedType() and calculateAnimatedValue(). While SMILTimeContainer::updateAnimations() is calling progress() for the scheduled animation elements, SMILTimeContainer::unschedule() might get called if processing an animation causes events to be dispatched. For that reason we need to copy the scheduled animations Vector before processing them so we avoid changing the Vector while looping through its items. Remove the guard SMILTimeContainer::m_preventScheduledAnimationsChanges which was added in r129670 for debugging purposes. In some situations, the scheduled animations map could be modified out from under some of the functions of SMILTimeContainer. Test: svg/animations/animate-and-remove-target-element.html * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): * svg/SVGAnimateElementBase.h: * svg/SVGElement.cpp: (WebCore::SVGElement::createAnimator): * svg/SVGElement.h: * svg/animation/SMILTimeContainer.cpp: (WebCore::SMILTimeContainer::schedule): (WebCore::SMILTimeContainer::unschedule): (WebCore::SMILTimeContainer::setElapsed): (WebCore::SMILTimeContainer::sortByPriority): (WebCore::SMILTimeContainer::processAnimations): (WebCore::SMILTimeContainer::processScheduledAnimations): (WebCore::SMILTimeContainer::updateAnimations): (WebCore::SMILTimeContainer::~SMILTimeContainer): Deleted. * svg/animation/SMILTimeContainer.h: * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::calculateNextProgressTime const): * svg/properties/SVGAnimatedPropertyAccessorImpl.h: * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: * svg/properties/SVGAnimatedPropertyPairAnimator.h: * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: * svg/properties/SVGAttributeAnimator.h: * svg/properties/SVGMemberAccessor.h: (WebCore::SVGMemberAccessor::createAnimator const): * svg/properties/SVGPrimitivePropertyAnimator.h: (WebCore::SVGPrimitivePropertyAnimator::create): * svg/properties/SVGPropertyAnimatorFactory.h: (WebCore::SVGPropertyAnimatorFactory::createAnimator): * svg/properties/SVGPropertyOwnerRegistry.h: * svg/properties/SVGPropertyRegistry.h: * svg/properties/SVGValuePropertyAnimatorImpl.h: * svg/properties/SVGValuePropertyListAnimatorImpl.h: LayoutTests: * svg/animations/animate-and-remove-target-element-expected.txt: Added. * svg/animations/animate-and-remove-target-element.html: Added. Canonical link: https://commits.webkit.org/215889@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-29 05:16:58 +00:00
mutable RefPtr<SVGAttributeAnimator> m_animator;
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
mutable std::optional<bool> m_hasInvalidCSSAttributeType;
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
};
Generalize is<>() / downcast<>() support to all types https://bugs.webkit.org/show_bug.cgi?id=137243 Reviewed by Benjamin Poulain. Generalize is<>() / downcast<>() support to all types, not just Nodes. Source/WebCore: To achieve this, the following changes were made: - Move is<> / downcast<>() and NodeTypeCastTraits from Node.h to a new wtf/TypeCasts.h header. Also move them to WTF namespace instead of WebCore namespace as they can be used for classes in other namespaces (e.g. WebKit namespace). - Rename NodeTypeCastsTraits to TypeCastTraits as it can be specialized for non-Nodes. - Since C++ does not allow template specializations in different namespaces, I had to move all the SPECIALIZE_TYPE_TRAITS_*() uses to the global scope and use the WebCore:: namespace explicitly in those. This is a bit unfortunate but I couldn't find a better way. This patch also takes care of supporting is<>() / downcast<>() for the WorkerGlobalScope class, which does not derive from Node. No new tests, no behavior change. * Modules/indexeddb/IDBFactory.cpp: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: (WebCore::WorkerGlobalScopeIndexedDatabase::from): * Modules/websockets/ThreadableWebSocketChannel.cpp: (WebCore::ThreadableWebSocketChannel::create): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::toJSDOMGlobalObject): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/Attr.h: (isType): (WebCore::isAttr): Deleted. * dom/CDATASection.h: (isType): (WebCore::isCDATASection): Deleted. * dom/CharacterData.h: (isType): (WebCore::isCharacterData): Deleted. * dom/Comment.h: (isType): (WebCore::isComment): Deleted. * dom/Document.h: (isType): (WebCore::isDocument): Deleted. * dom/DocumentFragment.h: (isType): (WebCore::isDocumentFragment): Deleted. * dom/DocumentType.h: (isType): (WebCore::isDocumentType): Deleted. * dom/Element.h: * dom/MessagePort.cpp: (WebCore::MessagePort::dispatchMessages): * dom/Node.h: (WebCore::is): Deleted. (WebCore::downcast): Deleted. * dom/ProcessingInstruction.h: (isType): (WebCore::isProcessingInstruction): Deleted. * dom/PseudoElement.h: (isType): (WebCore::isPseudoElement): Deleted. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): (WebCore::ScriptExecutionContext::vm): * dom/ScriptExecutionContext.h: * dom/ShadowRoot.h: (isType): (WebCore::isShadowRoot): Deleted. * dom/StyledElement.h: (isType): (WebCore::isStyledElement): Deleted. * dom/Text.h: (isType): (WebCore::isText): Deleted. * dom/make_names.pl: (printTypeHelpers): (printTypeHelpersHeaderFile): * html/HTMLDocument.h: (isType): (WebCore::isHTMLDocument): Deleted. * html/HTMLElement.h: (isType): (WebCore::isHTMLElement): Deleted. * html/HTMLFormControlElement.h: (isType): (WebCore::isHTMLFormControlElement): Deleted. * html/HTMLFrameElementBase.h: (isType): (WebCore::isHTMLFrameElementBase): Deleted. * html/HTMLFrameOwnerElement.h: (isType): (WebCore::isHTMLFrameOwnerElement): Deleted. * html/HTMLMediaElement.h: (isType): (WebCore::isHTMLMediaElement): Deleted. * html/HTMLPlugInElement.h: (isType): (WebCore::isHTMLPlugInElement): Deleted. * html/HTMLPlugInImageElement.h: (isType): (WebCore::isHTMLPlugInImageElement): Deleted. * html/HTMLTableCellElement.h: (isType): (WebCore::isHTMLTableCellElement): Deleted. * html/HTMLTableSectionElement.h: (isType): (WebCore::isHTMLTableSectionElement): Deleted. * html/HTMLTextFormControlElement.h: (isType): (WebCore::isHTMLTextFormControlElement): Deleted. * html/ImageDocument.h: (isType): (WebCore::isImageDocument): Deleted. * html/LabelableElement.h: (isType): (WebCore::isLabelableElement): Deleted. * html/MediaDocument.h: (isType): (WebCore::isMediaDocument): Deleted. * html/PluginDocument.h: (isType): (WebCore::isPluginDocument): Deleted. * html/shadow/InsertionPoint.h: (isType): (WebCore::isInsertionPoint): Deleted. * html/shadow/TextControlInnerElements.h: (isType): (WebCore::isTextControlInnerTextElement): Deleted. * html/track/WebVTTElement.h: (isType): (WebCore::isWebVTTElement): Deleted. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext): * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoader::create): (WebCore::ThreadableLoader::loadResourceSynchronously): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeRequestFromCache): (WebCore::MemoryCache::removeRequestFromSessionCaches): * mathml/MathMLElement.h: (isType): (WebCore::isMathMLElement): Deleted. * svg/SVGAnimateElementBase.h: (isType): (WebCore::isSVGAnimateElementBase): Deleted. * svg/SVGDocument.h: (isType): (WebCore::isSVGDocument): Deleted. * svg/SVGElement.h: (isType): (WebCore::isSVGElement): Deleted. * svg/SVGFilterPrimitiveStandardAttributes.h: (isType): (WebCore::isSVGFilterPrimitiveStandardAttributes): Deleted. * svg/SVGGradientElement.h: (isType): (WebCore::isSVGGradientElement): Deleted. * svg/SVGGraphicsElement.h: (isType): (WebCore::isSVGGraphicsElement): Deleted. * svg/SVGPolyElement.h: (isType): (WebCore::isSVGPolyElement): Deleted. * svg/SVGTextContentElement.h: (isType): (WebCore::isSVGTextContentElement): Deleted. * svg/animation/SVGSMILElement.h: (isType): (WebCore::isSVGSMILElement): Deleted. * workers/DefaultSharedWorkerRepository.cpp: (WebCore::SharedWorkerConnectTask::SharedWorkerConnectTask): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::close): * workers/WorkerGlobalScope.h: (isType): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::notifyNetworkStateChange): (WebCore::WorkerMessagingProxy::connectToInspector): (WebCore::WorkerMessagingProxy::disconnectFromInspector): (WebCore::WorkerMessagingProxy::sendMessageToInspector): * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadSynchronously): * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): Source/WebKit/win: * DOMCoreClasses.cpp: (DOMElement::createInstance): Source/WebKit2: * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: (-[WKDOMDocument createElement:]): (-[WKDOMDocument createTextNode:]): (-[WKDOMDocument body]): * WebProcess/InjectedBundle/API/mac/WKDOMText.mm: (-[WKDOMText data]): (-[WKDOMText setData:]): Source/WTF: * wtf/Assertions.h: * wtf/TypeCasts.h: Added. (WTF::is): (WTF::downcast): Canonical link: https://commits.webkit.org/155071@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-30 21:32:55 +00:00
} // namespace WebCore
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SVGAnimateElementBase)
static bool isType(const WebCore::SVGElement& element)
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
{
Generalize is<>() / downcast<>() support to all types https://bugs.webkit.org/show_bug.cgi?id=137243 Reviewed by Benjamin Poulain. Generalize is<>() / downcast<>() support to all types, not just Nodes. Source/WebCore: To achieve this, the following changes were made: - Move is<> / downcast<>() and NodeTypeCastTraits from Node.h to a new wtf/TypeCasts.h header. Also move them to WTF namespace instead of WebCore namespace as they can be used for classes in other namespaces (e.g. WebKit namespace). - Rename NodeTypeCastsTraits to TypeCastTraits as it can be specialized for non-Nodes. - Since C++ does not allow template specializations in different namespaces, I had to move all the SPECIALIZE_TYPE_TRAITS_*() uses to the global scope and use the WebCore:: namespace explicitly in those. This is a bit unfortunate but I couldn't find a better way. This patch also takes care of supporting is<>() / downcast<>() for the WorkerGlobalScope class, which does not derive from Node. No new tests, no behavior change. * Modules/indexeddb/IDBFactory.cpp: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: (WebCore::WorkerGlobalScopeIndexedDatabase::from): * Modules/websockets/ThreadableWebSocketChannel.cpp: (WebCore::ThreadableWebSocketChannel::create): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::toJSDOMGlobalObject): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/Attr.h: (isType): (WebCore::isAttr): Deleted. * dom/CDATASection.h: (isType): (WebCore::isCDATASection): Deleted. * dom/CharacterData.h: (isType): (WebCore::isCharacterData): Deleted. * dom/Comment.h: (isType): (WebCore::isComment): Deleted. * dom/Document.h: (isType): (WebCore::isDocument): Deleted. * dom/DocumentFragment.h: (isType): (WebCore::isDocumentFragment): Deleted. * dom/DocumentType.h: (isType): (WebCore::isDocumentType): Deleted. * dom/Element.h: * dom/MessagePort.cpp: (WebCore::MessagePort::dispatchMessages): * dom/Node.h: (WebCore::is): Deleted. (WebCore::downcast): Deleted. * dom/ProcessingInstruction.h: (isType): (WebCore::isProcessingInstruction): Deleted. * dom/PseudoElement.h: (isType): (WebCore::isPseudoElement): Deleted. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): (WebCore::ScriptExecutionContext::vm): * dom/ScriptExecutionContext.h: * dom/ShadowRoot.h: (isType): (WebCore::isShadowRoot): Deleted. * dom/StyledElement.h: (isType): (WebCore::isStyledElement): Deleted. * dom/Text.h: (isType): (WebCore::isText): Deleted. * dom/make_names.pl: (printTypeHelpers): (printTypeHelpersHeaderFile): * html/HTMLDocument.h: (isType): (WebCore::isHTMLDocument): Deleted. * html/HTMLElement.h: (isType): (WebCore::isHTMLElement): Deleted. * html/HTMLFormControlElement.h: (isType): (WebCore::isHTMLFormControlElement): Deleted. * html/HTMLFrameElementBase.h: (isType): (WebCore::isHTMLFrameElementBase): Deleted. * html/HTMLFrameOwnerElement.h: (isType): (WebCore::isHTMLFrameOwnerElement): Deleted. * html/HTMLMediaElement.h: (isType): (WebCore::isHTMLMediaElement): Deleted. * html/HTMLPlugInElement.h: (isType): (WebCore::isHTMLPlugInElement): Deleted. * html/HTMLPlugInImageElement.h: (isType): (WebCore::isHTMLPlugInImageElement): Deleted. * html/HTMLTableCellElement.h: (isType): (WebCore::isHTMLTableCellElement): Deleted. * html/HTMLTableSectionElement.h: (isType): (WebCore::isHTMLTableSectionElement): Deleted. * html/HTMLTextFormControlElement.h: (isType): (WebCore::isHTMLTextFormControlElement): Deleted. * html/ImageDocument.h: (isType): (WebCore::isImageDocument): Deleted. * html/LabelableElement.h: (isType): (WebCore::isLabelableElement): Deleted. * html/MediaDocument.h: (isType): (WebCore::isMediaDocument): Deleted. * html/PluginDocument.h: (isType): (WebCore::isPluginDocument): Deleted. * html/shadow/InsertionPoint.h: (isType): (WebCore::isInsertionPoint): Deleted. * html/shadow/TextControlInnerElements.h: (isType): (WebCore::isTextControlInnerTextElement): Deleted. * html/track/WebVTTElement.h: (isType): (WebCore::isWebVTTElement): Deleted. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext): * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoader::create): (WebCore::ThreadableLoader::loadResourceSynchronously): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeRequestFromCache): (WebCore::MemoryCache::removeRequestFromSessionCaches): * mathml/MathMLElement.h: (isType): (WebCore::isMathMLElement): Deleted. * svg/SVGAnimateElementBase.h: (isType): (WebCore::isSVGAnimateElementBase): Deleted. * svg/SVGDocument.h: (isType): (WebCore::isSVGDocument): Deleted. * svg/SVGElement.h: (isType): (WebCore::isSVGElement): Deleted. * svg/SVGFilterPrimitiveStandardAttributes.h: (isType): (WebCore::isSVGFilterPrimitiveStandardAttributes): Deleted. * svg/SVGGradientElement.h: (isType): (WebCore::isSVGGradientElement): Deleted. * svg/SVGGraphicsElement.h: (isType): (WebCore::isSVGGraphicsElement): Deleted. * svg/SVGPolyElement.h: (isType): (WebCore::isSVGPolyElement): Deleted. * svg/SVGTextContentElement.h: (isType): (WebCore::isSVGTextContentElement): Deleted. * svg/animation/SVGSMILElement.h: (isType): (WebCore::isSVGSMILElement): Deleted. * workers/DefaultSharedWorkerRepository.cpp: (WebCore::SharedWorkerConnectTask::SharedWorkerConnectTask): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::close): * workers/WorkerGlobalScope.h: (isType): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::notifyNetworkStateChange): (WebCore::WorkerMessagingProxy::connectToInspector): (WebCore::WorkerMessagingProxy::disconnectFromInspector): (WebCore::WorkerMessagingProxy::sendMessageToInspector): * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadSynchronously): * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): Source/WebKit/win: * DOMCoreClasses.cpp: (DOMElement::createInstance): Source/WebKit2: * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: (-[WKDOMDocument createElement:]): (-[WKDOMDocument createTextNode:]): (-[WKDOMDocument body]): * WebProcess/InjectedBundle/API/mac/WKDOMText.mm: (-[WKDOMText data]): (-[WKDOMText setData:]): Source/WTF: * wtf/Assertions.h: * wtf/TypeCasts.h: Added. (WTF::is): (WTF::downcast): Canonical link: https://commits.webkit.org/155071@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-30 21:32:55 +00:00
return element.hasTagName(WebCore::SVGNames::animateTag) || element.hasTagName(WebCore::SVGNames::animateColorTag)
|| element.hasTagName(WebCore::SVGNames::animateTransformTag) || element.hasTagName(WebCore::SVGNames::setTag);
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
}
Generalize is<>() / downcast<>() support to all types https://bugs.webkit.org/show_bug.cgi?id=137243 Reviewed by Benjamin Poulain. Generalize is<>() / downcast<>() support to all types, not just Nodes. Source/WebCore: To achieve this, the following changes were made: - Move is<> / downcast<>() and NodeTypeCastTraits from Node.h to a new wtf/TypeCasts.h header. Also move them to WTF namespace instead of WebCore namespace as they can be used for classes in other namespaces (e.g. WebKit namespace). - Rename NodeTypeCastsTraits to TypeCastTraits as it can be specialized for non-Nodes. - Since C++ does not allow template specializations in different namespaces, I had to move all the SPECIALIZE_TYPE_TRAITS_*() uses to the global scope and use the WebCore:: namespace explicitly in those. This is a bit unfortunate but I couldn't find a better way. This patch also takes care of supporting is<>() / downcast<>() for the WorkerGlobalScope class, which does not derive from Node. No new tests, no behavior change. * Modules/indexeddb/IDBFactory.cpp: * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: (WebCore::WorkerGlobalScopeIndexedDatabase::from): * Modules/websockets/ThreadableWebSocketChannel.cpp: (WebCore::ThreadableWebSocketChannel::create): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::toJSDOMGlobalObject): * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * dom/Attr.h: (isType): (WebCore::isAttr): Deleted. * dom/CDATASection.h: (isType): (WebCore::isCDATASection): Deleted. * dom/CharacterData.h: (isType): (WebCore::isCharacterData): Deleted. * dom/Comment.h: (isType): (WebCore::isComment): Deleted. * dom/Document.h: (isType): (WebCore::isDocument): Deleted. * dom/DocumentFragment.h: (isType): (WebCore::isDocumentFragment): Deleted. * dom/DocumentType.h: (isType): (WebCore::isDocumentType): Deleted. * dom/Element.h: * dom/MessagePort.cpp: (WebCore::MessagePort::dispatchMessages): * dom/Node.h: (WebCore::is): Deleted. (WebCore::downcast): Deleted. * dom/ProcessingInstruction.h: (isType): (WebCore::isProcessingInstruction): Deleted. * dom/PseudoElement.h: (isType): (WebCore::isPseudoElement): Deleted. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::createdMessagePort): (WebCore::ScriptExecutionContext::destroyedMessagePort): (WebCore::ScriptExecutionContext::vm): * dom/ScriptExecutionContext.h: * dom/ShadowRoot.h: (isType): (WebCore::isShadowRoot): Deleted. * dom/StyledElement.h: (isType): (WebCore::isStyledElement): Deleted. * dom/Text.h: (isType): (WebCore::isText): Deleted. * dom/make_names.pl: (printTypeHelpers): (printTypeHelpersHeaderFile): * html/HTMLDocument.h: (isType): (WebCore::isHTMLDocument): Deleted. * html/HTMLElement.h: (isType): (WebCore::isHTMLElement): Deleted. * html/HTMLFormControlElement.h: (isType): (WebCore::isHTMLFormControlElement): Deleted. * html/HTMLFrameElementBase.h: (isType): (WebCore::isHTMLFrameElementBase): Deleted. * html/HTMLFrameOwnerElement.h: (isType): (WebCore::isHTMLFrameOwnerElement): Deleted. * html/HTMLMediaElement.h: (isType): (WebCore::isHTMLMediaElement): Deleted. * html/HTMLPlugInElement.h: (isType): (WebCore::isHTMLPlugInElement): Deleted. * html/HTMLPlugInImageElement.h: (isType): (WebCore::isHTMLPlugInImageElement): Deleted. * html/HTMLTableCellElement.h: (isType): (WebCore::isHTMLTableCellElement): Deleted. * html/HTMLTableSectionElement.h: (isType): (WebCore::isHTMLTableSectionElement): Deleted. * html/HTMLTextFormControlElement.h: (isType): (WebCore::isHTMLTextFormControlElement): Deleted. * html/ImageDocument.h: (isType): (WebCore::isImageDocument): Deleted. * html/LabelableElement.h: (isType): (WebCore::isLabelableElement): Deleted. * html/MediaDocument.h: (isType): (WebCore::isMediaDocument): Deleted. * html/PluginDocument.h: (isType): (WebCore::isPluginDocument): Deleted. * html/shadow/InsertionPoint.h: (isType): (WebCore::isInsertionPoint): Deleted. * html/shadow/TextControlInnerElements.h: (isType): (WebCore::isTextControlInnerTextElement): Deleted. * html/track/WebVTTElement.h: (isType): (WebCore::isWebVTTElement): Deleted. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext): * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoader::create): (WebCore::ThreadableLoader::loadResourceSynchronously): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::removeRequestFromCache): (WebCore::MemoryCache::removeRequestFromSessionCaches): * mathml/MathMLElement.h: (isType): (WebCore::isMathMLElement): Deleted. * svg/SVGAnimateElementBase.h: (isType): (WebCore::isSVGAnimateElementBase): Deleted. * svg/SVGDocument.h: (isType): (WebCore::isSVGDocument): Deleted. * svg/SVGElement.h: (isType): (WebCore::isSVGElement): Deleted. * svg/SVGFilterPrimitiveStandardAttributes.h: (isType): (WebCore::isSVGFilterPrimitiveStandardAttributes): Deleted. * svg/SVGGradientElement.h: (isType): (WebCore::isSVGGradientElement): Deleted. * svg/SVGGraphicsElement.h: (isType): (WebCore::isSVGGraphicsElement): Deleted. * svg/SVGPolyElement.h: (isType): (WebCore::isSVGPolyElement): Deleted. * svg/SVGTextContentElement.h: (isType): (WebCore::isSVGTextContentElement): Deleted. * svg/animation/SVGSMILElement.h: (isType): (WebCore::isSVGSMILElement): Deleted. * workers/DefaultSharedWorkerRepository.cpp: (WebCore::SharedWorkerConnectTask::SharedWorkerConnectTask): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::close): * workers/WorkerGlobalScope.h: (isType): * workers/WorkerMessagingProxy.cpp: (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::~WorkerMessagingProxy): (WebCore::WorkerMessagingProxy::notifyNetworkStateChange): (WebCore::WorkerMessagingProxy::connectToInspector): (WebCore::WorkerMessagingProxy::disconnectFromInspector): (WebCore::WorkerMessagingProxy::sendMessageToInspector): * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::loadSynchronously): * workers/WorkerThread.cpp: (WebCore::WorkerThread::stop): Source/WebKit/win: * DOMCoreClasses.cpp: (DOMElement::createInstance): Source/WebKit2: * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm: (-[WKDOMDocument createElement:]): (-[WKDOMDocument createTextNode:]): (-[WKDOMDocument body]): * WebProcess/InjectedBundle/API/mac/WKDOMText.mm: (-[WKDOMText data]): (-[WKDOMText setData:]): Source/WTF: * wtf/Assertions.h: * wtf/TypeCasts.h: Added. (WTF::is): (WTF::downcast): Canonical link: https://commits.webkit.org/155071@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-30 21:32:55 +00:00
static bool isType(const WebCore::Node& node) { return is<WebCore::SVGElement>(node) && isType(downcast<WebCore::SVGElement>(node)); }
Automatically generate template specializations for most Elements https://bugs.webkit.org/show_bug.cgi?id=137174 Reviewed by Darin Adler. Previously, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements were only generated if "generateTypeHelpers" parameter was explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so this patch drops the "generateTypeHelpers" parameter and generates those template specializations by default. One case we cannot generate the specialization ifor is when a class is associated to several tag names but this patch updates the make_names.pl script to detect this and skip those classes. No new tests, no behavior change. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * dom/make_names.pl: (defaultTagPropertyHash): (printTypeHelpers): * html/HTMLTagNames.in: * mathml/mathtags.in: * svg/SVGAllInOne.cpp: * svg/SVGAnimateColorElement.cpp: (WebCore::SVGAnimateColorElement::SVGAnimateColorElement): (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): * svg/SVGAnimateColorElement.h: * svg/SVGAnimateElement.cpp: (WebCore::SVGAnimateElement::SVGAnimateElement): (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted. (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted. (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted. (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted. (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted. (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted. (WebCore::propertyTypesAreConsistent): Deleted. (WebCore::SVGAnimateElement::resetAnimatedType): Deleted. (WebCore::applyCSSPropertyToTarget): Deleted. (WebCore::removeCSSPropertyFromTarget): Deleted. (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. (WebCore::notifyTargetAboutAnimValChange): Deleted. (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. (WebCore::SVGAnimateElement::clearAnimatedType): Deleted. (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted. (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted. (WebCore::SVGAnimateElement::isAdditive): Deleted. (WebCore::SVGAnimateElement::calculateDistance): Deleted. (WebCore::SVGAnimateElement::setTargetElement): Deleted. (WebCore::SVGAnimateElement::setAttributeName): Deleted. (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted. (WebCore::SVGAnimateElement::ensureAnimator): Deleted. * svg/SVGAnimateElement.h: (WebCore::isSVGAnimateElement): Deleted. * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp. (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase): (WebCore::SVGAnimateElementBase::hasValidAttributeType): (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType): (WebCore::SVGAnimateElementBase::calculateAnimatedValue): (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): (WebCore::SVGAnimateElementBase::calculateFromAndToValues): (WebCore::SVGAnimateElementBase::calculateFromAndByValues): (WebCore::propertyTypesAreConsistent): (WebCore::SVGAnimateElementBase::resetAnimatedType): (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): (WebCore::applyCSSPropertyToTargetAndInstances): (WebCore::removeCSSPropertyFromTargetAndInstances): (WebCore::notifyTargetAboutAnimValChange): (WebCore::notifyTargetAndInstancesAboutAnimValChange): (WebCore::SVGAnimateElementBase::clearAnimatedType): (WebCore::SVGAnimateElementBase::applyResultsToTarget): (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition): (WebCore::SVGAnimateElementBase::isAdditive): (WebCore::SVGAnimateElementBase::calculateDistance): (WebCore::SVGAnimateElementBase::setTargetElement): (WebCore::SVGAnimateElementBase::setAttributeName): (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): (WebCore::SVGAnimateElementBase::ensureAnimator): * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h. (WebCore::isSVGAnimateElementBase): * svg/SVGAnimateTransformElement.cpp: (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement): (WebCore::SVGAnimateTransformElement::parseAttribute): * svg/SVGAnimateTransformElement.h: * svg/SVGAnimatedAngle.cpp: * svg/SVGAnimatedBoolean.cpp: * svg/SVGAnimatedColor.cpp: * svg/SVGAnimatedInteger.cpp: * svg/SVGAnimatedIntegerOptionalInteger.cpp: * svg/SVGAnimatedLength.cpp: * svg/SVGAnimatedLengthList.cpp: * svg/SVGAnimatedNumber.cpp: * svg/SVGAnimatedNumberList.cpp: * svg/SVGAnimatedNumberOptionalNumber.cpp: * svg/SVGAnimatedPath.cpp: * svg/SVGAnimatedPointList.cpp: * svg/SVGAnimatedPreserveAspectRatio.cpp: * svg/SVGAnimatedRect.cpp: * svg/SVGAnimatedString.cpp: * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): * svg/SVGSetElement.cpp: (WebCore::SVGSetElement::SVGSetElement): * svg/SVGSetElement.h: * svg/svgtags.in: Canonical link: https://commits.webkit.org/154997@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-29 02:13:41 +00:00
SPECIALIZE_TYPE_TRAITS_END()