SVGUseElement

翻译正在进行中。

SVG使用DOM接口

SVGUseElement接口对应于<use>元素。

性质

此接口还从其父接口SVGGraphicsElement 继承属性,并从SVGURIReference实现属性。

SVGUseElement.x 只读
An SVGAnimatedLength corresponding to the x attribute of the given element.
SVGUseElement.y 只读
An SVGAnimatedLength corresponding to the y attribute of the given element.
SVGUseElement.width 只读
An SVGAnimatedLength corresponding to the width attribute of the given element.
SVGUseElement.height 只读
An SVGAnimatedLength corresponding to the height attribute of the given element.
SVGUseElement.instanceRoot 只读
An SVGElement corresponding to the instance root of the given element, which is a direct child of the elements shadow root. If the element does not have a shadow tree (for example, because its URI is invalid or because it has been disabled by conditional processing), then getting this attribute returns null.
SVGUseElement.animatedInstanceRoot 只读
An SVGElement corresponding to the instance root of the given element, which is a direct child of the elements shadow root. If the element does not have a shadow tree (for example, because its URI is invalid or because it has been disabled by conditional processing), then getting this attribute returns null.

Methods

This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGGraphicsElement and implements methods from SVGURIReference.

规范

Specification Status Comment
Scalable Vector Graphics (SVG) 2
SVGUseElement
Candidate Recommendation Redefined the properties instanceRoot and animatedInstanceRoot.
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
SVGUseElement
Recommendation Initial definition

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
SVGUseElementChrome Full support YesEdge Full support YesFirefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
animatedInstanceRootChrome No support NoEdge Full support 12Firefox ? IE ? Opera ? Safari ? WebView Android No support NoChrome Android No support NoFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android No support No
heightChrome Full support YesEdge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
instanceRootChrome No support NoEdge Full support 12Firefox ? IE ? Opera ? Safari ? WebView Android No support NoChrome Android No support NoFirefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android No support No
widthChrome Full support YesEdge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
xChrome Full support YesEdge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
yChrome Full support YesEdge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

参见