SVGPreserveAspectRatio
interface corresponds to the
preserveAspectRatio
attribute, which is available for some of SVG's elements.
An
SVGPreserveAspectRatio
object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.
| Also implement | None |
|---|---|
| 方法 | None |
| 特性 |
|
| 常量 |
|
| Normative document | SVG 1.1 (2nd Edition) |
| 名称 | 值 | 描述 |
|---|---|---|
SVG_
PRESERVEASPECTRATIO
_UNKNOWN
|
0 | The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. |
SVG_
PRESERVEASPECTRATIO
_NONE
|
1 |
Corresponds to value
none
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMINYMIN
|
2 |
Corresponds to value
xMinYMin
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMIDYMIN
|
3 |
Corresponds to value
xMidYMin
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMAXYMIN
|
4 |
Corresponds to value
xMaxYMin
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMINYMID
|
5 |
Corresponds to value
xMinYMid
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMIDYMID
|
6 |
Corresponds to value
xMidYMid
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMAXYMID
|
7 |
Corresponds to value
xMaxYMid
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMINYMAX
|
8 |
Corresponds to value
xMinYMax
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMIDYMAX
|
9 |
Corresponds to value
xMidYMax
for attribute
preserveAspectRatio
.
|
SVG_
PRESERVEASPECTRATIO
_XMAXYMAX
|
10 |
Corresponds to value
xMaxYMax
for attribute
preserveAspectRatio
.
|
SVG_MEETORSLICE_UNKNOWN
|
0 | The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type. |
SVG_MEETORSLICE_MEET
|
1 |
Corresponds to value
meet
for attribute
preserveAspectRatio
.
|
SVG_MEETORSLICE_SLICE
|
2 |
Corresponds to value
slice
for attribute
preserveAspectRatio
.
|
| 名称 | 类型 | 描述 |
|---|---|---|
align
|
unsigned short | The type of the alignment value as specified by one of the SVG_PRESERVEASPECTRATIO_* constants defined on this interface. |
meetOrSlice
|
unsigned short | The type of the meet-or-slice value as specified by one of the SVG_MEETORSLICE_* constants defined on this interface. |
Exceptions on setting:
a
DOMException
with code
NO_MODIFICATION_ALLOWED_ERR
is raised on an attempt to change the value of an attribute on a read only object.
SVGPreserveAspectRatio
interface do not provide any specific methods.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
SVGPreserveAspectRatio
|
Chrome Yes | Edge ≤18 | Firefox Yes | IE ? | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
兼容性未知
SVGPreserveAspectRatio
SVGAElement
SVGAltGlyphElement
SVGAngle
SVGAnimateColorElement
SVGAnimateElement
SVGAnimateMotionElement
SVGAnimateTransformElement
SVGAnimatedAngle
SVGAnimatedBoolean
SVGAnimatedEnumeration
SVGAnimatedInteger
SVGAnimatedLength
SVGAnimatedLengthList
SVGAnimatedNumber
SVGAnimatedNumberList
SVGAnimatedPathData
SVGAnimatedPoints
SVGAnimatedPreserveAspectRatio
SVGAnimatedRect
SVGAnimatedString
SVGAnimatedTransformList
SVGAnimationElement
SVGCircleElement
SVGClipPathElement
SVGComponentTransferFunctionElement
SVGCursorElement
SVGDefsElement
SVGDescElement
SVGDocument
SVGElement
SVGEllipseElement
SVGFEBlendElement
SVGFEColorMatrixElement
SVGFEComponentTransferElement
SVGFECompositeElement
SVGFEConvolveMatrixElement
SVGFEDiffuseLightingElement
SVGFEDisplacementMapElement
SVGFEDistantLightElement
SVGFEDropShadowElement
SVGFEFloodElement
SVGFEFuncAElement
SVGFEFuncBElement
SVGFEFuncGElement
SVGFEFuncRElement
SVGFEGaussianBlurElement
SVGFEImageElement
SVGFEMergeElement
SVGFEMergeNodeElement
SVGFEMorphologyElement
SVGFEOffsetElement
SVGFEPointLightElement
SVGFESpecularLightingElement
SVGFESpotLightElement
SVGFETileElement
SVGFETurbulenceElement
SVGFilterElement
SVGFilterPrimitiveStandardAttributes
SVGFitToViewBox
SVGFontElement
SVGFontFaceElement
SVGFontFaceFormatElement
SVGFontFaceNameElement
SVGFontFaceSrcElement
SVGFontFaceUriElement
SVGForeignObjectElement
SVGGElement
SVGGlyphElement
SVGGradientElement
SVGGraphicsElement
SVGHKernElement
SVGImageElement
SVGLength
SVGLengthList
SVGLineElement
SVGLinearGradientElement
SVGMPathElement
SVGMarkerElement
SVGMaskElement
SVGMatrix
SVGMetadataElement
SVGMissingGlyphElement
SVGNumber
SVGNumberList
SVGPathElement
SVGPathSeg
SVGPathSegArcAbs
SVGPathSegArcRel
SVGPathSegClosePath
SVGPathSegCurvetoCubicAbs
SVGPathSegCurvetoCubicRel
SVGPathSegCurvetoCubicSmoothAbs
SVGPathSegCurvetoCubicSmoothRel
SVGPathSegCurvetoQuadraticAbs
SVGPathSegCurvetoQuadraticRel
SVGPathSegCurvetoQuadraticSmoothAbs
SVGPathSegCurvetoQuadraticSmoothRel
SVGPathSegLinetoAbs
SVGPathSegLinetoHorizontalAbs
SVGPathSegLinetoHorizontalRel
SVGPathSegLinetoRel
SVGPathSegLinetoVerticalAbs
SVGPathSegLinetoVerticalRel
SVGPathSegList
SVGPathSegMovetoAbs
SVGPathSegMovetoRel
SVGPatternElement
SVGPoint
SVGPointList
SVGPolygonElement
SVGPolylineElement
SVGRadialGradientElement
SVGRect
SVGRectElement
SVGSVGElement
SVGScriptElement
SVGSetElement
SVGStopElement
SVGStringList
SVGStylable
SVGStyleElement
SVGSwitchElement
SVGSymbolElement
SVGTRefElement
SVGTSpanElement
SVGTests
SVGTextContentElement
SVGTextElement
SVGTextPathElement
SVGTextPositioningElement
SVGTitleElement
SVGTransform
SVGTransformList
SVGTransformable
SVGURIReference
SVGUnitTypes
SVGUseElement
SVGVKernElement
SVGViewElement
SVGZoomAndPan
SVGZoomEvent
TimeEvent