gecko/dom/svg/nsSVGElement.cpp
Birunthan Mohanathas 1dcfd79ff9 Bug 946065 - Part 9: Move content/svg/ to dom/ and flatten subdirectories. r=jwatt
--HG--
rename : content/svg/content/src/DOMSVGAnimatedLengthList.cpp => dom/svg/DOMSVGAnimatedLengthList.cpp
rename : content/svg/content/src/DOMSVGAnimatedLengthList.h => dom/svg/DOMSVGAnimatedLengthList.h
rename : content/svg/content/src/DOMSVGAnimatedNumberList.cpp => dom/svg/DOMSVGAnimatedNumberList.cpp
rename : content/svg/content/src/DOMSVGAnimatedNumberList.h => dom/svg/DOMSVGAnimatedNumberList.h
rename : content/svg/content/src/DOMSVGLength.cpp => dom/svg/DOMSVGLength.cpp
rename : content/svg/content/src/DOMSVGLength.h => dom/svg/DOMSVGLength.h
rename : content/svg/content/src/DOMSVGLengthList.cpp => dom/svg/DOMSVGLengthList.cpp
rename : content/svg/content/src/DOMSVGLengthList.h => dom/svg/DOMSVGLengthList.h
rename : content/svg/content/src/DOMSVGNumber.cpp => dom/svg/DOMSVGNumber.cpp
rename : content/svg/content/src/DOMSVGNumber.h => dom/svg/DOMSVGNumber.h
rename : content/svg/content/src/DOMSVGNumberList.cpp => dom/svg/DOMSVGNumberList.cpp
rename : content/svg/content/src/DOMSVGNumberList.h => dom/svg/DOMSVGNumberList.h
rename : content/svg/content/src/DOMSVGPathSeg.cpp => dom/svg/DOMSVGPathSeg.cpp
rename : content/svg/content/src/DOMSVGPathSeg.h => dom/svg/DOMSVGPathSeg.h
rename : content/svg/content/src/DOMSVGPathSegList.cpp => dom/svg/DOMSVGPathSegList.cpp
rename : content/svg/content/src/DOMSVGPathSegList.h => dom/svg/DOMSVGPathSegList.h
rename : content/svg/content/src/DOMSVGPoint.cpp => dom/svg/DOMSVGPoint.cpp
rename : content/svg/content/src/DOMSVGPoint.h => dom/svg/DOMSVGPoint.h
rename : content/svg/content/src/DOMSVGPointList.cpp => dom/svg/DOMSVGPointList.cpp
rename : content/svg/content/src/DOMSVGPointList.h => dom/svg/DOMSVGPointList.h
rename : content/svg/content/src/DOMSVGStringList.cpp => dom/svg/DOMSVGStringList.cpp
rename : content/svg/content/src/DOMSVGStringList.h => dom/svg/DOMSVGStringList.h
rename : content/svg/content/src/DOMSVGTransformList.cpp => dom/svg/DOMSVGTransformList.cpp
rename : content/svg/content/src/DOMSVGTransformList.h => dom/svg/DOMSVGTransformList.h
rename : content/svg/content/src/SVGAElement.cpp => dom/svg/SVGAElement.cpp
rename : content/svg/content/src/SVGAElement.h => dom/svg/SVGAElement.h
rename : content/svg/content/src/SVGAltGlyphElement.cpp => dom/svg/SVGAltGlyphElement.cpp
rename : content/svg/content/src/SVGAltGlyphElement.h => dom/svg/SVGAltGlyphElement.h
rename : content/svg/content/src/SVGAngle.cpp => dom/svg/SVGAngle.cpp
rename : content/svg/content/src/SVGAngle.h => dom/svg/SVGAngle.h
rename : content/svg/content/src/SVGAnimateElement.cpp => dom/svg/SVGAnimateElement.cpp
rename : content/svg/content/src/SVGAnimateElement.h => dom/svg/SVGAnimateElement.h
rename : content/svg/content/src/SVGAnimateMotionElement.cpp => dom/svg/SVGAnimateMotionElement.cpp
rename : content/svg/content/src/SVGAnimateMotionElement.h => dom/svg/SVGAnimateMotionElement.h
rename : content/svg/content/src/SVGAnimateTransformElement.cpp => dom/svg/SVGAnimateTransformElement.cpp
rename : content/svg/content/src/SVGAnimateTransformElement.h => dom/svg/SVGAnimateTransformElement.h
rename : content/svg/content/src/SVGAnimatedAngle.cpp => dom/svg/SVGAnimatedAngle.cpp
rename : content/svg/content/src/SVGAnimatedAngle.h => dom/svg/SVGAnimatedAngle.h
rename : content/svg/content/src/SVGAnimatedBoolean.cpp => dom/svg/SVGAnimatedBoolean.cpp
rename : content/svg/content/src/SVGAnimatedBoolean.h => dom/svg/SVGAnimatedBoolean.h
rename : content/svg/content/src/SVGAnimatedEnumeration.cpp => dom/svg/SVGAnimatedEnumeration.cpp
rename : content/svg/content/src/SVGAnimatedEnumeration.h => dom/svg/SVGAnimatedEnumeration.h
rename : content/svg/content/src/SVGAnimatedInteger.cpp => dom/svg/SVGAnimatedInteger.cpp
rename : content/svg/content/src/SVGAnimatedInteger.h => dom/svg/SVGAnimatedInteger.h
rename : content/svg/content/src/SVGAnimatedLength.cpp => dom/svg/SVGAnimatedLength.cpp
rename : content/svg/content/src/SVGAnimatedLength.h => dom/svg/SVGAnimatedLength.h
rename : content/svg/content/src/SVGAnimatedLengthList.cpp => dom/svg/SVGAnimatedLengthList.cpp
rename : content/svg/content/src/SVGAnimatedLengthList.h => dom/svg/SVGAnimatedLengthList.h
rename : content/svg/content/src/SVGAnimatedNumber.cpp => dom/svg/SVGAnimatedNumber.cpp
rename : content/svg/content/src/SVGAnimatedNumber.h => dom/svg/SVGAnimatedNumber.h
rename : content/svg/content/src/SVGAnimatedNumberList.cpp => dom/svg/SVGAnimatedNumberList.cpp
rename : content/svg/content/src/SVGAnimatedNumberList.h => dom/svg/SVGAnimatedNumberList.h
rename : content/svg/content/src/SVGAnimatedPathSegList.cpp => dom/svg/SVGAnimatedPathSegList.cpp
rename : content/svg/content/src/SVGAnimatedPathSegList.h => dom/svg/SVGAnimatedPathSegList.h
rename : content/svg/content/src/SVGAnimatedPointList.cpp => dom/svg/SVGAnimatedPointList.cpp
rename : content/svg/content/src/SVGAnimatedPointList.h => dom/svg/SVGAnimatedPointList.h
rename : content/svg/content/src/SVGAnimatedPreserveAspectRatio.cpp => dom/svg/SVGAnimatedPreserveAspectRatio.cpp
rename : content/svg/content/src/SVGAnimatedPreserveAspectRatio.h => dom/svg/SVGAnimatedPreserveAspectRatio.h
rename : content/svg/content/src/SVGAnimatedRect.cpp => dom/svg/SVGAnimatedRect.cpp
rename : content/svg/content/src/SVGAnimatedRect.h => dom/svg/SVGAnimatedRect.h
rename : content/svg/content/src/SVGAnimatedString.cpp => dom/svg/SVGAnimatedString.cpp
rename : content/svg/content/src/SVGAnimatedString.h => dom/svg/SVGAnimatedString.h
rename : content/svg/content/src/SVGAnimatedTransformList.cpp => dom/svg/SVGAnimatedTransformList.cpp
rename : content/svg/content/src/SVGAnimatedTransformList.h => dom/svg/SVGAnimatedTransformList.h
rename : content/svg/content/src/SVGAnimationElement.cpp => dom/svg/SVGAnimationElement.cpp
rename : content/svg/content/src/SVGAnimationElement.h => dom/svg/SVGAnimationElement.h
rename : content/svg/content/src/SVGAttrValueWrapper.cpp => dom/svg/SVGAttrValueWrapper.cpp
rename : content/svg/content/src/SVGAttrValueWrapper.h => dom/svg/SVGAttrValueWrapper.h
rename : content/svg/content/src/SVGCircleElement.cpp => dom/svg/SVGCircleElement.cpp
rename : content/svg/content/src/SVGCircleElement.h => dom/svg/SVGCircleElement.h
rename : content/svg/content/src/SVGClipPathElement.cpp => dom/svg/SVGClipPathElement.cpp
rename : content/svg/content/src/SVGClipPathElement.h => dom/svg/SVGClipPathElement.h
rename : content/svg/content/src/SVGComponentTransferFunctionElement.h => dom/svg/SVGComponentTransferFunctionElement.h
rename : content/svg/content/src/SVGContentUtils.cpp => dom/svg/SVGContentUtils.cpp
rename : content/svg/content/src/SVGContentUtils.h => dom/svg/SVGContentUtils.h
rename : content/svg/content/src/SVGDefsElement.cpp => dom/svg/SVGDefsElement.cpp
rename : content/svg/content/src/SVGDefsElement.h => dom/svg/SVGDefsElement.h
rename : content/svg/content/src/SVGDescElement.cpp => dom/svg/SVGDescElement.cpp
rename : content/svg/content/src/SVGDescElement.h => dom/svg/SVGDescElement.h
rename : content/svg/document/src/SVGDocument.cpp => dom/svg/SVGDocument.cpp
rename : content/svg/document/src/SVGDocument.h => dom/svg/SVGDocument.h
rename : content/svg/content/src/SVGElementFactory.cpp => dom/svg/SVGElementFactory.cpp
rename : content/svg/content/src/SVGElementFactory.h => dom/svg/SVGElementFactory.h
rename : content/svg/content/src/SVGEllipseElement.cpp => dom/svg/SVGEllipseElement.cpp
rename : content/svg/content/src/SVGEllipseElement.h => dom/svg/SVGEllipseElement.h
rename : content/svg/content/src/SVGFEBlendElement.cpp => dom/svg/SVGFEBlendElement.cpp
rename : content/svg/content/src/SVGFEBlendElement.h => dom/svg/SVGFEBlendElement.h
rename : content/svg/content/src/SVGFEColorMatrixElement.cpp => dom/svg/SVGFEColorMatrixElement.cpp
rename : content/svg/content/src/SVGFEColorMatrixElement.h => dom/svg/SVGFEColorMatrixElement.h
rename : content/svg/content/src/SVGFEComponentTransferElement.cpp => dom/svg/SVGFEComponentTransferElement.cpp
rename : content/svg/content/src/SVGFEComponentTransferElement.h => dom/svg/SVGFEComponentTransferElement.h
rename : content/svg/content/src/SVGFECompositeElement.cpp => dom/svg/SVGFECompositeElement.cpp
rename : content/svg/content/src/SVGFECompositeElement.h => dom/svg/SVGFECompositeElement.h
rename : content/svg/content/src/SVGFEConvolveMatrixElement.cpp => dom/svg/SVGFEConvolveMatrixElement.cpp
rename : content/svg/content/src/SVGFEConvolveMatrixElement.h => dom/svg/SVGFEConvolveMatrixElement.h
rename : content/svg/content/src/SVGFEDiffuseLightingElement.cpp => dom/svg/SVGFEDiffuseLightingElement.cpp
rename : content/svg/content/src/SVGFEDiffuseLightingElement.h => dom/svg/SVGFEDiffuseLightingElement.h
rename : content/svg/content/src/SVGFEDisplacementMapElement.cpp => dom/svg/SVGFEDisplacementMapElement.cpp
rename : content/svg/content/src/SVGFEDisplacementMapElement.h => dom/svg/SVGFEDisplacementMapElement.h
rename : content/svg/content/src/SVGFEDistantLightElement.cpp => dom/svg/SVGFEDistantLightElement.cpp
rename : content/svg/content/src/SVGFEDistantLightElement.h => dom/svg/SVGFEDistantLightElement.h
rename : content/svg/content/src/SVGFEDropShadowElement.cpp => dom/svg/SVGFEDropShadowElement.cpp
rename : content/svg/content/src/SVGFEDropShadowElement.h => dom/svg/SVGFEDropShadowElement.h
rename : content/svg/content/src/SVGFEFloodElement.cpp => dom/svg/SVGFEFloodElement.cpp
rename : content/svg/content/src/SVGFEFloodElement.h => dom/svg/SVGFEFloodElement.h
rename : content/svg/content/src/SVGFEGaussianBlurElement.cpp => dom/svg/SVGFEGaussianBlurElement.cpp
rename : content/svg/content/src/SVGFEGaussianBlurElement.h => dom/svg/SVGFEGaussianBlurElement.h
rename : content/svg/content/src/SVGFEImageElement.cpp => dom/svg/SVGFEImageElement.cpp
rename : content/svg/content/src/SVGFEImageElement.h => dom/svg/SVGFEImageElement.h
rename : content/svg/content/src/SVGFEMergeElement.cpp => dom/svg/SVGFEMergeElement.cpp
rename : content/svg/content/src/SVGFEMergeElement.h => dom/svg/SVGFEMergeElement.h
rename : content/svg/content/src/SVGFEMergeNodeElement.cpp => dom/svg/SVGFEMergeNodeElement.cpp
rename : content/svg/content/src/SVGFEMergeNodeElement.h => dom/svg/SVGFEMergeNodeElement.h
rename : content/svg/content/src/SVGFEMorphologyElement.cpp => dom/svg/SVGFEMorphologyElement.cpp
rename : content/svg/content/src/SVGFEMorphologyElement.h => dom/svg/SVGFEMorphologyElement.h
rename : content/svg/content/src/SVGFEOffsetElement.cpp => dom/svg/SVGFEOffsetElement.cpp
rename : content/svg/content/src/SVGFEOffsetElement.h => dom/svg/SVGFEOffsetElement.h
rename : content/svg/content/src/SVGFEPointLightElement.cpp => dom/svg/SVGFEPointLightElement.cpp
rename : content/svg/content/src/SVGFEPointLightElement.h => dom/svg/SVGFEPointLightElement.h
rename : content/svg/content/src/SVGFESpecularLightingElement.cpp => dom/svg/SVGFESpecularLightingElement.cpp
rename : content/svg/content/src/SVGFESpecularLightingElement.h => dom/svg/SVGFESpecularLightingElement.h
rename : content/svg/content/src/SVGFESpotLightElement.cpp => dom/svg/SVGFESpotLightElement.cpp
rename : content/svg/content/src/SVGFESpotLightElement.h => dom/svg/SVGFESpotLightElement.h
rename : content/svg/content/src/SVGFETileElement.cpp => dom/svg/SVGFETileElement.cpp
rename : content/svg/content/src/SVGFETileElement.h => dom/svg/SVGFETileElement.h
rename : content/svg/content/src/SVGFETurbulenceElement.cpp => dom/svg/SVGFETurbulenceElement.cpp
rename : content/svg/content/src/SVGFETurbulenceElement.h => dom/svg/SVGFETurbulenceElement.h
rename : content/svg/content/src/SVGFilterElement.cpp => dom/svg/SVGFilterElement.cpp
rename : content/svg/content/src/SVGFilterElement.h => dom/svg/SVGFilterElement.h
rename : content/svg/content/src/SVGForeignObjectElement.cpp => dom/svg/SVGForeignObjectElement.cpp
rename : content/svg/content/src/SVGForeignObjectElement.h => dom/svg/SVGForeignObjectElement.h
rename : content/svg/content/src/SVGFragmentIdentifier.cpp => dom/svg/SVGFragmentIdentifier.cpp
rename : content/svg/content/src/SVGFragmentIdentifier.h => dom/svg/SVGFragmentIdentifier.h
rename : content/svg/content/src/SVGGElement.cpp => dom/svg/SVGGElement.cpp
rename : content/svg/content/src/SVGGElement.h => dom/svg/SVGGElement.h
rename : content/svg/content/src/SVGGradientElement.cpp => dom/svg/SVGGradientElement.cpp
rename : content/svg/content/src/SVGGradientElement.h => dom/svg/SVGGradientElement.h
rename : content/svg/content/src/SVGGraphicsElement.cpp => dom/svg/SVGGraphicsElement.cpp
rename : content/svg/content/src/SVGGraphicsElement.h => dom/svg/SVGGraphicsElement.h
rename : content/svg/content/src/SVGIFrameElement.cpp => dom/svg/SVGIFrameElement.cpp
rename : content/svg/content/src/SVGIFrameElement.h => dom/svg/SVGIFrameElement.h
rename : content/svg/content/src/SVGIRect.h => dom/svg/SVGIRect.h
rename : content/svg/content/src/SVGImageElement.cpp => dom/svg/SVGImageElement.cpp
rename : content/svg/content/src/SVGImageElement.h => dom/svg/SVGImageElement.h
rename : content/svg/content/src/SVGIntegerPairSMILType.cpp => dom/svg/SVGIntegerPairSMILType.cpp
rename : content/svg/content/src/SVGIntegerPairSMILType.h => dom/svg/SVGIntegerPairSMILType.h
rename : content/svg/content/src/SVGLength.cpp => dom/svg/SVGLength.cpp
rename : content/svg/content/src/SVGLength.h => dom/svg/SVGLength.h
rename : content/svg/content/src/SVGLengthList.cpp => dom/svg/SVGLengthList.cpp
rename : content/svg/content/src/SVGLengthList.h => dom/svg/SVGLengthList.h
rename : content/svg/content/src/SVGLengthListSMILType.cpp => dom/svg/SVGLengthListSMILType.cpp
rename : content/svg/content/src/SVGLengthListSMILType.h => dom/svg/SVGLengthListSMILType.h
rename : content/svg/content/src/SVGLineElement.cpp => dom/svg/SVGLineElement.cpp
rename : content/svg/content/src/SVGLineElement.h => dom/svg/SVGLineElement.h
rename : content/svg/content/src/SVGMPathElement.cpp => dom/svg/SVGMPathElement.cpp
rename : content/svg/content/src/SVGMPathElement.h => dom/svg/SVGMPathElement.h
rename : content/svg/content/src/SVGMarkerElement.cpp => dom/svg/SVGMarkerElement.cpp
rename : content/svg/content/src/SVGMarkerElement.h => dom/svg/SVGMarkerElement.h
rename : content/svg/content/src/SVGMaskElement.cpp => dom/svg/SVGMaskElement.cpp
rename : content/svg/content/src/SVGMaskElement.h => dom/svg/SVGMaskElement.h
rename : content/svg/content/src/SVGMatrix.cpp => dom/svg/SVGMatrix.cpp
rename : content/svg/content/src/SVGMatrix.h => dom/svg/SVGMatrix.h
rename : content/svg/content/src/SVGMetadataElement.cpp => dom/svg/SVGMetadataElement.cpp
rename : content/svg/content/src/SVGMetadataElement.h => dom/svg/SVGMetadataElement.h
rename : content/svg/content/src/SVGMotionSMILAnimationFunction.cpp => dom/svg/SVGMotionSMILAnimationFunction.cpp
rename : content/svg/content/src/SVGMotionSMILAnimationFunction.h => dom/svg/SVGMotionSMILAnimationFunction.h
rename : content/svg/content/src/SVGMotionSMILAttr.cpp => dom/svg/SVGMotionSMILAttr.cpp
rename : content/svg/content/src/SVGMotionSMILAttr.h => dom/svg/SVGMotionSMILAttr.h
rename : content/svg/content/src/SVGMotionSMILPathUtils.cpp => dom/svg/SVGMotionSMILPathUtils.cpp
rename : content/svg/content/src/SVGMotionSMILPathUtils.h => dom/svg/SVGMotionSMILPathUtils.h
rename : content/svg/content/src/SVGMotionSMILType.cpp => dom/svg/SVGMotionSMILType.cpp
rename : content/svg/content/src/SVGMotionSMILType.h => dom/svg/SVGMotionSMILType.h
rename : content/svg/content/src/SVGNumberList.cpp => dom/svg/SVGNumberList.cpp
rename : content/svg/content/src/SVGNumberList.h => dom/svg/SVGNumberList.h
rename : content/svg/content/src/SVGNumberListSMILType.cpp => dom/svg/SVGNumberListSMILType.cpp
rename : content/svg/content/src/SVGNumberListSMILType.h => dom/svg/SVGNumberListSMILType.h
rename : content/svg/content/src/SVGNumberPairSMILType.cpp => dom/svg/SVGNumberPairSMILType.cpp
rename : content/svg/content/src/SVGNumberPairSMILType.h => dom/svg/SVGNumberPairSMILType.h
rename : content/svg/content/src/SVGOrientSMILType.cpp => dom/svg/SVGOrientSMILType.cpp
rename : content/svg/content/src/SVGOrientSMILType.h => dom/svg/SVGOrientSMILType.h
rename : content/svg/content/src/SVGPathData.cpp => dom/svg/SVGPathData.cpp
rename : content/svg/content/src/SVGPathData.h => dom/svg/SVGPathData.h
rename : content/svg/content/src/SVGPathElement.cpp => dom/svg/SVGPathElement.cpp
rename : content/svg/content/src/SVGPathElement.h => dom/svg/SVGPathElement.h
rename : content/svg/content/src/SVGPathSegListSMILType.cpp => dom/svg/SVGPathSegListSMILType.cpp
rename : content/svg/content/src/SVGPathSegListSMILType.h => dom/svg/SVGPathSegListSMILType.h
rename : content/svg/content/src/SVGPathSegUtils.cpp => dom/svg/SVGPathSegUtils.cpp
rename : content/svg/content/src/SVGPathSegUtils.h => dom/svg/SVGPathSegUtils.h
rename : content/svg/content/src/SVGPatternElement.cpp => dom/svg/SVGPatternElement.cpp
rename : content/svg/content/src/SVGPatternElement.h => dom/svg/SVGPatternElement.h
rename : content/svg/content/src/SVGPoint.h => dom/svg/SVGPoint.h
rename : content/svg/content/src/SVGPointList.cpp => dom/svg/SVGPointList.cpp
rename : content/svg/content/src/SVGPointList.h => dom/svg/SVGPointList.h
rename : content/svg/content/src/SVGPointListSMILType.cpp => dom/svg/SVGPointListSMILType.cpp
rename : content/svg/content/src/SVGPointListSMILType.h => dom/svg/SVGPointListSMILType.h
rename : content/svg/content/src/SVGPolygonElement.cpp => dom/svg/SVGPolygonElement.cpp
rename : content/svg/content/src/SVGPolygonElement.h => dom/svg/SVGPolygonElement.h
rename : content/svg/content/src/SVGPolylineElement.cpp => dom/svg/SVGPolylineElement.cpp
rename : content/svg/content/src/SVGPolylineElement.h => dom/svg/SVGPolylineElement.h
rename : content/svg/content/src/SVGPreserveAspectRatio.cpp => dom/svg/SVGPreserveAspectRatio.cpp
rename : content/svg/content/src/SVGPreserveAspectRatio.h => dom/svg/SVGPreserveAspectRatio.h
rename : content/svg/content/src/SVGRect.cpp => dom/svg/SVGRect.cpp
rename : content/svg/content/src/SVGRect.h => dom/svg/SVGRect.h
rename : content/svg/content/src/SVGRectElement.cpp => dom/svg/SVGRectElement.cpp
rename : content/svg/content/src/SVGRectElement.h => dom/svg/SVGRectElement.h
rename : content/svg/content/src/SVGSVGElement.cpp => dom/svg/SVGSVGElement.cpp
rename : content/svg/content/src/SVGSVGElement.h => dom/svg/SVGSVGElement.h
rename : content/svg/content/src/SVGScriptElement.cpp => dom/svg/SVGScriptElement.cpp
rename : content/svg/content/src/SVGScriptElement.h => dom/svg/SVGScriptElement.h
rename : content/svg/content/src/SVGSetElement.cpp => dom/svg/SVGSetElement.cpp
rename : content/svg/content/src/SVGSetElement.h => dom/svg/SVGSetElement.h
rename : content/svg/content/src/SVGStopElement.cpp => dom/svg/SVGStopElement.cpp
rename : content/svg/content/src/SVGStopElement.h => dom/svg/SVGStopElement.h
rename : content/svg/content/src/SVGStringList.cpp => dom/svg/SVGStringList.cpp
rename : content/svg/content/src/SVGStringList.h => dom/svg/SVGStringList.h
rename : content/svg/content/src/SVGStyleElement.cpp => dom/svg/SVGStyleElement.cpp
rename : content/svg/content/src/SVGStyleElement.h => dom/svg/SVGStyleElement.h
rename : content/svg/content/src/SVGSwitchElement.cpp => dom/svg/SVGSwitchElement.cpp
rename : content/svg/content/src/SVGSwitchElement.h => dom/svg/SVGSwitchElement.h
rename : content/svg/content/src/SVGSymbolElement.cpp => dom/svg/SVGSymbolElement.cpp
rename : content/svg/content/src/SVGSymbolElement.h => dom/svg/SVGSymbolElement.h
rename : content/svg/content/src/SVGTSpanElement.cpp => dom/svg/SVGTSpanElement.cpp
rename : content/svg/content/src/SVGTSpanElement.h => dom/svg/SVGTSpanElement.h
rename : content/svg/content/src/SVGTagList.h => dom/svg/SVGTagList.h
rename : content/svg/content/src/SVGTests.cpp => dom/svg/SVGTests.cpp
rename : content/svg/content/src/SVGTests.h => dom/svg/SVGTests.h
rename : content/svg/content/src/SVGTextContentElement.cpp => dom/svg/SVGTextContentElement.cpp
rename : content/svg/content/src/SVGTextContentElement.h => dom/svg/SVGTextContentElement.h
rename : content/svg/content/src/SVGTextElement.cpp => dom/svg/SVGTextElement.cpp
rename : content/svg/content/src/SVGTextElement.h => dom/svg/SVGTextElement.h
rename : content/svg/content/src/SVGTextPathElement.cpp => dom/svg/SVGTextPathElement.cpp
rename : content/svg/content/src/SVGTextPathElement.h => dom/svg/SVGTextPathElement.h
rename : content/svg/content/src/SVGTextPositioningElement.cpp => dom/svg/SVGTextPositioningElement.cpp
rename : content/svg/content/src/SVGTextPositioningElement.h => dom/svg/SVGTextPositioningElement.h
rename : content/svg/content/src/SVGTitleElement.cpp => dom/svg/SVGTitleElement.cpp
rename : content/svg/content/src/SVGTitleElement.h => dom/svg/SVGTitleElement.h
rename : content/svg/content/src/SVGTransform.cpp => dom/svg/SVGTransform.cpp
rename : content/svg/content/src/SVGTransform.h => dom/svg/SVGTransform.h
rename : content/svg/content/src/SVGTransformList.cpp => dom/svg/SVGTransformList.cpp
rename : content/svg/content/src/SVGTransformList.h => dom/svg/SVGTransformList.h
rename : content/svg/content/src/SVGTransformListParser.cpp => dom/svg/SVGTransformListParser.cpp
rename : content/svg/content/src/SVGTransformListParser.h => dom/svg/SVGTransformListParser.h
rename : content/svg/content/src/SVGTransformListSMILType.cpp => dom/svg/SVGTransformListSMILType.cpp
rename : content/svg/content/src/SVGTransformListSMILType.h => dom/svg/SVGTransformListSMILType.h
rename : content/svg/content/src/SVGTransformableElement.cpp => dom/svg/SVGTransformableElement.cpp
rename : content/svg/content/src/SVGTransformableElement.h => dom/svg/SVGTransformableElement.h
rename : content/svg/content/src/SVGUseElement.cpp => dom/svg/SVGUseElement.cpp
rename : content/svg/content/src/SVGUseElement.h => dom/svg/SVGUseElement.h
rename : content/svg/content/src/SVGViewBoxSMILType.cpp => dom/svg/SVGViewBoxSMILType.cpp
rename : content/svg/content/src/SVGViewBoxSMILType.h => dom/svg/SVGViewBoxSMILType.h
rename : content/svg/content/src/SVGViewElement.cpp => dom/svg/SVGViewElement.cpp
rename : content/svg/content/src/SVGViewElement.h => dom/svg/SVGViewElement.h
rename : content/svg/content/src/SVGZoomEvent.cpp => dom/svg/SVGZoomEvent.cpp
rename : content/svg/content/src/SVGZoomEvent.h => dom/svg/SVGZoomEvent.h
rename : content/svg/content/src/crashtests/307322-1.svg => dom/svg/crashtests/307322-1.svg
rename : content/svg/content/src/crashtests/327705-1.svg => dom/svg/crashtests/327705-1.svg
rename : content/svg/content/src/crashtests/336994-1.html => dom/svg/crashtests/336994-1.html
rename : content/svg/content/src/crashtests/344888-1.svg => dom/svg/crashtests/344888-1.svg
rename : content/svg/content/src/crashtests/345445-1.svg => dom/svg/crashtests/345445-1.svg
rename : content/svg/content/src/crashtests/360836-1.svg => dom/svg/crashtests/360836-1.svg
rename : content/svg/content/src/crashtests/367357-1.xhtml => dom/svg/crashtests/367357-1.xhtml
rename : content/svg/content/src/crashtests/369051-1.svg => dom/svg/crashtests/369051-1.svg
rename : content/svg/content/src/crashtests/369249-1.svg => dom/svg/crashtests/369249-1.svg
rename : content/svg/content/src/crashtests/369291-1.svg => dom/svg/crashtests/369291-1.svg
rename : content/svg/content/src/crashtests/369291-2.svg => dom/svg/crashtests/369291-2.svg
rename : content/svg/content/src/crashtests/369568-1.svg => dom/svg/crashtests/369568-1.svg
rename : content/svg/content/src/crashtests/372046-1.svg => dom/svg/crashtests/372046-1.svg
rename : content/svg/content/src/crashtests/372046-2.svg => dom/svg/crashtests/372046-2.svg
rename : content/svg/content/src/crashtests/374882-1.svg => dom/svg/crashtests/374882-1.svg
rename : content/svg/content/src/crashtests/380101-1.svg => dom/svg/crashtests/380101-1.svg
rename : content/svg/content/src/crashtests/381777-1.svg => dom/svg/crashtests/381777-1.svg
rename : content/svg/content/src/crashtests/383685-1.svg => dom/svg/crashtests/383685-1.svg
rename : content/svg/content/src/crashtests/385096.html => dom/svg/crashtests/385096.html
rename : content/svg/content/src/crashtests/385554-1.html => dom/svg/crashtests/385554-1.html
rename : content/svg/content/src/crashtests/385554-2.xul => dom/svg/crashtests/385554-2.xul
rename : content/svg/content/src/crashtests/388712-1.svg => dom/svg/crashtests/388712-1.svg
rename : content/svg/content/src/crashtests/395616-1.html => dom/svg/crashtests/395616-1.html
rename : content/svg/content/src/crashtests/396618-1.html => dom/svg/crashtests/396618-1.html
rename : content/svg/content/src/crashtests/397017-1.html => dom/svg/crashtests/397017-1.html
rename : content/svg/content/src/crashtests/397551-1.svg => dom/svg/crashtests/397551-1.svg
rename : content/svg/content/src/crashtests/397704-1.svg => dom/svg/crashtests/397704-1.svg
rename : content/svg/content/src/crashtests/398926-both-different.svg => dom/svg/crashtests/398926-both-different.svg
rename : content/svg/content/src/crashtests/398926-both-same.svg => dom/svg/crashtests/398926-both-same.svg
rename : content/svg/content/src/crashtests/398926-fill.svg => dom/svg/crashtests/398926-fill.svg
rename : content/svg/content/src/crashtests/398926-stroke.svg => dom/svg/crashtests/398926-stroke.svg
rename : content/svg/content/src/crashtests/405639-1.svg => dom/svg/crashtests/405639-1.svg
rename : content/svg/content/src/crashtests/406361-1.html => dom/svg/crashtests/406361-1.html
rename : content/svg/content/src/crashtests/409811-1.html => dom/svg/crashtests/409811-1.html
rename : content/svg/content/src/crashtests/410659-1.svg => dom/svg/crashtests/410659-1.svg
rename : content/svg/content/src/crashtests/410659-2.svg => dom/svg/crashtests/410659-2.svg
rename : content/svg/content/src/crashtests/410659-3.svg => dom/svg/crashtests/410659-3.svg
rename : content/svg/content/src/crashtests/412104-1.svg => dom/svg/crashtests/412104-1.svg
rename : content/svg/content/src/crashtests/413174-1.svg => dom/svg/crashtests/413174-1.svg
rename : content/svg/content/src/crashtests/414188-1.svg => dom/svg/crashtests/414188-1.svg
rename : content/svg/content/src/crashtests/427325-1.svg => dom/svg/crashtests/427325-1.svg
rename : content/svg/content/src/crashtests/428228-1.svg => dom/svg/crashtests/428228-1.svg
rename : content/svg/content/src/crashtests/428841-1.svg => dom/svg/crashtests/428841-1.svg
rename : content/svg/content/src/crashtests/435209-1.svg => dom/svg/crashtests/435209-1.svg
rename : content/svg/content/src/crashtests/436418-mpathRoot-1.svg => dom/svg/crashtests/436418-mpathRoot-1.svg
rename : content/svg/content/src/crashtests/448244-1.svg => dom/svg/crashtests/448244-1.svg
rename : content/svg/content/src/crashtests/466576-1.xhtml => dom/svg/crashtests/466576-1.xhtml
rename : content/svg/content/src/crashtests/499879-1.svg => dom/svg/crashtests/499879-1.svg
rename : content/svg/content/src/crashtests/535691-1.svg => dom/svg/crashtests/535691-1.svg
rename : content/svg/content/src/crashtests/539167-1.svg => dom/svg/crashtests/539167-1.svg
rename : content/svg/content/src/crashtests/573316-1.svg => dom/svg/crashtests/573316-1.svg
rename : content/svg/content/src/crashtests/579356-1.svg => dom/svg/crashtests/579356-1.svg
rename : content/svg/content/src/crashtests/579356-2.svg => dom/svg/crashtests/579356-2.svg
rename : content/svg/content/src/crashtests/595608-1.svg => dom/svg/crashtests/595608-1.svg
rename : content/svg/content/src/crashtests/601251-1.html => dom/svg/crashtests/601251-1.html
rename : content/svg/content/src/crashtests/601406-1.svg => dom/svg/crashtests/601406-1.svg
rename : content/svg/content/src/crashtests/603145-1.svg => dom/svg/crashtests/603145-1.svg
rename : content/svg/content/src/crashtests/613899-1.svg => dom/svg/crashtests/613899-1.svg
rename : content/svg/content/src/crashtests/613899-2.svg => dom/svg/crashtests/613899-2.svg
rename : content/svg/content/src/crashtests/719779-1.svg => dom/svg/crashtests/719779-1.svg
rename : content/svg/content/src/crashtests/723441-1.html => dom/svg/crashtests/723441-1.html
rename : content/svg/content/src/crashtests/723441-resource.svg => dom/svg/crashtests/723441-resource.svg
rename : content/svg/content/src/crashtests/751515-1.svg => dom/svg/crashtests/751515-1.svg
rename : content/svg/content/src/crashtests/761507-1.svg => dom/svg/crashtests/761507-1.svg
rename : content/svg/content/src/crashtests/831561.html => dom/svg/crashtests/831561.html
rename : content/svg/content/src/crashtests/837450-1.svg => dom/svg/crashtests/837450-1.svg
rename : content/svg/content/src/crashtests/842463-1.html => dom/svg/crashtests/842463-1.html
rename : content/svg/content/src/crashtests/847138-1.svg => dom/svg/crashtests/847138-1.svg
rename : content/svg/content/src/crashtests/864509.svg => dom/svg/crashtests/864509.svg
rename : content/svg/content/src/crashtests/880544-1.svg => dom/svg/crashtests/880544-1.svg
rename : content/svg/content/src/crashtests/880544-2.svg => dom/svg/crashtests/880544-2.svg
rename : content/svg/content/src/crashtests/880544-3.svg => dom/svg/crashtests/880544-3.svg
rename : content/svg/content/src/crashtests/880544-4.svg => dom/svg/crashtests/880544-4.svg
rename : content/svg/content/src/crashtests/880544-5.svg => dom/svg/crashtests/880544-5.svg
rename : content/svg/content/src/crashtests/898915-1.svg => dom/svg/crashtests/898915-1.svg
rename : content/svg/content/src/crashtests/crashtests.list => dom/svg/crashtests/crashtests.list
rename : content/svg/content/src/crashtests/zero-size-image.svg => dom/svg/crashtests/zero-size-image.svg
rename : content/svg/moz.build => dom/svg/moz.build
rename : content/svg/content/src/nsISVGPoint.cpp => dom/svg/nsISVGPoint.cpp
rename : content/svg/content/src/nsISVGPoint.h => dom/svg/nsISVGPoint.h
rename : content/svg/content/src/nsSVGAngle.cpp => dom/svg/nsSVGAngle.cpp
rename : content/svg/content/src/nsSVGAngle.h => dom/svg/nsSVGAngle.h
rename : content/svg/content/src/nsSVGAnimatedTransformList.cpp => dom/svg/nsSVGAnimatedTransformList.cpp
rename : content/svg/content/src/nsSVGAnimatedTransformList.h => dom/svg/nsSVGAnimatedTransformList.h
rename : content/svg/content/src/nsSVGAttrTearoffTable.h => dom/svg/nsSVGAttrTearoffTable.h
rename : content/svg/content/src/nsSVGBoolean.cpp => dom/svg/nsSVGBoolean.cpp
rename : content/svg/content/src/nsSVGBoolean.h => dom/svg/nsSVGBoolean.h
rename : content/svg/content/src/nsSVGClass.cpp => dom/svg/nsSVGClass.cpp
rename : content/svg/content/src/nsSVGClass.h => dom/svg/nsSVGClass.h
rename : content/svg/content/src/nsSVGDataParser.cpp => dom/svg/nsSVGDataParser.cpp
rename : content/svg/content/src/nsSVGDataParser.h => dom/svg/nsSVGDataParser.h
rename : content/svg/content/src/nsSVGElement.cpp => dom/svg/nsSVGElement.cpp
rename : content/svg/content/src/nsSVGElement.h => dom/svg/nsSVGElement.h
rename : content/svg/content/src/nsSVGEnum.cpp => dom/svg/nsSVGEnum.cpp
rename : content/svg/content/src/nsSVGEnum.h => dom/svg/nsSVGEnum.h
rename : content/svg/content/src/nsSVGFeatures.cpp => dom/svg/nsSVGFeatures.cpp
rename : content/svg/content/src/nsSVGFeatures.h => dom/svg/nsSVGFeatures.h
rename : content/svg/content/src/nsSVGFeaturesList.h => dom/svg/nsSVGFeaturesList.h
rename : content/svg/content/src/nsSVGFilters.cpp => dom/svg/nsSVGFilters.cpp
rename : content/svg/content/src/nsSVGFilters.h => dom/svg/nsSVGFilters.h
rename : content/svg/content/src/nsSVGInteger.cpp => dom/svg/nsSVGInteger.cpp
rename : content/svg/content/src/nsSVGInteger.h => dom/svg/nsSVGInteger.h
rename : content/svg/content/src/nsSVGIntegerPair.cpp => dom/svg/nsSVGIntegerPair.cpp
rename : content/svg/content/src/nsSVGIntegerPair.h => dom/svg/nsSVGIntegerPair.h
rename : content/svg/content/src/nsSVGLength2.cpp => dom/svg/nsSVGLength2.cpp
rename : content/svg/content/src/nsSVGLength2.h => dom/svg/nsSVGLength2.h
rename : content/svg/content/src/nsSVGNumber2.cpp => dom/svg/nsSVGNumber2.cpp
rename : content/svg/content/src/nsSVGNumber2.h => dom/svg/nsSVGNumber2.h
rename : content/svg/content/src/nsSVGNumberPair.cpp => dom/svg/nsSVGNumberPair.cpp
rename : content/svg/content/src/nsSVGNumberPair.h => dom/svg/nsSVGNumberPair.h
rename : content/svg/content/src/nsSVGPathDataParser.cpp => dom/svg/nsSVGPathDataParser.cpp
rename : content/svg/content/src/nsSVGPathDataParser.h => dom/svg/nsSVGPathDataParser.h
rename : content/svg/content/src/nsSVGPathGeometryElement.cpp => dom/svg/nsSVGPathGeometryElement.cpp
rename : content/svg/content/src/nsSVGPathGeometryElement.h => dom/svg/nsSVGPathGeometryElement.h
rename : content/svg/content/src/nsSVGPolyElement.cpp => dom/svg/nsSVGPolyElement.cpp
rename : content/svg/content/src/nsSVGPolyElement.h => dom/svg/nsSVGPolyElement.h
rename : content/svg/content/src/nsSVGString.cpp => dom/svg/nsSVGString.cpp
rename : content/svg/content/src/nsSVGString.h => dom/svg/nsSVGString.h
rename : content/svg/content/src/nsSVGTransform.cpp => dom/svg/nsSVGTransform.cpp
rename : content/svg/content/src/nsSVGTransform.h => dom/svg/nsSVGTransform.h
rename : content/svg/content/src/nsSVGViewBox.cpp => dom/svg/nsSVGViewBox.cpp
rename : content/svg/content/src/nsSVGViewBox.h => dom/svg/nsSVGViewBox.h
rename : content/svg/content/test/MutationEventChecker.js => dom/svg/test/MutationEventChecker.js
rename : content/svg/content/test/a_href_destination.svg => dom/svg/test/a_href_destination.svg
rename : content/svg/content/test/a_href_helper_01.svg => dom/svg/test/a_href_helper_01.svg
rename : content/svg/content/test/a_href_helper_02_03.svg => dom/svg/test/a_href_helper_02_03.svg
rename : content/svg/content/test/a_href_helper_04.svg => dom/svg/test/a_href_helper_04.svg
rename : content/svg/content/test/animated-svg-image-helper.html => dom/svg/test/animated-svg-image-helper.html
rename : content/svg/content/test/animated-svg-image-helper.svg => dom/svg/test/animated-svg-image-helper.svg
rename : content/svg/content/test/bbox-helper.svg => dom/svg/test/bbox-helper.svg
rename : content/svg/content/test/bounds-helper.svg => dom/svg/test/bounds-helper.svg
rename : content/svg/content/test/dataTypes-helper.svg => dom/svg/test/dataTypes-helper.svg
rename : content/svg/content/test/fragments-helper.svg => dom/svg/test/fragments-helper.svg
rename : content/svg/content/test/getBBox-method-helper.svg => dom/svg/test/getBBox-method-helper.svg
rename : content/svg/content/test/getCTM-helper.svg => dom/svg/test/getCTM-helper.svg
rename : content/svg/content/test/getSubStringLength-helper.svg => dom/svg/test/getSubStringLength-helper.svg
rename : content/svg/content/test/matrixUtils.js => dom/svg/test/matrixUtils.js
rename : content/svg/content/test/mochitest.ini => dom/svg/test/mochitest.ini
rename : content/svg/content/test/object-delayed-intrinsic-size.sjs => dom/svg/test/object-delayed-intrinsic-size.sjs
rename : content/svg/content/test/pointer-events.js => dom/svg/test/pointer-events.js
rename : content/svg/content/test/scientific-helper.svg => dom/svg/test/scientific-helper.svg
rename : content/svg/content/test/selectSubString-helper.svg => dom/svg/test/selectSubString-helper.svg
rename : content/svg/content/test/switch-helper.svg => dom/svg/test/switch-helper.svg
rename : content/svg/content/test/test_SVGLengthList-2.xhtml => dom/svg/test/test_SVGLengthList-2.xhtml
rename : content/svg/content/test/test_SVGLengthList.xhtml => dom/svg/test/test_SVGLengthList.xhtml
rename : content/svg/content/test/test_SVGMatrix.xhtml => dom/svg/test/test_SVGMatrix.xhtml
rename : content/svg/content/test/test_SVGNumberList.xhtml => dom/svg/test/test_SVGNumberList.xhtml
rename : content/svg/content/test/test_SVGPathSegList.xhtml => dom/svg/test/test_SVGPathSegList.xhtml
rename : content/svg/content/test/test_SVGPointList.xhtml => dom/svg/test/test_SVGPointList.xhtml
rename : content/svg/content/test/test_SVGStringList.xhtml => dom/svg/test/test_SVGStringList.xhtml
rename : content/svg/content/test/test_SVGStyleElement.xhtml => dom/svg/test/test_SVGStyleElement.xhtml
rename : content/svg/content/test/test_SVGTransformList.xhtml => dom/svg/test/test_SVGTransformList.xhtml
rename : content/svg/content/test/test_SVGTransformListAddition.xhtml => dom/svg/test/test_SVGTransformListAddition.xhtml
rename : content/svg/content/test/test_SVGUnitTypes.html => dom/svg/test/test_SVGUnitTypes.html
rename : content/svg/content/test/test_SVG_namespace_ids.html => dom/svg/test/test_SVG_namespace_ids.html
rename : content/svg/content/test/test_SVGxxxList.xhtml => dom/svg/test/test_SVGxxxList.xhtml
rename : content/svg/content/test/test_SVGxxxListIndexing.xhtml => dom/svg/test/test_SVGxxxListIndexing.xhtml
rename : content/svg/content/test/test_a_href_01.xhtml => dom/svg/test/test_a_href_01.xhtml
rename : content/svg/content/test/test_a_href_02.xhtml => dom/svg/test/test_a_href_02.xhtml
rename : content/svg/content/test/test_animLengthObjectIdentity.xhtml => dom/svg/test/test_animLengthObjectIdentity.xhtml
rename : content/svg/content/test/test_animLengthReadonly.xhtml => dom/svg/test/test_animLengthReadonly.xhtml
rename : content/svg/content/test/test_animLengthUnits.xhtml => dom/svg/test/test_animLengthUnits.xhtml
rename : content/svg/content/test/test_bbox-with-invalid-viewBox.xhtml => dom/svg/test/test_bbox-with-invalid-viewBox.xhtml
rename : content/svg/content/test/test_bbox.xhtml => dom/svg/test/test_bbox.xhtml
rename : content/svg/content/test/test_bounds.html => dom/svg/test/test_bounds.html
rename : content/svg/content/test/test_bug872812.html => dom/svg/test/test_bug872812.html
rename : content/svg/content/test/test_dataTypes.html => dom/svg/test/test_dataTypes.html
rename : content/svg/content/test/test_dataTypesModEvents.html => dom/svg/test/test_dataTypesModEvents.html
rename : content/svg/content/test/test_fragments.html => dom/svg/test/test_fragments.html
rename : content/svg/content/test/test_getBBox-method.html => dom/svg/test/test_getBBox-method.html
rename : content/svg/content/test/test_getCTM.html => dom/svg/test/test_getCTM.html
rename : content/svg/content/test/test_getElementById.xhtml => dom/svg/test/test_getElementById.xhtml
rename : content/svg/content/test/test_getSubStringLength.xhtml => dom/svg/test/test_getSubStringLength.xhtml
rename : content/svg/content/test/test_hasFeature.xhtml => dom/svg/test/test_hasFeature.xhtml
rename : content/svg/content/test/test_lang.xhtml => dom/svg/test/test_lang.xhtml
rename : content/svg/content/test/test_length.xhtml => dom/svg/test/test_length.xhtml
rename : content/svg/content/test/test_lengthParsing.html => dom/svg/test/test_lengthParsing.html
rename : content/svg/content/test/test_non-scaling-stroke.html => dom/svg/test/test_non-scaling-stroke.html
rename : content/svg/content/test/test_nonAnimStrings.xhtml => dom/svg/test/test_nonAnimStrings.xhtml
rename : content/svg/content/test/test_object-delayed-intrinsic-size.html => dom/svg/test/test_object-delayed-intrinsic-size.html
rename : content/svg/content/test/test_onerror.xhtml => dom/svg/test/test_onerror.xhtml
rename : content/svg/content/test/test_pathAnimInterpolation.xhtml => dom/svg/test/test_pathAnimInterpolation.xhtml
rename : content/svg/content/test/test_pathLength.html => dom/svg/test/test_pathLength.html
rename : content/svg/content/test/test_pathSeg.xhtml => dom/svg/test/test_pathSeg.xhtml
rename : content/svg/content/test/test_pointAtLength.xhtml => dom/svg/test/test_pointAtLength.xhtml
rename : content/svg/content/test/test_pointer-events-1a.xhtml => dom/svg/test/test_pointer-events-1a.xhtml
rename : content/svg/content/test/test_pointer-events-1b.xhtml => dom/svg/test/test_pointer-events-1b.xhtml
rename : content/svg/content/test/test_pointer-events-2.xhtml => dom/svg/test/test_pointer-events-2.xhtml
rename : content/svg/content/test/test_pointer-events-3.xhtml => dom/svg/test/test_pointer-events-3.xhtml
rename : content/svg/content/test/test_pointer-events-4.xhtml => dom/svg/test/test_pointer-events-4.xhtml
rename : content/svg/content/test/test_pointer-events-5.xhtml => dom/svg/test/test_pointer-events-5.xhtml
rename : content/svg/content/test/test_pointer-events-6.xhtml => dom/svg/test/test_pointer-events-6.xhtml
rename : content/svg/content/test/test_scientific.html => dom/svg/test/test_scientific.html
rename : content/svg/content/test/test_selectSubString.xhtml => dom/svg/test/test_selectSubString.xhtml
rename : content/svg/content/test/test_stroke-linecap-hit-testing.xhtml => dom/svg/test/test_stroke-linecap-hit-testing.xhtml
rename : content/svg/content/test/test_switch.xhtml => dom/svg/test/test_switch.xhtml
rename : content/svg/content/test/test_text.html => dom/svg/test/test_text.html
rename : content/svg/content/test/test_text_2.html => dom/svg/test/test_text_2.html
rename : content/svg/content/test/test_text_dirty.html => dom/svg/test/test_text_dirty.html
rename : content/svg/content/test/test_text_lengthAdjust.html => dom/svg/test/test_text_lengthAdjust.html
rename : content/svg/content/test/test_text_scaled.html => dom/svg/test/test_text_scaled.html
rename : content/svg/content/test/test_text_selection.html => dom/svg/test/test_text_selection.html
rename : content/svg/content/test/test_text_update.html => dom/svg/test/test_text_update.html
rename : content/svg/content/test/test_transform.xhtml => dom/svg/test/test_transform.xhtml
rename : content/svg/content/test/test_transformParsing.html => dom/svg/test/test_transformParsing.html
rename : content/svg/content/test/test_valueAsString.xhtml => dom/svg/test/test_valueAsString.xhtml
rename : content/svg/content/test/test_valueLeaks.xhtml => dom/svg/test/test_valueLeaks.xhtml
rename : content/svg/content/test/test_viewport.html => dom/svg/test/test_viewport.html
rename : content/svg/content/test/test_zoom.xhtml => dom/svg/test/test_zoom.xhtml
rename : content/svg/content/test/text-helper-scaled.svg => dom/svg/test/text-helper-scaled.svg
rename : content/svg/content/test/text-helper-selection.svg => dom/svg/test/text-helper-selection.svg
rename : content/svg/content/test/text-helper.svg => dom/svg/test/text-helper.svg
rename : content/svg/content/test/viewport-helper.svg => dom/svg/test/viewport-helper.svg
rename : content/svg/content/test/zoom-helper.svg => dom/svg/test/zoom-helper.svg
2014-10-25 20:21:12 +03:00

2729 lines
82 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/ArrayUtils.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/unused.h"
#include "nsSVGElement.h"
#include "mozilla/dom/SVGSVGElement.h"
#include "mozilla/dom/SVGTests.h"
#include "nsContentUtils.h"
#include "nsICSSDeclaration.h"
#include "nsIDocument.h"
#include "nsIDOMMutationEvent.h"
#include "nsSVGPathGeometryElement.h"
#include "mozilla/InternalMutationEvent.h"
#include "nsError.h"
#include "nsIPresShell.h"
#include "nsGkAtoms.h"
#include "mozilla/css/StyleRule.h"
#include "nsRuleWalker.h"
#include "mozilla/css/Declaration.h"
#include "nsCSSProps.h"
#include "nsCSSParser.h"
#include "mozilla/EventListenerManager.h"
#include "nsLayoutUtils.h"
#include "nsSVGAnimatedTransformList.h"
#include "nsSVGLength2.h"
#include "nsSVGNumber2.h"
#include "nsSVGNumberPair.h"
#include "nsSVGInteger.h"
#include "nsSVGIntegerPair.h"
#include "nsSVGAngle.h"
#include "nsSVGBoolean.h"
#include "nsSVGEnum.h"
#include "nsSVGViewBox.h"
#include "nsSVGString.h"
#include "mozilla/dom/SVGAnimatedEnumeration.h"
#include "SVGAnimatedNumberList.h"
#include "SVGAnimatedLengthList.h"
#include "SVGAnimatedPointList.h"
#include "SVGAnimatedPathSegList.h"
#include "SVGContentUtils.h"
#include "nsIFrame.h"
#include <stdarg.h>
#include "nsSMILMappedAttribute.h"
#include "SVGMotionSMILAttr.h"
#include "nsAttrValueOrString.h"
#include "nsSMILAnimationController.h"
#include "mozilla/dom/SVGElementBinding.h"
#include "mozilla/unused.h"
#include "RestyleManager.h"
using namespace mozilla;
using namespace mozilla::dom;
// This is needed to ensure correct handling of calls to the
// vararg-list methods in this file:
// nsSVGElement::GetAnimated{Length,Number,Integer}Values
// See bug 547964 for details:
static_assert(sizeof(void*) == sizeof(nullptr),
"nullptr should be the correct size");
nsresult
NS_NewSVGElement(Element **aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
{
nsRefPtr<nsSVGElement> it = new nsSVGElement(aNodeInfo);
nsresult rv = it->Init();
if (NS_FAILED(rv)) {
return rv;
}
it.forget(aResult);
return rv;
}
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGElement)
nsSVGEnumMapping nsSVGElement::sSVGUnitTypesMap[] = {
{&nsGkAtoms::userSpaceOnUse, SVG_UNIT_TYPE_USERSPACEONUSE},
{&nsGkAtoms::objectBoundingBox, SVG_UNIT_TYPE_OBJECTBOUNDINGBOX},
{nullptr, 0}
};
nsSVGElement::nsSVGElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsSVGElementBase(aNodeInfo)
{
}
JSObject*
nsSVGElement::WrapNode(JSContext *aCx)
{
return SVGElementBinding::Wrap(aCx, this);
}
//----------------------------------------------------------------------
/* readonly attribute SVGAnimatedString className; */
NS_IMETHODIMP
nsSVGElement::GetSVGClassName(nsISupports** aClassName)
{
*aClassName = ClassName().take();
return NS_OK;
}
/* readonly attribute nsIDOMCSSStyleDeclaration style; */
NS_IMETHODIMP
nsSVGElement::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
{
NS_ADDREF(*aStyle = Style());
return NS_OK;
}
//----------------------------------------------------------------------
// nsSVGElement methods
void
nsSVGElement::DidAnimateClass()
{
nsAutoString src;
mClassAttribute.GetAnimValue(src, this);
if (!mClassAnimAttr) {
mClassAnimAttr = new nsAttrValue();
}
mClassAnimAttr->ParseAtomArray(src);
nsIPresShell* shell = OwnerDoc()->GetShell();
if (shell) {
shell->RestyleForAnimation(this, eRestyle_Self);
}
}
nsresult
nsSVGElement::Init()
{
// Set up length attributes - can't do this in the constructor
// because we can't do a virtual call at that point
LengthAttributesInfo lengthInfo = GetLengthInfo();
uint32_t i;
for (i = 0; i < lengthInfo.mLengthCount; i++) {
lengthInfo.Reset(i);
}
NumberAttributesInfo numberInfo = GetNumberInfo();
for (i = 0; i < numberInfo.mNumberCount; i++) {
numberInfo.Reset(i);
}
NumberPairAttributesInfo numberPairInfo = GetNumberPairInfo();
for (i = 0; i < numberPairInfo.mNumberPairCount; i++) {
numberPairInfo.Reset(i);
}
IntegerAttributesInfo integerInfo = GetIntegerInfo();
for (i = 0; i < integerInfo.mIntegerCount; i++) {
integerInfo.Reset(i);
}
IntegerPairAttributesInfo integerPairInfo = GetIntegerPairInfo();
for (i = 0; i < integerPairInfo.mIntegerPairCount; i++) {
integerPairInfo.Reset(i);
}
AngleAttributesInfo angleInfo = GetAngleInfo();
for (i = 0; i < angleInfo.mAngleCount; i++) {
angleInfo.Reset(i);
}
BooleanAttributesInfo booleanInfo = GetBooleanInfo();
for (i = 0; i < booleanInfo.mBooleanCount; i++) {
booleanInfo.Reset(i);
}
EnumAttributesInfo enumInfo = GetEnumInfo();
for (i = 0; i < enumInfo.mEnumCount; i++) {
enumInfo.Reset(i);
}
nsSVGViewBox *viewBox = GetViewBox();
if (viewBox) {
viewBox->Init();
}
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
if (preserveAspectRatio) {
preserveAspectRatio->Init();
}
LengthListAttributesInfo lengthListInfo = GetLengthListInfo();
for (i = 0; i < lengthListInfo.mLengthListCount; i++) {
lengthListInfo.Reset(i);
}
NumberListAttributesInfo numberListInfo = GetNumberListInfo();
for (i = 0; i < numberListInfo.mNumberListCount; i++) {
numberListInfo.Reset(i);
}
// No need to reset SVGPointList since the default value is always the same
// (an empty list).
// No need to reset SVGPathData since the default value is always the same
// (an empty list).
StringAttributesInfo stringInfo = GetStringInfo();
for (i = 0; i < stringInfo.mStringCount; i++) {
stringInfo.Reset(i);
}
return NS_OK;
}
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_ISUPPORTS_INHERITED(nsSVGElement, nsSVGElementBase,
nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement)
//----------------------------------------------------------------------
// Implementation
//----------------------------------------------------------------------
// nsIContent methods
nsresult
nsSVGElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers)
{
nsresult rv = nsSVGElementBase::BindToTree(aDocument, aParent,
aBindingParent,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (!MayHaveStyle()) {
return NS_OK;
}
const nsAttrValue* oldVal = mAttrsAndChildren.GetAttr(nsGkAtoms::style);
if (oldVal && oldVal->Type() == nsAttrValue::eCSSStyleRule) {
// we need to force a reparse because the baseURI of the document
// may have changed, and in particular because we may be clones of
// XBL anonymous content now being bound to the document we should
// render in and due to the hacky way in which we implement the
// interaction of XBL and SVG resources. Once we have a sane
// ownerDocument on XBL anonymous content, this can all go away.
nsAttrValue attrValue;
nsAutoString stringValue;
oldVal->ToString(stringValue);
// Force in data doc, since we already have a style rule
ParseStyleAttribute(stringValue, attrValue, true);
// Don't bother going through SetInlineStyleRule, we don't want to fire off
// mutation events or document notifications anyway
rv = mAttrsAndChildren.SetAndTakeAttr(nsGkAtoms::style, attrValue);
NS_ENSURE_SUCCESS(rv, rv);
}
return NS_OK;
}
nsresult
nsSVGElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
const nsAttrValue* aValue, bool aNotify)
{
// We don't currently use nsMappedAttributes within SVG. If this changes, we
// need to be very careful because some nsAttrValues used by SVG point to
// member data of SVG elements and if an nsAttrValue outlives the SVG element
// whose data it points to (by virtue of being stored in
// mAttrsAndChildren->mMappedAttributes, meaning it's shared between
// elements), the pointer will dangle. See bug 724680.
NS_ABORT_IF_FALSE(!mAttrsAndChildren.HasMappedAttrs(),
"Unexpected use of nsMappedAttributes within SVG");
// If this is an svg presentation attribute we need to map it into
// the content stylerule.
// XXX For some reason incremental mapping doesn't work, so for now
// just delete the style rule and lazily reconstruct it in
// GetContentStyleRule()
if (aNamespaceID == kNameSpaceID_None && IsAttributeMapped(aName)) {
mContentStyleRule = nullptr;
}
if (IsEventAttributeName(aName) && aValue) {
NS_ABORT_IF_FALSE(aValue->Type() == nsAttrValue::eString,
"Expected string value for script body");
nsresult rv = SetEventHandler(GetEventNameForAttr(aName),
aValue->GetStringValue());
NS_ENSURE_SUCCESS(rv, rv);
}
return nsSVGElementBase::AfterSetAttr(aNamespaceID, aName, aValue, aNotify);
}
bool
nsSVGElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
nsAttrValue& aResult)
{
nsresult rv = NS_OK;
bool foundMatch = false;
bool didSetResult = false;
if (aNamespaceID == kNameSpaceID_None) {
// Check for nsSVGLength2 attribute
LengthAttributesInfo lengthInfo = GetLengthInfo();
uint32_t i;
for (i = 0; i < lengthInfo.mLengthCount; i++) {
if (aAttribute == *lengthInfo.mLengthInfo[i].mName) {
rv = lengthInfo.mLengths[i].SetBaseValueString(aValue, this, false);
if (NS_FAILED(rv)) {
lengthInfo.Reset(i);
} else {
aResult.SetTo(lengthInfo.mLengths[i], &aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
if (!foundMatch) {
// Check for SVGAnimatedLengthList attribute
LengthListAttributesInfo lengthListInfo = GetLengthListInfo();
for (i = 0; i < lengthListInfo.mLengthListCount; i++) {
if (aAttribute == *lengthListInfo.mLengthListInfo[i].mName) {
rv = lengthListInfo.mLengthLists[i].SetBaseValueString(aValue);
if (NS_FAILED(rv)) {
lengthListInfo.Reset(i);
} else {
aResult.SetTo(lengthListInfo.mLengthLists[i].GetBaseValue(),
&aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for SVGAnimatedNumberList attribute
NumberListAttributesInfo numberListInfo = GetNumberListInfo();
for (i = 0; i < numberListInfo.mNumberListCount; i++) {
if (aAttribute == *numberListInfo.mNumberListInfo[i].mName) {
rv = numberListInfo.mNumberLists[i].SetBaseValueString(aValue);
if (NS_FAILED(rv)) {
numberListInfo.Reset(i);
} else {
aResult.SetTo(numberListInfo.mNumberLists[i].GetBaseValue(),
&aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for SVGAnimatedPointList attribute
if (GetPointListAttrName() == aAttribute) {
SVGAnimatedPointList* pointList = GetAnimatedPointList();
if (pointList) {
pointList->SetBaseValueString(aValue);
// The spec says we parse everything up to the failure, so we DON'T
// need to check the result of SetBaseValueString or call
// pointList->ClearBaseValue() if it fails
aResult.SetTo(pointList->GetBaseValue(), &aValue);
didSetResult = true;
foundMatch = true;
}
}
}
if (!foundMatch) {
// Check for SVGAnimatedPathSegList attribute
if (GetPathDataAttrName() == aAttribute) {
SVGAnimatedPathSegList* segList = GetAnimPathSegList();
if (segList) {
segList->SetBaseValueString(aValue);
// The spec says we parse everything up to the failure, so we DON'T
// need to check the result of SetBaseValueString or call
// segList->ClearBaseValue() if it fails
aResult.SetTo(segList->GetBaseValue(), &aValue);
didSetResult = true;
foundMatch = true;
}
}
}
if (!foundMatch) {
// Check for nsSVGNumber2 attribute
NumberAttributesInfo numberInfo = GetNumberInfo();
for (i = 0; i < numberInfo.mNumberCount; i++) {
if (aAttribute == *numberInfo.mNumberInfo[i].mName) {
rv = numberInfo.mNumbers[i].SetBaseValueString(aValue, this);
if (NS_FAILED(rv)) {
numberInfo.Reset(i);
} else {
aResult.SetTo(numberInfo.mNumbers[i].GetBaseValue(), &aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for nsSVGNumberPair attribute
NumberPairAttributesInfo numberPairInfo = GetNumberPairInfo();
for (i = 0; i < numberPairInfo.mNumberPairCount; i++) {
if (aAttribute == *numberPairInfo.mNumberPairInfo[i].mName) {
rv = numberPairInfo.mNumberPairs[i].SetBaseValueString(aValue, this);
if (NS_FAILED(rv)) {
numberPairInfo.Reset(i);
} else {
aResult.SetTo(numberPairInfo.mNumberPairs[i], &aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for nsSVGInteger attribute
IntegerAttributesInfo integerInfo = GetIntegerInfo();
for (i = 0; i < integerInfo.mIntegerCount; i++) {
if (aAttribute == *integerInfo.mIntegerInfo[i].mName) {
rv = integerInfo.mIntegers[i].SetBaseValueString(aValue, this);
if (NS_FAILED(rv)) {
integerInfo.Reset(i);
} else {
aResult.SetTo(integerInfo.mIntegers[i].GetBaseValue(), &aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for nsSVGIntegerPair attribute
IntegerPairAttributesInfo integerPairInfo = GetIntegerPairInfo();
for (i = 0; i < integerPairInfo.mIntegerPairCount; i++) {
if (aAttribute == *integerPairInfo.mIntegerPairInfo[i].mName) {
rv =
integerPairInfo.mIntegerPairs[i].SetBaseValueString(aValue, this);
if (NS_FAILED(rv)) {
integerPairInfo.Reset(i);
} else {
aResult.SetTo(integerPairInfo.mIntegerPairs[i], &aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for nsSVGAngle attribute
AngleAttributesInfo angleInfo = GetAngleInfo();
for (i = 0; i < angleInfo.mAngleCount; i++) {
if (aAttribute == *angleInfo.mAngleInfo[i].mName) {
rv = angleInfo.mAngles[i].SetBaseValueString(aValue, this, false);
if (NS_FAILED(rv)) {
angleInfo.Reset(i);
} else {
aResult.SetTo(angleInfo.mAngles[i], &aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for nsSVGBoolean attribute
BooleanAttributesInfo booleanInfo = GetBooleanInfo();
for (i = 0; i < booleanInfo.mBooleanCount; i++) {
if (aAttribute == *booleanInfo.mBooleanInfo[i].mName) {
nsIAtom *valAtom = NS_GetStaticAtom(aValue);
rv = valAtom ? booleanInfo.mBooleans[i].SetBaseValueAtom(valAtom, this) :
NS_ERROR_DOM_SYNTAX_ERR;
if (NS_FAILED(rv)) {
booleanInfo.Reset(i);
} else {
aResult.SetTo(valAtom);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for nsSVGEnum attribute
EnumAttributesInfo enumInfo = GetEnumInfo();
for (i = 0; i < enumInfo.mEnumCount; i++) {
if (aAttribute == *enumInfo.mEnumInfo[i].mName) {
nsCOMPtr<nsIAtom> valAtom = do_GetAtom(aValue);
rv = enumInfo.mEnums[i].SetBaseValueAtom(valAtom, this);
if (NS_FAILED(rv)) {
enumInfo.Reset(i);
} else {
aResult.SetTo(valAtom);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for conditional processing attributes
nsCOMPtr<SVGTests> tests = do_QueryObject(this);
if (tests && tests->ParseConditionalProcessingAttribute(
aAttribute, aValue, aResult)) {
foundMatch = true;
}
}
if (!foundMatch) {
// Check for StringList attribute
StringListAttributesInfo stringListInfo = GetStringListInfo();
for (i = 0; i < stringListInfo.mStringListCount; i++) {
if (aAttribute == *stringListInfo.mStringListInfo[i].mName) {
rv = stringListInfo.mStringLists[i].SetValue(aValue);
if (NS_FAILED(rv)) {
stringListInfo.Reset(i);
} else {
aResult.SetTo(stringListInfo.mStringLists[i], &aValue);
didSetResult = true;
}
foundMatch = true;
break;
}
}
}
if (!foundMatch) {
// Check for nsSVGViewBox attribute
if (aAttribute == nsGkAtoms::viewBox) {
nsSVGViewBox* viewBox = GetViewBox();
if (viewBox) {
rv = viewBox->SetBaseValueString(aValue, this, false);
if (NS_FAILED(rv)) {
viewBox->Init();
} else {
aResult.SetTo(*viewBox, &aValue);
didSetResult = true;
}
foundMatch = true;
}
// Check for SVGAnimatedPreserveAspectRatio attribute
} else if (aAttribute == nsGkAtoms::preserveAspectRatio) {
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
if (preserveAspectRatio) {
rv = preserveAspectRatio->SetBaseValueString(aValue, this, false);
if (NS_FAILED(rv)) {
preserveAspectRatio->Init();
} else {
aResult.SetTo(*preserveAspectRatio, &aValue);
didSetResult = true;
}
foundMatch = true;
}
// Check for SVGAnimatedTransformList attribute
} else if (GetTransformListAttrName() == aAttribute) {
// The transform attribute is being set, so we must ensure that the
// nsSVGAnimatedTransformList is/has been allocated:
nsSVGAnimatedTransformList *transformList =
GetAnimatedTransformList(DO_ALLOCATE);
rv = transformList->SetBaseValueString(aValue);
if (NS_FAILED(rv)) {
transformList->ClearBaseValue();
} else {
aResult.SetTo(transformList->GetBaseValue(), &aValue);
didSetResult = true;
}
foundMatch = true;
}
}
if (aAttribute == nsGkAtoms::_class) {
mClassAttribute.SetBaseValue(aValue, this, false);
aResult.ParseAtomArray(aValue);
return true;
}
}
if (!foundMatch) {
// Check for nsSVGString attribute
StringAttributesInfo stringInfo = GetStringInfo();
for (uint32_t i = 0; i < stringInfo.mStringCount; i++) {
if (aNamespaceID == stringInfo.mStringInfo[i].mNamespaceID &&
aAttribute == *stringInfo.mStringInfo[i].mName) {
stringInfo.mStrings[i].SetBaseValue(aValue, this, false);
foundMatch = true;
break;
}
}
}
if (foundMatch) {
if (NS_FAILED(rv)) {
ReportAttributeParseFailure(OwnerDoc(), aAttribute, aValue);
return false;
}
if (!didSetResult) {
aResult.SetTo(aValue);
}
return true;
}
return nsSVGElementBase::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
void
nsSVGElement::UnsetAttrInternal(int32_t aNamespaceID, nsIAtom* aName,
bool aNotify)
{
// XXXbz there's a bunch of redundancy here with AfterSetAttr.
// Maybe consolidate?
if (aNamespaceID == kNameSpaceID_None) {
// If this is an svg presentation attribute, remove rule to force an update
if (IsAttributeMapped(aName))
mContentStyleRule = nullptr;
if (IsEventAttributeName(aName)) {
EventListenerManager* manager = GetExistingListenerManager();
if (manager) {
nsIAtom* eventName = GetEventNameForAttr(aName);
manager->RemoveEventHandler(eventName, EmptyString());
}
return;
}
// Check if this is a length attribute going away
LengthAttributesInfo lenInfo = GetLengthInfo();
for (uint32_t i = 0; i < lenInfo.mLengthCount; i++) {
if (aName == *lenInfo.mLengthInfo[i].mName) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
lenInfo.Reset(i);
return;
}
}
// Check if this is a length list attribute going away
LengthListAttributesInfo lengthListInfo = GetLengthListInfo();
for (uint32_t i = 0; i < lengthListInfo.mLengthListCount; i++) {
if (aName == *lengthListInfo.mLengthListInfo[i].mName) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
lengthListInfo.Reset(i);
return;
}
}
// Check if this is a number list attribute going away
NumberListAttributesInfo numberListInfo = GetNumberListInfo();
for (uint32_t i = 0; i < numberListInfo.mNumberListCount; i++) {
if (aName == *numberListInfo.mNumberListInfo[i].mName) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
numberListInfo.Reset(i);
return;
}
}
// Check if this is a point list attribute going away
if (GetPointListAttrName() == aName) {
SVGAnimatedPointList *pointList = GetAnimatedPointList();
if (pointList) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
pointList->ClearBaseValue();
return;
}
}
// Check if this is a path segment list attribute going away
if (GetPathDataAttrName() == aName) {
SVGAnimatedPathSegList *segList = GetAnimPathSegList();
if (segList) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
segList->ClearBaseValue();
return;
}
}
// Check if this is a number attribute going away
NumberAttributesInfo numInfo = GetNumberInfo();
for (uint32_t i = 0; i < numInfo.mNumberCount; i++) {
if (aName == *numInfo.mNumberInfo[i].mName) {
numInfo.Reset(i);
return;
}
}
// Check if this is a number pair attribute going away
NumberPairAttributesInfo numPairInfo = GetNumberPairInfo();
for (uint32_t i = 0; i < numPairInfo.mNumberPairCount; i++) {
if (aName == *numPairInfo.mNumberPairInfo[i].mName) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
numPairInfo.Reset(i);
return;
}
}
// Check if this is an integer attribute going away
IntegerAttributesInfo intInfo = GetIntegerInfo();
for (uint32_t i = 0; i < intInfo.mIntegerCount; i++) {
if (aName == *intInfo.mIntegerInfo[i].mName) {
intInfo.Reset(i);
return;
}
}
// Check if this is an integer pair attribute going away
IntegerPairAttributesInfo intPairInfo = GetIntegerPairInfo();
for (uint32_t i = 0; i < intPairInfo.mIntegerPairCount; i++) {
if (aName == *intPairInfo.mIntegerPairInfo[i].mName) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
intPairInfo.Reset(i);
return;
}
}
// Check if this is an angle attribute going away
AngleAttributesInfo angleInfo = GetAngleInfo();
for (uint32_t i = 0; i < angleInfo.mAngleCount; i++) {
if (aName == *angleInfo.mAngleInfo[i].mName) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
angleInfo.Reset(i);
return;
}
}
// Check if this is a boolean attribute going away
BooleanAttributesInfo boolInfo = GetBooleanInfo();
for (uint32_t i = 0; i < boolInfo.mBooleanCount; i++) {
if (aName == *boolInfo.mBooleanInfo[i].mName) {
boolInfo.Reset(i);
return;
}
}
// Check if this is an enum attribute going away
EnumAttributesInfo enumInfo = GetEnumInfo();
for (uint32_t i = 0; i < enumInfo.mEnumCount; i++) {
if (aName == *enumInfo.mEnumInfo[i].mName) {
enumInfo.Reset(i);
return;
}
}
// Check if this is a nsViewBox attribute going away
if (aName == nsGkAtoms::viewBox) {
nsSVGViewBox* viewBox = GetViewBox();
if (viewBox) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
viewBox->Init();
return;
}
}
// Check if this is a preserveAspectRatio attribute going away
if (aName == nsGkAtoms::preserveAspectRatio) {
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
if (preserveAspectRatio) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
preserveAspectRatio->Init();
return;
}
}
// Check if this is a transform list attribute going away
if (GetTransformListAttrName() == aName) {
nsSVGAnimatedTransformList *transformList = GetAnimatedTransformList();
if (transformList) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
transformList->ClearBaseValue();
return;
}
}
// Check for conditional processing attributes
nsCOMPtr<SVGTests> tests = do_QueryObject(this);
if (tests && tests->IsConditionalProcessingAttribute(aName)) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
tests->UnsetAttr(aName);
return;
}
// Check if this is a string list attribute going away
StringListAttributesInfo stringListInfo = GetStringListInfo();
for (uint32_t i = 0; i < stringListInfo.mStringListCount; i++) {
if (aName == *stringListInfo.mStringListInfo[i].mName) {
MaybeSerializeAttrBeforeRemoval(aName, aNotify);
stringListInfo.Reset(i);
return;
}
}
if (aName == nsGkAtoms::_class) {
mClassAttribute.Init();
return;
}
}
// Check if this is a string attribute going away
StringAttributesInfo stringInfo = GetStringInfo();
for (uint32_t i = 0; i < stringInfo.mStringCount; i++) {
if (aNamespaceID == stringInfo.mStringInfo[i].mNamespaceID &&
aName == *stringInfo.mStringInfo[i].mName) {
stringInfo.Reset(i);
return;
}
}
}
nsresult
nsSVGElement::UnsetAttr(int32_t aNamespaceID, nsIAtom* aName,
bool aNotify)
{
UnsetAttrInternal(aNamespaceID, aName, aNotify);
return nsSVGElementBase::UnsetAttr(aNamespaceID, aName, aNotify);
}
nsChangeHint
nsSVGElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsSVGElementBase::GetAttributeChangeHint(aAttribute, aModType);
nsCOMPtr<SVGTests> tests = do_QueryObject(const_cast<nsSVGElement*>(this));
if (tests && tests->IsConditionalProcessingAttribute(aAttribute)) {
// It would be nice to only reconstruct the frame if the value returned by
// SVGTests::PassesConditionalProcessingTests has changed, but we don't
// know that
NS_UpdateHint(retval, nsChangeHint_ReconstructFrame);
}
return retval;
}
bool
nsSVGElement::IsNodeOfType(uint32_t aFlags) const
{
return !(aFlags & ~eCONTENT);
}
NS_IMETHODIMP
nsSVGElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
{
#ifdef DEBUG
// printf("nsSVGElement(%p)::WalkContentStyleRules()\n", this);
#endif
if (!mContentStyleRule)
UpdateContentStyleRule();
if (mContentStyleRule) {
mContentStyleRule->RuleMatched();
aRuleWalker->Forward(mContentStyleRule);
}
return NS_OK;
}
void
nsSVGElement::WalkAnimatedContentStyleRules(nsRuleWalker* aRuleWalker)
{
// Update & walk the animated content style rule, to include style from
// animated mapped attributes. But first, get nsPresContext to check
// whether this is a "no-animation restyle". (This should match the check
// in nsHTMLCSSStyleSheet::RulesMatching(), where we determine whether to
// apply the SMILOverrideStyle.)
nsPresContext* context = aRuleWalker->PresContext();
nsIPresShell* shell = context->PresShell();
RestyleManager* restyleManager = context->RestyleManager();
if (restyleManager->SkipAnimationRules()) {
if (restyleManager->PostAnimationRestyles()) {
// Any style changes right now could trigger CSS Transitions. We don't
// want that to happen from SMIL-animated value of mapped attrs, so
// ignore animated value for now, and request an animation restyle to
// get our animated value noticed.
shell->RestyleForAnimation(this,
eRestyle_SVGAttrAnimations | eRestyle_ChangeAnimationPhase);
}
} else {
// Ok, this is an animation restyle -- go ahead and update/walk the
// animated content style rule.
css::StyleRule* animContentStyleRule = GetAnimatedContentStyleRule();
if (!animContentStyleRule) {
UpdateAnimatedContentStyleRule();
animContentStyleRule = GetAnimatedContentStyleRule();
}
if (animContentStyleRule) {
animContentStyleRule->RuleMatched();
aRuleWalker->Forward(animContentStyleRule);
}
}
}
NS_IMETHODIMP_(bool)
nsSVGElement::IsAttributeMapped(const nsIAtom* name) const
{
if (name == nsGkAtoms::lang) {
return true;
}
return nsSVGElementBase::IsAttributeMapped(name);
}
// PresentationAttributes-FillStroke
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sFillStrokeMap[] = {
{ &nsGkAtoms::fill },
{ &nsGkAtoms::fill_opacity },
{ &nsGkAtoms::fill_rule },
{ &nsGkAtoms::paint_order },
{ &nsGkAtoms::stroke },
{ &nsGkAtoms::stroke_dasharray },
{ &nsGkAtoms::stroke_dashoffset },
{ &nsGkAtoms::stroke_linecap },
{ &nsGkAtoms::stroke_linejoin },
{ &nsGkAtoms::stroke_miterlimit },
{ &nsGkAtoms::stroke_opacity },
{ &nsGkAtoms::stroke_width },
{ &nsGkAtoms::vector_effect },
{ nullptr }
};
// PresentationAttributes-Graphics
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sGraphicsMap[] = {
{ &nsGkAtoms::clip_path },
{ &nsGkAtoms::clip_rule },
{ &nsGkAtoms::colorInterpolation },
{ &nsGkAtoms::cursor },
{ &nsGkAtoms::display },
{ &nsGkAtoms::filter },
{ &nsGkAtoms::image_rendering },
{ &nsGkAtoms::mask },
{ &nsGkAtoms::opacity },
{ &nsGkAtoms::pointer_events },
{ &nsGkAtoms::shape_rendering },
{ &nsGkAtoms::text_rendering },
{ &nsGkAtoms::visibility },
{ nullptr }
};
// PresentationAttributes-TextContentElements
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sTextContentElementsMap[] = {
// Properties that we don't support are commented out.
// { &nsGkAtoms::alignment_baseline },
// { &nsGkAtoms::baseline_shift },
{ &nsGkAtoms::direction },
{ &nsGkAtoms::dominant_baseline },
// { &nsGkAtoms::glyph_orientation_horizontal },
// { &nsGkAtoms::glyph_orientation_vertical },
// { &nsGkAtoms::kerning },
{ &nsGkAtoms::letter_spacing },
{ &nsGkAtoms::text_anchor },
{ &nsGkAtoms::text_decoration },
{ &nsGkAtoms::unicode_bidi },
{ &nsGkAtoms::word_spacing },
{ nullptr }
};
// PresentationAttributes-FontSpecification
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sFontSpecificationMap[] = {
{ &nsGkAtoms::font_family },
{ &nsGkAtoms::font_size },
{ &nsGkAtoms::font_size_adjust },
{ &nsGkAtoms::font_stretch },
{ &nsGkAtoms::font_style },
{ &nsGkAtoms::font_variant },
{ &nsGkAtoms::fontWeight },
{ nullptr }
};
// PresentationAttributes-GradientStop
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sGradientStopMap[] = {
{ &nsGkAtoms::stop_color },
{ &nsGkAtoms::stop_opacity },
{ nullptr }
};
// PresentationAttributes-Viewports
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sViewportsMap[] = {
{ &nsGkAtoms::overflow },
{ &nsGkAtoms::clip },
{ nullptr }
};
// PresentationAttributes-Makers
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sMarkersMap[] = {
{ &nsGkAtoms::marker_end },
{ &nsGkAtoms::marker_mid },
{ &nsGkAtoms::marker_start },
{ nullptr }
};
// PresentationAttributes-Color
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sColorMap[] = {
{ &nsGkAtoms::color },
{ nullptr }
};
// PresentationAttributes-Filters
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sFiltersMap[] = {
{ &nsGkAtoms::colorInterpolationFilters },
{ nullptr }
};
// PresentationAttributes-feFlood
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sFEFloodMap[] = {
{ &nsGkAtoms::flood_color },
{ &nsGkAtoms::flood_opacity },
{ nullptr }
};
// PresentationAttributes-LightingEffects
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sLightingEffectsMap[] = {
{ &nsGkAtoms::lighting_color },
{ nullptr }
};
// PresentationAttributes-mask
/* static */ const Element::MappedAttributeEntry
nsSVGElement::sMaskMap[] = {
{ &nsGkAtoms::mask_type },
{ nullptr }
};
//----------------------------------------------------------------------
// nsIDOMElement methods
// forwarded to Element implementations
//----------------------------------------------------------------------
// nsIDOMSVGElement methods
/* readonly attribute nsIDOMSVGSVGElement ownerSVGElement; */
NS_IMETHODIMP
nsSVGElement::GetOwnerSVGElement(nsIDOMSVGElement * *aOwnerSVGElement)
{
NS_IF_ADDREF(*aOwnerSVGElement = GetOwnerSVGElement());
return NS_OK;
}
SVGSVGElement*
nsSVGElement::GetOwnerSVGElement()
{
return GetCtx(); // this may return nullptr
}
/* readonly attribute nsIDOMSVGElement viewportElement; */
NS_IMETHODIMP
nsSVGElement::GetViewportElement(nsIDOMSVGElement * *aViewportElement)
{
nsSVGElement* elem = GetViewportElement();
NS_ADDREF(*aViewportElement = elem);
return NS_OK;
}
nsSVGElement*
nsSVGElement::GetViewportElement()
{
return SVGContentUtils::GetNearestViewportElement(this);
}
already_AddRefed<SVGAnimatedString>
nsSVGElement::ClassName()
{
return mClassAttribute.ToDOMAnimatedString(this);
}
//------------------------------------------------------------------------
// Helper class: MappedAttrParser, for parsing values of mapped attributes
namespace {
class MOZ_STACK_CLASS MappedAttrParser {
public:
MappedAttrParser(css::Loader* aLoader,
nsIURI* aDocURI,
already_AddRefed<nsIURI> aBaseURI,
nsIPrincipal* aNodePrincipal);
~MappedAttrParser();
// Parses a mapped attribute value.
void ParseMappedAttrValue(nsIAtom* aMappedAttrName,
const nsAString& aMappedAttrValue);
// If we've parsed any values for mapped attributes, this method returns
// a new already_AddRefed css::StyleRule that incorporates the parsed
// values. Otherwise, this method returns null.
already_AddRefed<css::StyleRule> CreateStyleRule();
private:
// MEMBER DATA
// -----------
nsCSSParser mParser;
// Arguments for nsCSSParser::ParseProperty
nsIURI* mDocURI;
nsCOMPtr<nsIURI> mBaseURI;
nsIPrincipal* mNodePrincipal;
// Declaration for storing parsed values (lazily initialized)
css::Declaration* mDecl;
};
MappedAttrParser::MappedAttrParser(css::Loader* aLoader,
nsIURI* aDocURI,
already_AddRefed<nsIURI> aBaseURI,
nsIPrincipal* aNodePrincipal)
: mParser(aLoader), mDocURI(aDocURI), mBaseURI(aBaseURI),
mNodePrincipal(aNodePrincipal), mDecl(nullptr)
{
}
MappedAttrParser::~MappedAttrParser()
{
NS_ABORT_IF_FALSE(!mDecl,
"If mDecl was initialized, it should have been converted "
"into a style rule (and had its pointer cleared)");
}
void
MappedAttrParser::ParseMappedAttrValue(nsIAtom* aMappedAttrName,
const nsAString& aMappedAttrValue)
{
if (!mDecl) {
mDecl = new css::Declaration();
mDecl->InitializeEmpty();
}
// Get the nsCSSProperty ID for our mapped attribute.
nsCSSProperty propertyID =
nsCSSProps::LookupProperty(nsDependentAtomString(aMappedAttrName),
nsCSSProps::eEnabledForAllContent);
if (propertyID != eCSSProperty_UNKNOWN) {
bool changed; // outparam for ParseProperty. (ignored)
mParser.ParseProperty(propertyID, aMappedAttrValue, mDocURI, mBaseURI,
mNodePrincipal, mDecl, &changed, false, true);
return;
}
NS_ABORT_IF_FALSE(aMappedAttrName == nsGkAtoms::lang,
"Only 'lang' should be unrecognized!");
// nsCSSParser doesn't know about 'lang', so we need to handle it specially.
if (aMappedAttrName == nsGkAtoms::lang) {
propertyID = eCSSProperty__x_lang;
nsCSSExpandedDataBlock block;
mDecl->ExpandTo(&block);
nsCSSValue cssValue(PromiseFlatString(aMappedAttrValue), eCSSUnit_Ident);
block.AddLonghandProperty(propertyID, cssValue);
mDecl->ValueAppended(propertyID);
mDecl->CompressFrom(&block);
}
}
already_AddRefed<css::StyleRule>
MappedAttrParser::CreateStyleRule()
{
if (!mDecl) {
return nullptr; // No mapped attributes were parsed
}
nsRefPtr<css::StyleRule> rule = new css::StyleRule(nullptr, mDecl, 0, 0);
mDecl = nullptr; // We no longer own the declaration -- drop our pointer to it
return rule.forget();
}
} // anonymous namespace
//----------------------------------------------------------------------
// Implementation Helpers:
void
nsSVGElement::UpdateContentStyleRule()
{
NS_ASSERTION(!mContentStyleRule, "we already have a content style rule");
uint32_t attrCount = mAttrsAndChildren.AttrCount();
if (!attrCount) {
// nothing to do
return;
}
nsIDocument* doc = OwnerDoc();
MappedAttrParser mappedAttrParser(doc->CSSLoader(), doc->GetDocumentURI(),
GetBaseURI(), NodePrincipal());
for (uint32_t i = 0; i < attrCount; ++i) {
const nsAttrName* attrName = mAttrsAndChildren.AttrNameAt(i);
if (!attrName->IsAtom() || !IsAttributeMapped(attrName->Atom()))
continue;
if (attrName->NamespaceID() != kNameSpaceID_None &&
!attrName->Equals(nsGkAtoms::lang, kNameSpaceID_XML)) {
continue;
}
if (attrName->Equals(nsGkAtoms::lang, kNameSpaceID_None) &&
HasAttr(kNameSpaceID_XML, nsGkAtoms::lang)) {
continue; // xml:lang has precedence
}
if (Tag() == nsGkAtoms::svg) {
// Special case: we don't want <svg> 'width'/'height' mapped into style
// if the attribute value isn't a valid <length> according to SVG (which
// only supports a subset of the CSS <length> values). We don't enforce
// this by checking the attribute value in SVGSVGElement::
// IsAttributeMapped since we don't want that method to depend on the
// value of the attribute that is being checked. Rather we just prevent
// the actual mapping here, as necessary.
if (attrName->Atom() == nsGkAtoms::width &&
!GetAnimatedLength(nsGkAtoms::width)->HasBaseVal()) {
continue;
}
if (attrName->Atom() == nsGkAtoms::height &&
!GetAnimatedLength(nsGkAtoms::height)->HasBaseVal()) {
continue;
}
}
nsAutoString value;
mAttrsAndChildren.AttrAt(i)->ToString(value);
mappedAttrParser.ParseMappedAttrValue(attrName->Atom(), value);
}
mContentStyleRule = mappedAttrParser.CreateStyleRule();
}
static void
ParseMappedAttrAnimValueCallback(void* aObject,
nsIAtom* aPropertyName,
void* aPropertyValue,
void* aData)
{
MOZ_ASSERT(aPropertyName != SMIL_MAPPED_ATTR_STYLERULE_ATOM,
"animated content style rule should have been removed "
"from properties table already (we're rebuilding it now)");
MappedAttrParser* mappedAttrParser = static_cast<MappedAttrParser*>(aData);
MOZ_ASSERT(mappedAttrParser, "parser should be non-null");
nsStringBuffer* animValBuf = static_cast<nsStringBuffer*>(aPropertyValue);
MOZ_ASSERT(animValBuf, "animated value should be non-null");
nsString animValStr;
nsContentUtils::PopulateStringFromStringBuffer(animValBuf, animValStr);
mappedAttrParser->ParseMappedAttrValue(aPropertyName, animValStr);
}
// Callback for freeing animated content style rule, in property table.
static void
ReleaseStyleRule(void* aObject, /* unused */
nsIAtom* aPropertyName,
void* aPropertyValue,
void* aData /* unused */)
{
NS_ABORT_IF_FALSE(aPropertyName == SMIL_MAPPED_ATTR_STYLERULE_ATOM,
"unexpected property name, for "
"animated content style rule");
css::StyleRule* styleRule = static_cast<css::StyleRule*>(aPropertyValue);
NS_ABORT_IF_FALSE(styleRule, "unexpected null style rule");
styleRule->Release();
}
void
nsSVGElement::UpdateAnimatedContentStyleRule()
{
NS_ABORT_IF_FALSE(!GetAnimatedContentStyleRule(),
"Animated content style rule already set");
nsIDocument* doc = OwnerDoc();
if (!doc) {
NS_ERROR("SVG element without owner document");
return;
}
MappedAttrParser mappedAttrParser(doc->CSSLoader(), doc->GetDocumentURI(),
GetBaseURI(), NodePrincipal());
doc->PropertyTable(SMIL_MAPPED_ATTR_ANIMVAL)->
Enumerate(this, ParseMappedAttrAnimValueCallback, &mappedAttrParser);
nsRefPtr<css::StyleRule>
animContentStyleRule(mappedAttrParser.CreateStyleRule());
if (animContentStyleRule) {
#ifdef DEBUG
nsresult rv =
#endif
SetProperty(SMIL_MAPPED_ATTR_ANIMVAL,
SMIL_MAPPED_ATTR_STYLERULE_ATOM,
animContentStyleRule.get(),
ReleaseStyleRule);
unused << animContentStyleRule.forget();
NS_ABORT_IF_FALSE(rv == NS_OK,
"SetProperty failed (or overwrote something)");
}
}
css::StyleRule*
nsSVGElement::GetAnimatedContentStyleRule()
{
return
static_cast<css::StyleRule*>(GetProperty(SMIL_MAPPED_ATTR_ANIMVAL,
SMIL_MAPPED_ATTR_STYLERULE_ATOM,
nullptr));
}
/**
* Helper methods for the type-specific WillChangeXXX methods.
*
* This method sends out appropriate pre-change notifications so that selector
* restyles (e.g. due to changes that cause |elem[attr="val"]| to start/stop
* matching) work, and it returns an nsAttrValue that _may_ contain the
* attribute's pre-change value.
*
* The nsAttrValue returned by this method depends on whether there are
* mutation event listeners listening for changes to this element's attributes.
* If not, then the object returned is empty. If there are, then the
* nsAttrValue returned contains a serialized copy of the attribute's value
* prior to the change, and this object should be passed to the corresponding
* DidChangeXXX method call (assuming a WillChangeXXX call is required for the
* SVG type - see comment below). This is necessary so that the 'prevValue'
* property of the mutation event that is dispatched will correctly contain the
* old value.
*
* The reason we need to serialize the old value if there are mutation
* event listeners is because the underlying nsAttrValue for the attribute
* points directly to a parsed representation of the attribute (e.g. an
* SVGAnimatedLengthList*) that is a member of the SVG element. That object
* will have changed by the time DidChangeXXX has been called, so without the
* serialization of the old attribute value that we provide, DidChangeXXX
* would have no way to get the old value to pass to SetAttrAndNotify.
*
* We only return the old value when there are mutation event listeners because
* it's not needed otherwise, and because it's expensive to serialize the old
* value. This is especially true for list type attributes, which may be built
* up via the SVG DOM resulting in a large number of Will/DidModifyXXX calls
* before the script finally finishes setting the attribute.
*
* Note that unlike using SetParsedAttr, using Will/DidChangeXXX does NOT check
* and filter out redundant changes. Before calling WillChangeXXX, the caller
* should check whether the new and old values are actually the same, and skip
* calling Will/DidChangeXXX if they are.
*
* Also note that not all SVG types use this scheme. For types that can be
* represented by an nsAttrValue without pointing back to an SVG object (e.g.
* enums, booleans, integers) we can simply use SetParsedAttr which will do all
* of the above for us. For such types there is no matching WillChangeXXX
* method, only DidChangeXXX which calls SetParsedAttr.
*/
nsAttrValue
nsSVGElement::WillChangeValue(nsIAtom* aName)
{
// We need an empty attr value:
// a) to pass to BeforeSetAttr when GetParsedAttr returns nullptr
// b) to store the old value in the case we have mutation listeners
// We can use the same value for both purposes since (a) happens before (b).
// Also, we should be careful to always return this value to benefit from
// return value optimization.
nsAttrValue emptyOrOldAttrValue;
const nsAttrValue* attrValue = GetParsedAttr(aName);
// This is not strictly correct--the attribute value parameter for
// BeforeSetAttr should reflect the value that *will* be set but that implies
// allocating, e.g. an extra nsSVGLength2, and isn't necessary at the moment
// since no SVG elements overload BeforeSetAttr. For now we just pass the
// current value.
nsAttrValueOrString attrStringOrValue(attrValue ? *attrValue
: emptyOrOldAttrValue);
DebugOnly<nsresult> rv =
BeforeSetAttr(kNameSpaceID_None, aName, &attrStringOrValue,
kNotifyDocumentObservers);
// SVG elements aren't expected to overload BeforeSetAttr in such a way that
// it may fail. So long as this is the case we don't need to check and pass on
// the return value which simplifies the calling code significantly.
NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "Unexpected failure from BeforeSetAttr");
// We only need to set the old value if we have listeners since otherwise it
// isn't used.
if (attrValue &&
nsContentUtils::HasMutationListeners(this,
NS_EVENT_BITS_MUTATION_ATTRMODIFIED,
this)) {
emptyOrOldAttrValue.SetToSerialized(*attrValue);
}
uint8_t modType = attrValue
? static_cast<uint8_t>(nsIDOMMutationEvent::MODIFICATION)
: static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION);
nsNodeUtils::AttributeWillChange(this, kNameSpaceID_None, aName, modType);
return emptyOrOldAttrValue;
}
/**
* Helper methods for the type-specific DidChangeXXX methods.
*
* aEmptyOrOldValue will normally be the object returned from the corresponding
* WillChangeXXX call. This is because:
* a) WillChangeXXX will ensure the object is set when we have mutation
* listeners, and
* b) WillChangeXXX will ensure the object represents a serialized version of
* the old attribute value so that the value doesn't change when the
* underlying SVG type is updated.
*/
void
nsSVGElement::DidChangeValue(nsIAtom* aName,
const nsAttrValue& aEmptyOrOldValue,
nsAttrValue& aNewValue)
{
bool hasListeners =
nsContentUtils::HasMutationListeners(this,
NS_EVENT_BITS_MUTATION_ATTRMODIFIED,
this);
uint8_t modType = HasAttr(kNameSpaceID_None, aName)
? static_cast<uint8_t>(nsIDOMMutationEvent::MODIFICATION)
: static_cast<uint8_t>(nsIDOMMutationEvent::ADDITION);
SetAttrAndNotify(kNameSpaceID_None, aName, nullptr, aEmptyOrOldValue,
aNewValue, modType, hasListeners, kNotifyDocumentObservers,
kCallAfterSetAttr);
}
void
nsSVGElement::MaybeSerializeAttrBeforeRemoval(nsIAtom* aName, bool aNotify)
{
if (!aNotify ||
!nsContentUtils::HasMutationListeners(this,
NS_EVENT_BITS_MUTATION_ATTRMODIFIED,
this)) {
return;
}
const nsAttrValue* attrValue = mAttrsAndChildren.GetAttr(aName);
if (!attrValue)
return;
nsAutoString serializedValue;
attrValue->ToString(serializedValue);
nsAttrValue oldAttrValue(serializedValue);
mAttrsAndChildren.SetAndTakeAttr(aName, oldAttrValue);
}
/* static */
nsIAtom* nsSVGElement::GetEventNameForAttr(nsIAtom* aAttr)
{
if (aAttr == nsGkAtoms::onload)
return nsGkAtoms::onSVGLoad;
if (aAttr == nsGkAtoms::onunload)
return nsGkAtoms::onSVGUnload;
if (aAttr == nsGkAtoms::onresize)
return nsGkAtoms::onSVGResize;
if (aAttr == nsGkAtoms::onscroll)
return nsGkAtoms::onSVGScroll;
if (aAttr == nsGkAtoms::onzoom)
return nsGkAtoms::onSVGZoom;
if (aAttr == nsGkAtoms::onbegin)
return nsGkAtoms::onbeginEvent;
if (aAttr == nsGkAtoms::onrepeat)
return nsGkAtoms::onrepeatEvent;
if (aAttr == nsGkAtoms::onend)
return nsGkAtoms::onendEvent;
return aAttr;
}
SVGSVGElement *
nsSVGElement::GetCtx() const
{
nsIContent* ancestor = GetFlattenedTreeParent();
while (ancestor && ancestor->IsSVG()) {
nsIAtom* tag = ancestor->Tag();
if (tag == nsGkAtoms::foreignObject) {
return nullptr;
}
if (tag == nsGkAtoms::svg) {
return static_cast<SVGSVGElement*>(ancestor);
}
ancestor = ancestor->GetFlattenedTreeParent();
}
// we don't have an ancestor <svg> element...
return nullptr;
}
/* virtual */ gfxMatrix
nsSVGElement::PrependLocalTransformsTo(const gfxMatrix &aMatrix,
TransformTypes aWhich) const
{
return aMatrix;
}
nsSVGElement::LengthAttributesInfo
nsSVGElement::GetLengthInfo()
{
return LengthAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::LengthAttributesInfo::Reset(uint8_t aAttrEnum)
{
mLengths[aAttrEnum].Init(mLengthInfo[aAttrEnum].mCtxType,
aAttrEnum,
mLengthInfo[aAttrEnum].mDefaultValue,
mLengthInfo[aAttrEnum].mDefaultUnitType);
}
void
nsSVGElement::SetLength(nsIAtom* aName, const nsSVGLength2 &aLength)
{
LengthAttributesInfo lengthInfo = GetLengthInfo();
for (uint32_t i = 0; i < lengthInfo.mLengthCount; i++) {
if (aName == *lengthInfo.mLengthInfo[i].mName) {
lengthInfo.mLengths[i] = aLength;
DidAnimateLength(i);
return;
}
}
NS_ABORT_IF_FALSE(false, "no length found to set");
}
nsAttrValue
nsSVGElement::WillChangeLength(uint8_t aAttrEnum)
{
return WillChangeValue(*GetLengthInfo().mLengthInfo[aAttrEnum].mName);
}
void
nsSVGElement::DidChangeLength(uint8_t aAttrEnum,
const nsAttrValue& aEmptyOrOldValue)
{
LengthAttributesInfo info = GetLengthInfo();
NS_ASSERTION(info.mLengthCount > 0,
"DidChangeLength on element with no length attribs");
NS_ASSERTION(aAttrEnum < info.mLengthCount, "aAttrEnum out of range");
nsAttrValue newValue;
newValue.SetTo(info.mLengths[aAttrEnum], nullptr);
DidChangeValue(*info.mLengthInfo[aAttrEnum].mName, aEmptyOrOldValue,
newValue);
}
void
nsSVGElement::DidAnimateLength(uint8_t aAttrEnum)
{
ClearAnyCachedPath();
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
LengthAttributesInfo info = GetLengthInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mLengthInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
nsSVGLength2*
nsSVGElement::GetAnimatedLength(const nsIAtom *aAttrName)
{
LengthAttributesInfo lengthInfo = GetLengthInfo();
for (uint32_t i = 0; i < lengthInfo.mLengthCount; i++) {
if (aAttrName == *lengthInfo.mLengthInfo[i].mName) {
return &lengthInfo.mLengths[i];
}
}
NS_ABORT_IF_FALSE(false, "no matching length found");
return nullptr;
}
void
nsSVGElement::GetAnimatedLengthValues(float *aFirst, ...)
{
LengthAttributesInfo info = GetLengthInfo();
NS_ASSERTION(info.mLengthCount > 0,
"GetAnimatedLengthValues on element with no length attribs");
SVGSVGElement *ctx = nullptr;
float *f = aFirst;
uint32_t i = 0;
va_list args;
va_start(args, aFirst);
while (f && i < info.mLengthCount) {
uint8_t type = info.mLengths[i].GetSpecifiedUnitType();
if (!ctx) {
if (type != nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER &&
type != nsIDOMSVGLength::SVG_LENGTHTYPE_PX)
ctx = GetCtx();
}
if (type == nsIDOMSVGLength::SVG_LENGTHTYPE_EMS ||
type == nsIDOMSVGLength::SVG_LENGTHTYPE_EXS)
*f = info.mLengths[i++].GetAnimValue(this);
else
*f = info.mLengths[i++].GetAnimValue(ctx);
f = va_arg(args, float*);
}
va_end(args);
}
nsSVGElement::LengthListAttributesInfo
nsSVGElement::GetLengthListInfo()
{
return LengthListAttributesInfo(nullptr, nullptr, 0);
}
void
nsSVGElement::LengthListAttributesInfo::Reset(uint8_t aAttrEnum)
{
mLengthLists[aAttrEnum].ClearBaseValue(aAttrEnum);
// caller notifies
}
nsAttrValue
nsSVGElement::WillChangeLengthList(uint8_t aAttrEnum)
{
return WillChangeValue(*GetLengthListInfo().mLengthListInfo[aAttrEnum].mName);
}
void
nsSVGElement::DidChangeLengthList(uint8_t aAttrEnum,
const nsAttrValue& aEmptyOrOldValue)
{
LengthListAttributesInfo info = GetLengthListInfo();
NS_ASSERTION(info.mLengthListCount > 0,
"DidChangeLengthList on element with no length list attribs");
NS_ASSERTION(aAttrEnum < info.mLengthListCount, "aAttrEnum out of range");
nsAttrValue newValue;
newValue.SetTo(info.mLengthLists[aAttrEnum].GetBaseValue(), nullptr);
DidChangeValue(*info.mLengthListInfo[aAttrEnum].mName, aEmptyOrOldValue,
newValue);
}
void
nsSVGElement::DidAnimateLengthList(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
LengthListAttributesInfo info = GetLengthListInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mLengthListInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
void
nsSVGElement::GetAnimatedLengthListValues(SVGUserUnitList *aFirst, ...)
{
LengthListAttributesInfo info = GetLengthListInfo();
NS_ASSERTION(info.mLengthListCount > 0,
"GetAnimatedLengthListValues on element with no length list attribs");
SVGUserUnitList *list = aFirst;
uint32_t i = 0;
va_list args;
va_start(args, aFirst);
while (list && i < info.mLengthListCount) {
list->Init(&(info.mLengthLists[i].GetAnimValue()), this, info.mLengthListInfo[i].mAxis);
++i;
list = va_arg(args, SVGUserUnitList*);
}
va_end(args);
}
SVGAnimatedLengthList*
nsSVGElement::GetAnimatedLengthList(uint8_t aAttrEnum)
{
LengthListAttributesInfo info = GetLengthListInfo();
if (aAttrEnum < info.mLengthListCount) {
return &(info.mLengthLists[aAttrEnum]);
}
NS_NOTREACHED("Bad attrEnum");
return nullptr;
}
nsSVGElement::NumberListAttributesInfo
nsSVGElement::GetNumberListInfo()
{
return NumberListAttributesInfo(nullptr, nullptr, 0);
}
void
nsSVGElement::NumberListAttributesInfo::Reset(uint8_t aAttrEnum)
{
NS_ABORT_IF_FALSE(aAttrEnum < mNumberListCount, "Bad attr enum");
mNumberLists[aAttrEnum].ClearBaseValue(aAttrEnum);
// caller notifies
}
nsAttrValue
nsSVGElement::WillChangeNumberList(uint8_t aAttrEnum)
{
return WillChangeValue(*GetNumberListInfo().mNumberListInfo[aAttrEnum].mName);
}
void
nsSVGElement::DidChangeNumberList(uint8_t aAttrEnum,
const nsAttrValue& aEmptyOrOldValue)
{
NumberListAttributesInfo info = GetNumberListInfo();
NS_ABORT_IF_FALSE(info.mNumberListCount > 0,
"DidChangeNumberList on element with no number list attribs");
NS_ABORT_IF_FALSE(aAttrEnum < info.mNumberListCount,
"aAttrEnum out of range");
nsAttrValue newValue;
newValue.SetTo(info.mNumberLists[aAttrEnum].GetBaseValue(), nullptr);
DidChangeValue(*info.mNumberListInfo[aAttrEnum].mName, aEmptyOrOldValue,
newValue);
}
void
nsSVGElement::DidAnimateNumberList(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
NumberListAttributesInfo info = GetNumberListInfo();
NS_ABORT_IF_FALSE(aAttrEnum < info.mNumberListCount, "aAttrEnum out of range");
frame->AttributeChanged(kNameSpaceID_None,
*info.mNumberListInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
SVGAnimatedNumberList*
nsSVGElement::GetAnimatedNumberList(uint8_t aAttrEnum)
{
NumberListAttributesInfo info = GetNumberListInfo();
if (aAttrEnum < info.mNumberListCount) {
return &(info.mNumberLists[aAttrEnum]);
}
NS_ABORT_IF_FALSE(false, "Bad attrEnum");
return nullptr;
}
SVGAnimatedNumberList*
nsSVGElement::GetAnimatedNumberList(nsIAtom *aAttrName)
{
NumberListAttributesInfo info = GetNumberListInfo();
for (uint32_t i = 0; i < info.mNumberListCount; i++) {
if (aAttrName == *info.mNumberListInfo[i].mName) {
return &info.mNumberLists[i];
}
}
NS_ABORT_IF_FALSE(false, "Bad caller");
return nullptr;
}
nsAttrValue
nsSVGElement::WillChangePointList()
{
NS_ABORT_IF_FALSE(GetPointListAttrName(),
"Changing non-existent point list?");
return WillChangeValue(GetPointListAttrName());
}
void
nsSVGElement::DidChangePointList(const nsAttrValue& aEmptyOrOldValue)
{
NS_ABORT_IF_FALSE(GetPointListAttrName(),
"Changing non-existent point list?");
nsAttrValue newValue;
newValue.SetTo(GetAnimatedPointList()->GetBaseValue(), nullptr);
DidChangeValue(GetPointListAttrName(), aEmptyOrOldValue, newValue);
}
void
nsSVGElement::DidAnimatePointList()
{
NS_ABORT_IF_FALSE(GetPointListAttrName(),
"Animating non-existent path data?");
ClearAnyCachedPath();
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
frame->AttributeChanged(kNameSpaceID_None,
GetPointListAttrName(),
nsIDOMMutationEvent::MODIFICATION);
}
}
nsAttrValue
nsSVGElement::WillChangePathSegList()
{
NS_ABORT_IF_FALSE(GetPathDataAttrName(),
"Changing non-existent path seg list?");
return WillChangeValue(GetPathDataAttrName());
}
void
nsSVGElement::DidChangePathSegList(const nsAttrValue& aEmptyOrOldValue)
{
NS_ABORT_IF_FALSE(GetPathDataAttrName(),
"Changing non-existent path seg list?");
nsAttrValue newValue;
newValue.SetTo(GetAnimPathSegList()->GetBaseValue(), nullptr);
DidChangeValue(GetPathDataAttrName(), aEmptyOrOldValue, newValue);
}
void
nsSVGElement::DidAnimatePathSegList()
{
NS_ABORT_IF_FALSE(GetPathDataAttrName(),
"Animating non-existent path data?");
ClearAnyCachedPath();
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
frame->AttributeChanged(kNameSpaceID_None,
GetPathDataAttrName(),
nsIDOMMutationEvent::MODIFICATION);
}
}
nsSVGElement::NumberAttributesInfo
nsSVGElement::GetNumberInfo()
{
return NumberAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::NumberAttributesInfo::Reset(uint8_t aAttrEnum)
{
mNumbers[aAttrEnum].Init(aAttrEnum,
mNumberInfo[aAttrEnum].mDefaultValue);
}
void
nsSVGElement::DidChangeNumber(uint8_t aAttrEnum)
{
NumberAttributesInfo info = GetNumberInfo();
NS_ASSERTION(info.mNumberCount > 0,
"DidChangeNumber on element with no number attribs");
NS_ASSERTION(aAttrEnum < info.mNumberCount, "aAttrEnum out of range");
nsAttrValue attrValue;
attrValue.SetTo(info.mNumbers[aAttrEnum].GetBaseValue(), nullptr);
SetParsedAttr(kNameSpaceID_None, *info.mNumberInfo[aAttrEnum].mName, nullptr,
attrValue, true);
}
void
nsSVGElement::DidAnimateNumber(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
NumberAttributesInfo info = GetNumberInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mNumberInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
void
nsSVGElement::GetAnimatedNumberValues(float *aFirst, ...)
{
NumberAttributesInfo info = GetNumberInfo();
NS_ASSERTION(info.mNumberCount > 0,
"GetAnimatedNumberValues on element with no number attribs");
float *f = aFirst;
uint32_t i = 0;
va_list args;
va_start(args, aFirst);
while (f && i < info.mNumberCount) {
*f = info.mNumbers[i++].GetAnimValue();
f = va_arg(args, float*);
}
va_end(args);
}
nsSVGElement::NumberPairAttributesInfo
nsSVGElement::GetNumberPairInfo()
{
return NumberPairAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::NumberPairAttributesInfo::Reset(uint8_t aAttrEnum)
{
mNumberPairs[aAttrEnum].Init(aAttrEnum,
mNumberPairInfo[aAttrEnum].mDefaultValue1,
mNumberPairInfo[aAttrEnum].mDefaultValue2);
}
nsAttrValue
nsSVGElement::WillChangeNumberPair(uint8_t aAttrEnum)
{
return WillChangeValue(*GetNumberPairInfo().mNumberPairInfo[aAttrEnum].mName);
}
void
nsSVGElement::DidChangeNumberPair(uint8_t aAttrEnum,
const nsAttrValue& aEmptyOrOldValue)
{
NumberPairAttributesInfo info = GetNumberPairInfo();
NS_ASSERTION(info.mNumberPairCount > 0,
"DidChangePairNumber on element with no number pair attribs");
NS_ASSERTION(aAttrEnum < info.mNumberPairCount, "aAttrEnum out of range");
nsAttrValue newValue;
newValue.SetTo(info.mNumberPairs[aAttrEnum], nullptr);
DidChangeValue(*info.mNumberPairInfo[aAttrEnum].mName, aEmptyOrOldValue,
newValue);
}
void
nsSVGElement::DidAnimateNumberPair(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
NumberPairAttributesInfo info = GetNumberPairInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mNumberPairInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
nsSVGElement::IntegerAttributesInfo
nsSVGElement::GetIntegerInfo()
{
return IntegerAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::IntegerAttributesInfo::Reset(uint8_t aAttrEnum)
{
mIntegers[aAttrEnum].Init(aAttrEnum,
mIntegerInfo[aAttrEnum].mDefaultValue);
}
void
nsSVGElement::DidChangeInteger(uint8_t aAttrEnum)
{
IntegerAttributesInfo info = GetIntegerInfo();
NS_ASSERTION(info.mIntegerCount > 0,
"DidChangeInteger on element with no integer attribs");
NS_ASSERTION(aAttrEnum < info.mIntegerCount, "aAttrEnum out of range");
nsAttrValue attrValue;
attrValue.SetTo(info.mIntegers[aAttrEnum].GetBaseValue(), nullptr);
SetParsedAttr(kNameSpaceID_None, *info.mIntegerInfo[aAttrEnum].mName, nullptr,
attrValue, true);
}
void
nsSVGElement::DidAnimateInteger(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
IntegerAttributesInfo info = GetIntegerInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mIntegerInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
void
nsSVGElement::GetAnimatedIntegerValues(int32_t *aFirst, ...)
{
IntegerAttributesInfo info = GetIntegerInfo();
NS_ASSERTION(info.mIntegerCount > 0,
"GetAnimatedIntegerValues on element with no integer attribs");
int32_t *n = aFirst;
uint32_t i = 0;
va_list args;
va_start(args, aFirst);
while (n && i < info.mIntegerCount) {
*n = info.mIntegers[i++].GetAnimValue();
n = va_arg(args, int32_t*);
}
va_end(args);
}
nsSVGElement::IntegerPairAttributesInfo
nsSVGElement::GetIntegerPairInfo()
{
return IntegerPairAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::IntegerPairAttributesInfo::Reset(uint8_t aAttrEnum)
{
mIntegerPairs[aAttrEnum].Init(aAttrEnum,
mIntegerPairInfo[aAttrEnum].mDefaultValue1,
mIntegerPairInfo[aAttrEnum].mDefaultValue2);
}
nsAttrValue
nsSVGElement::WillChangeIntegerPair(uint8_t aAttrEnum)
{
return WillChangeValue(
*GetIntegerPairInfo().mIntegerPairInfo[aAttrEnum].mName);
}
void
nsSVGElement::DidChangeIntegerPair(uint8_t aAttrEnum,
const nsAttrValue& aEmptyOrOldValue)
{
IntegerPairAttributesInfo info = GetIntegerPairInfo();
NS_ASSERTION(info.mIntegerPairCount > 0,
"DidChangeIntegerPair on element with no integer pair attribs");
NS_ASSERTION(aAttrEnum < info.mIntegerPairCount, "aAttrEnum out of range");
nsAttrValue newValue;
newValue.SetTo(info.mIntegerPairs[aAttrEnum], nullptr);
DidChangeValue(*info.mIntegerPairInfo[aAttrEnum].mName, aEmptyOrOldValue,
newValue);
}
void
nsSVGElement::DidAnimateIntegerPair(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
IntegerPairAttributesInfo info = GetIntegerPairInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mIntegerPairInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
nsSVGElement::AngleAttributesInfo
nsSVGElement::GetAngleInfo()
{
return AngleAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::AngleAttributesInfo::Reset(uint8_t aAttrEnum)
{
mAngles[aAttrEnum].Init(aAttrEnum,
mAngleInfo[aAttrEnum].mDefaultValue,
mAngleInfo[aAttrEnum].mDefaultUnitType);
}
nsAttrValue
nsSVGElement::WillChangeAngle(uint8_t aAttrEnum)
{
return WillChangeValue(*GetAngleInfo().mAngleInfo[aAttrEnum].mName);
}
void
nsSVGElement::DidChangeAngle(uint8_t aAttrEnum,
const nsAttrValue& aEmptyOrOldValue)
{
AngleAttributesInfo info = GetAngleInfo();
NS_ASSERTION(info.mAngleCount > 0,
"DidChangeAngle on element with no angle attribs");
NS_ASSERTION(aAttrEnum < info.mAngleCount, "aAttrEnum out of range");
nsAttrValue newValue;
newValue.SetTo(info.mAngles[aAttrEnum], nullptr);
DidChangeValue(*info.mAngleInfo[aAttrEnum].mName, aEmptyOrOldValue, newValue);
}
void
nsSVGElement::DidAnimateAngle(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
AngleAttributesInfo info = GetAngleInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mAngleInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
nsSVGElement::BooleanAttributesInfo
nsSVGElement::GetBooleanInfo()
{
return BooleanAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::BooleanAttributesInfo::Reset(uint8_t aAttrEnum)
{
mBooleans[aAttrEnum].Init(aAttrEnum,
mBooleanInfo[aAttrEnum].mDefaultValue);
}
void
nsSVGElement::DidChangeBoolean(uint8_t aAttrEnum)
{
BooleanAttributesInfo info = GetBooleanInfo();
NS_ASSERTION(info.mBooleanCount > 0,
"DidChangeBoolean on element with no boolean attribs");
NS_ASSERTION(aAttrEnum < info.mBooleanCount, "aAttrEnum out of range");
nsAttrValue attrValue(info.mBooleans[aAttrEnum].GetBaseValueAtom());
SetParsedAttr(kNameSpaceID_None, *info.mBooleanInfo[aAttrEnum].mName, nullptr,
attrValue, true);
}
void
nsSVGElement::DidAnimateBoolean(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
BooleanAttributesInfo info = GetBooleanInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mBooleanInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
nsSVGElement::EnumAttributesInfo
nsSVGElement::GetEnumInfo()
{
return EnumAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::EnumAttributesInfo::Reset(uint8_t aAttrEnum)
{
mEnums[aAttrEnum].Init(aAttrEnum,
mEnumInfo[aAttrEnum].mDefaultValue);
}
void
nsSVGElement::DidChangeEnum(uint8_t aAttrEnum)
{
EnumAttributesInfo info = GetEnumInfo();
NS_ASSERTION(info.mEnumCount > 0,
"DidChangeEnum on element with no enum attribs");
NS_ASSERTION(aAttrEnum < info.mEnumCount, "aAttrEnum out of range");
nsAttrValue attrValue(info.mEnums[aAttrEnum].GetBaseValueAtom(this));
SetParsedAttr(kNameSpaceID_None, *info.mEnumInfo[aAttrEnum].mName, nullptr,
attrValue, true);
}
void
nsSVGElement::DidAnimateEnum(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
EnumAttributesInfo info = GetEnumInfo();
frame->AttributeChanged(kNameSpaceID_None,
*info.mEnumInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
nsSVGViewBox *
nsSVGElement::GetViewBox()
{
return nullptr;
}
nsAttrValue
nsSVGElement::WillChangeViewBox()
{
return WillChangeValue(nsGkAtoms::viewBox);
}
void
nsSVGElement::DidChangeViewBox(const nsAttrValue& aEmptyOrOldValue)
{
nsSVGViewBox *viewBox = GetViewBox();
NS_ASSERTION(viewBox, "DidChangeViewBox on element with no viewBox attrib");
nsAttrValue newValue;
newValue.SetTo(*viewBox, nullptr);
DidChangeValue(nsGkAtoms::viewBox, aEmptyOrOldValue, newValue);
}
void
nsSVGElement::DidAnimateViewBox()
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
frame->AttributeChanged(kNameSpaceID_None,
nsGkAtoms::viewBox,
nsIDOMMutationEvent::MODIFICATION);
}
}
SVGAnimatedPreserveAspectRatio *
nsSVGElement::GetPreserveAspectRatio()
{
return nullptr;
}
nsAttrValue
nsSVGElement::WillChangePreserveAspectRatio()
{
return WillChangeValue(nsGkAtoms::preserveAspectRatio);
}
void
nsSVGElement::DidChangePreserveAspectRatio(const nsAttrValue& aEmptyOrOldValue)
{
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
NS_ASSERTION(preserveAspectRatio,
"DidChangePreserveAspectRatio on element with no "
"preserveAspectRatio attrib");
nsAttrValue newValue;
newValue.SetTo(*preserveAspectRatio, nullptr);
DidChangeValue(nsGkAtoms::preserveAspectRatio, aEmptyOrOldValue, newValue);
}
void
nsSVGElement::DidAnimatePreserveAspectRatio()
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
frame->AttributeChanged(kNameSpaceID_None,
nsGkAtoms::preserveAspectRatio,
nsIDOMMutationEvent::MODIFICATION);
}
}
nsAttrValue
nsSVGElement::WillChangeTransformList()
{
return WillChangeValue(GetTransformListAttrName());
}
void
nsSVGElement::DidChangeTransformList(const nsAttrValue& aEmptyOrOldValue)
{
NS_ABORT_IF_FALSE(GetTransformListAttrName(),
"Changing non-existent transform list?");
// The transform attribute is being set, so we must ensure that the
// SVGAnimatedTransformList is/has been allocated:
nsAttrValue newValue;
newValue.SetTo(GetAnimatedTransformList(DO_ALLOCATE)->GetBaseValue(), nullptr);
DidChangeValue(GetTransformListAttrName(), aEmptyOrOldValue, newValue);
}
void
nsSVGElement::DidAnimateTransformList(int32_t aModType)
{
NS_ABORT_IF_FALSE(GetTransformListAttrName(),
"Animating non-existent transform data?");
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
nsIAtom *transformAttr = GetTransformListAttrName();
frame->AttributeChanged(kNameSpaceID_None,
transformAttr,
aModType);
// When script changes the 'transform' attribute, Element::SetAttrAndNotify
// will call nsNodeUtills::AttributeChanged, under which
// SVGTransformableElement::GetAttributeChangeHint will be called and an
// appropriate change event posted to update our frame's overflow rects.
// The SetAttrAndNotify doesn't happen for transform changes caused by
// 'animateTransform' though (and sending out the mutation events that
// nsNodeUtills::AttributeChanged dispatches would be inappropriate
// anyway), so we need to post the change event ourself.
nsChangeHint changeHint = GetAttributeChangeHint(transformAttr, aModType);
if (changeHint) {
nsLayoutUtils::PostRestyleEvent(this, nsRestyleHint(0), changeHint);
}
}
}
nsSVGElement::StringAttributesInfo
nsSVGElement::GetStringInfo()
{
return StringAttributesInfo(nullptr, nullptr, 0);
}
void nsSVGElement::StringAttributesInfo::Reset(uint8_t aAttrEnum)
{
mStrings[aAttrEnum].Init(aAttrEnum);
}
void nsSVGElement::GetStringBaseValue(uint8_t aAttrEnum, nsAString& aResult) const
{
nsSVGElement::StringAttributesInfo info = const_cast<nsSVGElement*>(this)->GetStringInfo();
NS_ASSERTION(info.mStringCount > 0,
"GetBaseValue on element with no string attribs");
NS_ASSERTION(aAttrEnum < info.mStringCount, "aAttrEnum out of range");
GetAttr(info.mStringInfo[aAttrEnum].mNamespaceID,
*info.mStringInfo[aAttrEnum].mName, aResult);
}
void nsSVGElement::SetStringBaseValue(uint8_t aAttrEnum, const nsAString& aValue)
{
nsSVGElement::StringAttributesInfo info = GetStringInfo();
NS_ASSERTION(info.mStringCount > 0,
"SetBaseValue on element with no string attribs");
NS_ASSERTION(aAttrEnum < info.mStringCount, "aAttrEnum out of range");
SetAttr(info.mStringInfo[aAttrEnum].mNamespaceID,
*info.mStringInfo[aAttrEnum].mName, aValue, true);
}
void
nsSVGElement::DidAnimateString(uint8_t aAttrEnum)
{
nsIFrame* frame = GetPrimaryFrame();
if (frame) {
StringAttributesInfo info = GetStringInfo();
frame->AttributeChanged(info.mStringInfo[aAttrEnum].mNamespaceID,
*info.mStringInfo[aAttrEnum].mName,
nsIDOMMutationEvent::MODIFICATION);
}
}
nsSVGElement::StringListAttributesInfo
nsSVGElement::GetStringListInfo()
{
return StringListAttributesInfo(nullptr, nullptr, 0);
}
nsAttrValue
nsSVGElement::WillChangeStringList(bool aIsConditionalProcessingAttribute,
uint8_t aAttrEnum)
{
nsIAtom* name;
if (aIsConditionalProcessingAttribute) {
nsCOMPtr<SVGTests> tests(do_QueryInterface(static_cast<nsIDOMSVGElement*>(this)));
name = tests->GetAttrName(aAttrEnum);
} else {
name = *GetStringListInfo().mStringListInfo[aAttrEnum].mName;
}
return WillChangeValue(name);
}
void
nsSVGElement::DidChangeStringList(bool aIsConditionalProcessingAttribute,
uint8_t aAttrEnum,
const nsAttrValue& aEmptyOrOldValue)
{
nsIAtom* name;
nsAttrValue newValue;
nsCOMPtr<SVGTests> tests;
if (aIsConditionalProcessingAttribute) {
tests = do_QueryObject(this);
name = tests->GetAttrName(aAttrEnum);
tests->GetAttrValue(aAttrEnum, newValue);
} else {
StringListAttributesInfo info = GetStringListInfo();
NS_ASSERTION(info.mStringListCount > 0,
"DidChangeStringList on element with no string list attribs");
NS_ASSERTION(aAttrEnum < info.mStringListCount, "aAttrEnum out of range");
name = *info.mStringListInfo[aAttrEnum].mName;
newValue.SetTo(info.mStringLists[aAttrEnum], nullptr);
}
DidChangeValue(name, aEmptyOrOldValue, newValue);
if (aIsConditionalProcessingAttribute) {
tests->MaybeInvalidate();
}
}
void
nsSVGElement::StringListAttributesInfo::Reset(uint8_t aAttrEnum)
{
mStringLists[aAttrEnum].Clear();
// caller notifies
}
nsresult
nsSVGElement::ReportAttributeParseFailure(nsIDocument* aDocument,
nsIAtom* aAttribute,
const nsAString& aValue)
{
const nsAFlatString& attributeValue = PromiseFlatString(aValue);
const char16_t *strings[] = { aAttribute->GetUTF16String(),
attributeValue.get() };
return SVGContentUtils::ReportToConsole(aDocument,
"AttributeParseWarning",
strings, ArrayLength(strings));
}
void
nsSVGElement::RecompileScriptEventListeners()
{
int32_t i, count = mAttrsAndChildren.AttrCount();
for (i = 0; i < count; ++i) {
const nsAttrName *name = mAttrsAndChildren.AttrNameAt(i);
// Eventlistenener-attributes are always in the null namespace
if (!name->IsAtom()) {
continue;
}
nsIAtom *attr = name->Atom();
if (!IsEventAttributeName(attr)) {
continue;
}
nsAutoString value;
GetAttr(kNameSpaceID_None, attr, value);
SetEventHandler(GetEventNameForAttr(attr), value, true);
}
}
nsISMILAttr*
nsSVGElement::GetAnimatedAttr(int32_t aNamespaceID, nsIAtom* aName)
{
if (aNamespaceID == kNameSpaceID_None) {
// We check mapped-into-style attributes first so that animations
// targeting width/height on outer-<svg> don't appear to be ignored
// because we returned a nsISMILAttr for the corresponding
// SVGAnimatedLength.
// Mapped attributes:
if (IsAttributeMapped(aName)) {
nsCSSProperty prop =
nsCSSProps::LookupProperty(nsDependentAtomString(aName),
nsCSSProps::eEnabledForAllContent);
// Check IsPropertyAnimatable to avoid attributes that...
// - map to explicitly unanimatable properties (e.g. 'direction')
// - map to unsupported attributes (e.g. 'glyph-orientation-horizontal')
if (nsSMILCSSProperty::IsPropertyAnimatable(prop)) {
return new nsSMILMappedAttribute(prop, this);
}
}
// Transforms:
if (GetTransformListAttrName() == aName) {
// The transform attribute is being animated, so we must ensure that the
// SVGAnimatedTransformList is/has been allocated:
return GetAnimatedTransformList(DO_ALLOCATE)->ToSMILAttr(this);
}
// Motion (fake 'attribute' for animateMotion)
if (aName == nsGkAtoms::mozAnimateMotionDummyAttr) {
return new SVGMotionSMILAttr(this);
}
// Lengths:
LengthAttributesInfo info = GetLengthInfo();
for (uint32_t i = 0; i < info.mLengthCount; i++) {
if (aName == *info.mLengthInfo[i].mName) {
return info.mLengths[i].ToSMILAttr(this);
}
}
// Numbers:
{
NumberAttributesInfo info = GetNumberInfo();
for (uint32_t i = 0; i < info.mNumberCount; i++) {
if (aName == *info.mNumberInfo[i].mName) {
return info.mNumbers[i].ToSMILAttr(this);
}
}
}
// Number Pairs:
{
NumberPairAttributesInfo info = GetNumberPairInfo();
for (uint32_t i = 0; i < info.mNumberPairCount; i++) {
if (aName == *info.mNumberPairInfo[i].mName) {
return info.mNumberPairs[i].ToSMILAttr(this);
}
}
}
// Integers:
{
IntegerAttributesInfo info = GetIntegerInfo();
for (uint32_t i = 0; i < info.mIntegerCount; i++) {
if (aName == *info.mIntegerInfo[i].mName) {
return info.mIntegers[i].ToSMILAttr(this);
}
}
}
// Integer Pairs:
{
IntegerPairAttributesInfo info = GetIntegerPairInfo();
for (uint32_t i = 0; i < info.mIntegerPairCount; i++) {
if (aName == *info.mIntegerPairInfo[i].mName) {
return info.mIntegerPairs[i].ToSMILAttr(this);
}
}
}
// Enumerations:
{
EnumAttributesInfo info = GetEnumInfo();
for (uint32_t i = 0; i < info.mEnumCount; i++) {
if (aName == *info.mEnumInfo[i].mName) {
return info.mEnums[i].ToSMILAttr(this);
}
}
}
// Booleans:
{
BooleanAttributesInfo info = GetBooleanInfo();
for (uint32_t i = 0; i < info.mBooleanCount; i++) {
if (aName == *info.mBooleanInfo[i].mName) {
return info.mBooleans[i].ToSMILAttr(this);
}
}
}
// Angles:
{
AngleAttributesInfo info = GetAngleInfo();
for (uint32_t i = 0; i < info.mAngleCount; i++) {
if (aName == *info.mAngleInfo[i].mName) {
return info.mAngles[i].ToSMILAttr(this);
}
}
}
// viewBox:
if (aName == nsGkAtoms::viewBox) {
nsSVGViewBox *viewBox = GetViewBox();
return viewBox ? viewBox->ToSMILAttr(this) : nullptr;
}
// preserveAspectRatio:
if (aName == nsGkAtoms::preserveAspectRatio) {
SVGAnimatedPreserveAspectRatio *preserveAspectRatio =
GetPreserveAspectRatio();
return preserveAspectRatio ?
preserveAspectRatio->ToSMILAttr(this) : nullptr;
}
// NumberLists:
{
NumberListAttributesInfo info = GetNumberListInfo();
for (uint32_t i = 0; i < info.mNumberListCount; i++) {
if (aName == *info.mNumberListInfo[i].mName) {
NS_ABORT_IF_FALSE(i <= UCHAR_MAX, "Too many attributes");
return info.mNumberLists[i].ToSMILAttr(this, uint8_t(i));
}
}
}
// LengthLists:
{
LengthListAttributesInfo info = GetLengthListInfo();
for (uint32_t i = 0; i < info.mLengthListCount; i++) {
if (aName == *info.mLengthListInfo[i].mName) {
NS_ABORT_IF_FALSE(i <= UCHAR_MAX, "Too many attributes");
return info.mLengthLists[i].ToSMILAttr(this,
uint8_t(i),
info.mLengthListInfo[i].mAxis,
info.mLengthListInfo[i].mCouldZeroPadList);
}
}
}
// PointLists:
{
if (GetPointListAttrName() == aName) {
SVGAnimatedPointList *pointList = GetAnimatedPointList();
if (pointList) {
return pointList->ToSMILAttr(this);
}
}
}
// PathSegLists:
{
if (GetPathDataAttrName() == aName) {
SVGAnimatedPathSegList *segList = GetAnimPathSegList();
if (segList) {
return segList->ToSMILAttr(this);
}
}
}
if (aName == nsGkAtoms::_class) {
return mClassAttribute.ToSMILAttr(this);
}
}
// Strings
{
StringAttributesInfo info = GetStringInfo();
for (uint32_t i = 0; i < info.mStringCount; i++) {
if (aNamespaceID == info.mStringInfo[i].mNamespaceID &&
aName == *info.mStringInfo[i].mName) {
return info.mStrings[i].ToSMILAttr(this);
}
}
}
return nullptr;
}
void
nsSVGElement::AnimationNeedsResample()
{
nsIDocument* doc = GetComposedDoc();
if (doc && doc->HasAnimationController()) {
doc->GetAnimationController()->SetResampleNeeded();
}
}
void
nsSVGElement::FlushAnimations()
{
nsIDocument* doc = GetComposedDoc();
if (doc && doc->HasAnimationController()) {
doc->GetAnimationController()->FlushResampleRequests();
}
}