就业培训     下载中心     Wiki     联络
登录   注册

Log
  1. 首页
  2. SVG:可伸缩向量图形
  3. SVG Attribute reference
  4. requiredFeatures

内容表

  • 范例
  • 用法注意事项
  • Feature strings
  • 范例
  • 规范
  • 浏览器兼容性
  • 另请参阅

requiredFeatures

  1. SVG 元素
    1. A
      1. <a>
      2. <altGlyph>
      3. <altGlyphDef>
      4. <altGlyphItem>
      5. <animate>
      6. <animateColor>
      7. <animateMotion>
      8. <animateTransform>
    2. B-C
      1. <circle>
      2. <clipPath>
      3. <color-profile>
      4. <cursor>
    3. D
      1. <defs>
      2. <desc>
    4. E
      1. <ellipse>
    5. F
      1. <feBlend>
      2. <feColorMatrix>
      3. <feComponentTransfer>
      4. <feComposite>
      5. <feConvolveMatrix>
      6. <feDiffuseLighting>
      7. <feDisplacementMap>
      8. <feDistantLight>
      9. <feFlood>
      10. <feFuncA>
      11. <feFuncB>
      12. <feFuncG>
      13. <feFuncR>
      14. <feGaussianBlur>
      15. <feImage>
      16. <feMerge>
      17. <feMergeNode>
      18. <feMorphology>
      19. <feOffset>
      20. <fePointLight>
      21. <feSpecularLighting>
      22. <feSpotLight>
      23. <feTile>
      24. <feTurbulence>
      25. <filter>
      26. <font>
      27. <font-face>
      28. <font-face-format>
      29. <font-face-name>
      30. <font-face-src>
      31. <font-face-uri>
      32. <foreignObject>
    6. G
      1. <g>
      2. <glyph>
      3. <glyphRef>
    7. H
      1. <hkern>
    8. I
      1. <image>
    9. J-L
      1. <line>
      2. <linearGradient>
    10. M
      1. <marker>
      2. <mask>
      3. <metadata>
      4. <missing-glyph>
      5. <mpath>
    11. N-P
      1. <path>
      2. <pattern>
      3. <polygon>
      4. <polyline>
    12. Q-R
      1. <radialGradient>
      2. <rect>
    13. S
      1. <script>
      2. <set>
      3. <stop>
      4. <style>
      5. <svg>
      6. <switch>
      7. <symbol>
    14. T
      1. <text>
      2. <textPath>
      3. <title>
      4. <tref>
      5. <tspan>
    15. U
      1. <use>
    16. V-Z
      1. <view>
      2. <vkern>

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the 兼容性表格 at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

requiredFeatures attribute takes a list of feature strings, with the individual strings separated by white space. It determines whether or not all of the named features are supported by the browser; if all of them are supported, the attribute evaluates to true end the element is rendered; otherwise, the attribute evaluates to false and the current element and its children are skipped and thus will not be rendered. This provides a way to design SVG that gracefully falls back when features aren't available.

If the attribute is not present, then its implicit evaluated value is true . If a null string or empty string value is given to attribute requiredFeatures , the attribute is evaluate to false .

requiredFeatures is often used in conjunction with the <switch> element. If requiredFeatures is used in other situations, it represents a simple switch on the given element whether to render the element or not.

To detect availability of an SVG feature from script, there is the (also deprecated) DOMImplementation.hasFeature() 方法。

You can use this attribute with the following SVG elements:

  • <a>
  • <altGlyph>
  • <animate>
  • <animateColor>
  • <animateMotion>
  • <animateTransform>
  • <circle>
  • <clipPath>
  • <cursor>
  • <defs>
  • <ellipse>
  • <foreignObject>
  • <g>
  • <image>
  • <line>
  • <mask>
  • <path>
  • <pattern>
  • <polygon>
  • <polyline>
  • <rect>
  • <set>
  • <svg>
  • <switch>
  • <text>
  • <textPath>
  • <tref>
  • <tspan>
  • <use>

范例

html, body, svg {
  height: 100%;
}
text {
  fill: white;
}

											
<svg viewBox="0 0 250 45" xmlns="http://www.w3.org/2000/svg">
  <g>
    <rect fill="forestgreen" x="10" y="10" height="25" width="230" />
    <text x="20" y="27">requiredFeatures supported</text>
  </g>
  <g requiredFeatures="">
    <rect fill="crimson" x="10" y="10" height="25" width="230" />
    <text x="20" y="27">requiredFeatures not supported</text>
  </g>
</svg>

											

用法注意事项

值 <list-of-features>
默认值 true if not defined, false if null or empty string as value
Animatable No
<list-of-features>

This is a list of feature strings, separated using white space. Determines whether all of the named features are supported by the browser. See Feature strings below for a list of allowed values.

Feature strings

The following are the feature strings for the requiredFeatures attribute. These same feature strings apply to the hasFeature method call that is part of the SVG DOM's support for the DOMImplementation interface. In some cases the feature strings map directly to a set of attributes, properties or elements, in others they represent some functionality of the browser. Note that the format and naming for feature strings changed from SVG 1.0 to SVG 1.1. The SVG 1.0 feature strings are not listed here but can be found in the SVG Specification . Some browser support SVG 1.0 Feature strings for compatibility reasons. However, the SVG 1.0 feature strings are considered deprecated.

http://www.w3.org/TR/SVG11/feature#SVG

At least one of the following feature is supported:

  • http://www.w3.org/TR/SVG11/feature#SVG-static
  • http://www.w3.org/TR/SVG11/feature#SVG-animation
  • http://www.w3.org/TR/SVG11/feature#SVG-dynamic
  • http://www.w3.org/TR/SVG11/feature#SVGDOM
http://www.w3.org/TR/SVG11/feature#SVGDOM

At least one of the following feature is supported:

  • http://www.w3.org/TR/SVG11/feature#SVGDOM-static
  • http://www.w3.org/TR/SVG11/feature#SVGDOM-animation
  • http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic
http://www.w3.org/TR/SVG11/feature#SVG-static

The browser supports all the following features:

  • http://www.w3.org/TR/SVG11/feature#CoreAttribute
  • http://www.w3.org/TR/SVG11/feature#Structure
  • http://www.w3.org/TR/SVG11/feature#ContainerAttribute
  • http://www.w3.org/TR/SVG11/feature#ConditionalProcessing
  • http://www.w3.org/TR/SVG11/feature#Image
  • http://www.w3.org/TR/SVG11/feature#Style
  • http://www.w3.org/TR/SVG11/feature#ViewportAttribute
  • http://www.w3.org/TR/SVG11/feature#Shape
  • http://www.w3.org/TR/SVG11/feature#Text
  • http://www.w3.org/TR/SVG11/feature#PaintAttribute
  • http://www.w3.org/TR/SVG11/feature#OpacityAttribute
  • http://www.w3.org/TR/SVG11/feature#GraphicsAttribute
  • http://www.w3.org/TR/SVG11/feature#Marker
  • http://www.w3.org/TR/SVG11/feature#ColorProfile
  • http://www.w3.org/TR/SVG11/feature#Gradient
  • http://www.w3.org/TR/SVG11/feature#Pattern
  • http://www.w3.org/TR/SVG11/feature#Clip
  • http://www.w3.org/TR/SVG11/feature#Mask
  • http://www.w3.org/TR/SVG11/feature#Filter
  • http://www.w3.org/TR/SVG11/feature#XlinkAttribute
  • http://www.w3.org/TR/SVG11/feature#Font
  • http://www.w3.org/TR/SVG11/feature#Extensibility
http://www.w3.org/TR/SVG11/feature#SVGDOM-static

The browser supports all of the DOM interfaces and methods that correspond to the language features for http://www.w3.org/TR/SVG11/feature#SVG-static .

http://www.w3.org/TR/SVG11/feature#SVG-animation

The browser supports all of the language features from http://www.w3.org/TR/SVG11/feature#SVG-static plus the feature http://www.w3.org/TR/SVG11/feature#Animation .

http://www.w3.org/TR/SVG11/feature#SVGDOM-animation

The browser supports all of the DOM interfaces and methods that correspond to the language features for http://www.w3.org/TR/SVG11/feature#SVG-animation.

http://www.w3.org/TR/SVG11/feature#SVG-dynamic

The browser supports all of the language features from http://www.w3.org/TR/SVG11/feature#SVG-animation plus the following features:

  • http://www.w3.org/TR/SVG11/feature#Hyperlinking
  • http://www.w3.org/TR/SVG11/feature#Scripting
  • http://www.w3.org/TR/SVG11/feature#View
  • http://www.w3.org/TR/SVG11/feature#Cursor
  • http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute
  • http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute
  • http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute
http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic

The browser supports all of the DOM interfaces and methods that correspond to the language features for http://www.w3.org/TR/SVG11/feature#SVG-dynamic .

http://www.w3.org/TR/SVG11/feature#CoreAttribute

The browser supports the id , xml:base , xml:lang and xml:space 属性

http://www.w3.org/TR/SVG11/feature#Structure

The browser supports <svg> , <g> , <defs> , <desc> , <title> , <metadata> , <symbol> and <use> 元素。

http://www.w3.org/TR/SVG11/feature#BasicStructure

The browser supports <svg> , <g> , <defs> , <desc> , <title> , <metadata> and <use> 元素。

http://www.w3.org/TR/SVG11/feature#ContainerAttribute

The browser supports the enable-background 属性

http://www.w3.org/TR/SVG11/feature#ConditionalProcessing

The browser supports the <switch> element, and the requiredFeatures , requiredExtensions , systemLanguage 属性

http://www.w3.org/TR/SVG11/feature#Image

The browser supports the <image> 元素。

http://www.w3.org/TR/SVG11/feature#Style

The browser supports the <style> 元素。

http://www.w3.org/TR/SVG11/feature#ViewportAttribute

The browser supports the clip and overflow 属性。

http://www.w3.org/TR/SVG11/feature#Shape

The browser supports the <rect> , <circle> , <line> , <polyline> , <polygon> , <ellipse> and <path> 元素。

http://www.w3.org/TR/SVG11/feature#Text

The browser supports the <text> , <tspan> , <tref> , <textPath> , <altGlyph> , <altGlyphDef> , <altGlyphItem> and <glyphRef> 元素。

http://www.w3.org/TR/SVG11/feature#BasicText

The browser supports the <text> element

http://www.w3.org/TR/SVG11/feature#PaintAttribute

The browser supports the color , fill , fill-rule , stroke , stroke-dasharray , stroke-dashoffset , stroke-linecap , stroke-linejoin , stroke-miterlimit , stroke-width , color-interpolation and color-rendering 属性

http://www.w3.org/TR/SVG11/feature#BasicPaintAttribute

The browser supports the color , fill , fill-rule , stroke , stroke-dasharray , stroke-dashoffset , stroke-linecap , stroke-linejoin , stroke-miterlimit , stroke-width and color-rendering 属性

http://www.w3.org/TR/SVG11/feature#OpacityAttribute

The browser supports the opacity , stroke-opacity and fill-opacity 属性

http://www.w3.org/TR/SVG11/feature#GraphicsAttribute

The browser supports the display , image-rendering , pointer-events , shape-rendering , text-rendering and visibility 属性

http://www.w3.org/TR/SVG11/feature#BasicGraphicsAttribute

The browser supports the display and visibility 属性

http://www.w3.org/TR/SVG11/feature#Marker

The browser supports the <marker> element

http://www.w3.org/TR/SVG11/feature#Gradient

The browser supports the <linearGradient> , <radialGradient> and <stop> 元素

http://www.w3.org/TR/SVG11/feature#Pattern

The browser supports the <pattern> element

http://www.w3.org/TR/SVG11/feature#Clip

The browser supports the <clipPath> element and the clip-path , clip-rule 属性

http://www.w3.org/TR/SVG11/feature#BasicClip

The browser supports the <clipPath> element and the clip-path 属性

http://www.w3.org/TR/SVG11/feature#Mask

The browser supports the <mask> element

http://www.w3.org/TR/SVG11/feature#Filter

The browser supports the <filter> , <feBlend> , <feColorMatrix> , <feComponentTransfer> , <feComposite> , <feConvolveMatrix> , <feDiffuseLighting> , <feDisplacementMap> , <feFlood> , <feGaussianBlur> , <feImage> , <feMerge> , <feMergeNode> , <feMorphology> , <feOffset> , <feSpecularLighting> , <feTile> , <feDistantLight> , <fePointLight> , <feSpotLight> , <feFuncR> , <feFuncG> , <feFuncB> and <feFuncA> 元素

http://www.w3.org/TR/SVG11/feature#BasicFilter

The browser supports the <filter> , <feBlend> , <feColorMatrix> , <feComponentTransfer> , <feComposite> , <feFlood> , <feGaussianBlur> , <feImage> , <feMerge> , <feMergeNode> , <feOffset> , <feTile> , <feFuncR> , <feFuncG> , <feFuncB> and <feFuncA> 元素

http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute

The browser supports the onunload , onabort , onerror , onresize , onscroll and onzoom 属性

http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute

The browser supports the onfocusin , onfocusout , onactivate , onclick , onmousedown , onmouseup , onmouseover , onmousemove , onmouseout and onload 属性

http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute

The browser supports the onbegin , onend , onrepeat and onload 属性

http://www.w3.org/TR/SVG11/feature#Cursor

The browser supports the <cursor> element

http://www.w3.org/TR/SVG11/feature#Hyperlinking

The browser supports the <a> element

http://www.w3.org/TR/SVG11/feature#XlinkAttribute

The browser supports the xlink:type , xlink:href , xlink:role , xlink:arcrole , xlink:title , xlink:show and xlink:actuate 属性

http://www.w3.org/TR/SVG11/feature#View

The browser supports the <view> element

http://www.w3.org/TR/SVG11/feature#Script

The browser supports the <script> element

http://www.w3.org/TR/SVG11/feature#Animation

The browser supports the <animate> , <set> , <animateMotion> , <animateTransform> , <animateColor> and <mpath> 元素

http://www.w3.org/TR/SVG11/feature#Font

The browser supports the <font> , <font-face> , <glyph> , <missing-glyph> , <hkern> , <vkern> , <font-face-src> , <font-face-uri> , <font-face-format> and <font-face-name> 元素

http://www.w3.org/TR/SVG11/feature#BasicFont

The browser supports the <font> , <font-face> , <glyph> , <missing-glyph> , <hkern> , <font-face-src> and <font-face-name> 元素

http://www.w3.org/TR/SVG11/feature#Extensibility

The browser supports the <foreignObject> element

范例

SVG

<svg width="450" height="1170" xmlns="http://www.w3.org/2000/svg">
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#SVG -->
  <rect class="ko" x="10" y="10" height="25" width="430" />
  <rect class="ok" x="10" y="10" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#SVG" />
  <text x="20" y="27">http://www.w3.org/TR/SVG11/feature#SVG</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#SVGDOM -->
  <rect class="ko" x="10" y="35" height="25" width="430" />
  <rect class="ok" x="10" y="35" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#SVGDOM" />
  <text x="20" y="52">http://www.w3.org/TR/SVG11/feature#SVGDOM</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#SVG-static -->
  <rect class="ko" x="10" y="60" height="25" width="430" />
  <rect class="ok" x="10" y="60" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#SVG-static" />
  <text x="20" y="77">http://www.w3.org/TR/SVG11/feature#SVG-static</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#SVGDOM-static -->
  <rect class="ko" x="10" y="85" height="25" width="430" />
  <rect class="ok" x="10" y="85" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#SVGDOM-static" />
  <text x="20" y="102">http://www.w3.org/TR/SVG11/feature#SVGDOM-static</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#SVG-animation -->
  <rect class="ko" x="10" y="110" height="25" width="430" />
  <rect class="ok" x="10" y="110" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#SVG-animation" />
  <text x="20" y="127">http://www.w3.org/TR/SVG11/feature#SVG-animation</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#SVGDOM-animation -->
  <rect class="ko" x="10" y="135" height="25" width="430" />
  <rect class="ok" x="10" y="135" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#SVGDOM-animation" />
  <text x="20" y="152">http://www.w3.org/TR/SVG11/feature#SVGDOM-animation</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#SVG-dynamic -->
  <rect class="ko" x="10" y="160" height="25" width="430" />
  <rect class="ok" x="10" y="160" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#SVG-dynamic" />
  <text x="20" y="177">http://www.w3.org/TR/SVG11/feature#SVG-dynamic</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic -->
  <rect class="ko" x="10" y="185" height="25" width="430" />
  <rect class="ok" x="10" y="185" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic" />
  <text x="20" y="202">http://www.w3.org/TR/SVG11/feature#SVGDOM-dynamic</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#CoreAttribute -->
  <rect class="ko" x="10" y="210" height="25" width="430" />
  <rect class="ok" x="10" y="210" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#CoreAttribute" />
  <text x="20" y="227">http://www.w3.org/TR/SVG11/feature#CoreAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Structure -->
  <rect class="ko" x="10" y="235" height="25" width="430" />
  <rect class="ok" x="10" y="235" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Structure" />
  <text x="20" y="252">http://www.w3.org/TR/SVG11/feature#Structure</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#BasicStructure -->
  <rect class="ko" x="10" y="260" height="25" width="430" />
  <rect class="ok" x="10" y="260" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#BasicStructure" />
  <text x="20" y="277">http://www.w3.org/TR/SVG11/feature#BasicStructure</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#ContainerAttribute -->
  <rect class="ko" x="10" y="285" height="25" width="430" />
  <rect class="ok" x="10" y="285" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#ContainerAttribute" />
  <text x="20" y="302">http://www.w3.org/TR/SVG11/feature#ContainerAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#ConditionalProcessing -->
  <rect class="ko" x="10" y="310" height="25" width="430" />
  <rect class="ok" x="10" y="310" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#ConditionalProcessing" />
  <text x="20" y="327">http://www.w3.org/TR/SVG11/feature#ConditionalProcessing</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Image -->
  <rect class="ko" x="10" y="335" height="25" width="430" />
  <rect class="ok" x="10" y="335" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Image" />
  <text x="20" y="352">http://www.w3.org/TR/SVG11/feature#Image</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Style -->
  <rect class="ko" x="10" y="360" height="25" width="430" />
  <rect class="ok" x="10" y="360" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Style" />
  <text x="20" y="377">http://www.w3.org/TR/SVG11/feature#Style</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#ViewportAttribute -->
  <rect class="ko" x="10" y="385" height="25" width="430" />
  <rect class="ok" x="10" y="385" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#ViewportAttribute" />
  <text x="20" y="402">http://www.w3.org/TR/SVG11/feature#ViewportAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Shape -->
  <rect class="ko" x="10" y="410" height="25" width="430" />
  <rect class="ok" x="10" y="410" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Shape" />
  <text x="20" y="427">http://www.w3.org/TR/SVG11/feature#Shape</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Text -->
  <rect class="ko" x="10" y="435" height="25" width="430" />
  <rect class="ok" x="10" y="435" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Text" />
  <text x="20" y="452">http://www.w3.org/TR/SVG11/feature#Text</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#BasicText -->
  <rect class="ko" x="10" y="460" height="25" width="430" />
  <rect class="ok" x="10" y="460" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#BasicText" />
  <text x="20" y="477">http://www.w3.org/TR/SVG11/feature#BasicText</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#PaintAttribute -->
  <rect class="ko" x="10" y="485" height="25" width="430" />
  <rect class="ok" x="10" y="485" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#PaintAttribute" />
  <text x="20" y="502">http://www.w3.org/TR/SVG11/feature#PaintAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#BasicPaintAttribute -->
  <rect class="ko" x="10" y="510" height="25" width="430" />
  <rect class="ok" x="10" y="510" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#BasicPaintAttribute" />
  <text x="20" y="527">http://www.w3.org/TR/SVG11/feature#BasicPaintAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#OpacityAttribute -->
  <rect class="ko" x="10" y="535" height="25" width="430" />
  <rect class="ok" x="10" y="535" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#OpacityAttribute" />
  <text x="20" y="552">http://www.w3.org/TR/SVG11/feature#OpacityAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#GraphicsAttribute -->
  <rect class="ko" x="10" y="560" height="25" width="430" />
  <rect class="ok" x="10" y="560" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#GraphicsAttribute" />
  <text x="20" y="577">http://www.w3.org/TR/SVG11/feature#GraphicsAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#BasicGraphicsAttribute -->
  <rect class="ko" x="10" y="585" height="25" width="430" />
  <rect class="ok" x="10" y="585" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#BasicGraphicsAttribute" />
  <text x="20" y="602">http://www.w3.org/TR/SVG11/feature#BasicGraphicsAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Marker -->
  <rect class="ko" x="10" y="610" height="25" width="430" />
  <rect class="ok" x="10" y="610" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Marker" />
  <text x="20" y="627">http://www.w3.org/TR/SVG11/feature#Marker</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#ColorProfile -->
  <rect class="ko" x="10" y="635" height="25" width="430" />
  <rect class="ok" x="10" y="635" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#ColorProfile" />
  <text x="20" y="652">http://www.w3.org/TR/SVG11/feature#ColorProfile</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Gradient -->
  <rect class="ko" x="10" y="660" height="25" width="430" />
  <rect class="ok" x="10" y="660" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Gradient" />
  <text x="20" y="677">http://www.w3.org/TR/SVG11/feature#Gradient</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Pattern -->
  <rect class="ko" x="10" y="685" height="25" width="430" />
  <rect class="ok" x="10" y="685" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Pattern" />
  <text x="20" y="702">http://www.w3.org/TR/SVG11/feature#Pattern</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Clip -->
  <rect class="ko" x="10" y="710" height="25" width="430" />
  <rect class="ok" x="10" y="710" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Clip" />
  <text x="20" y="727">http://www.w3.org/TR/SVG11/feature#Clip</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#BasicClip -->
  <rect class="ko" x="10" y="735" height="25" width="430" />
  <rect class="ok" x="10" y="735" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#BasicClip" />
  <text x="20" y="752">http://www.w3.org/TR/SVG11/feature#BasicClip</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Mask -->
  <rect class="ko" x="10" y="760" height="25" width="430" />
  <rect class="ok" x="10" y="760" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Mask" />
  <text x="20" y="777">http://www.w3.org/TR/SVG11/feature#Mask</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Filter -->
  <rect class="ko" x="10" y="785" height="25" width="430" />
  <rect class="ok" x="10" y="785" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Filter" />
  <text x="20" y="802">http://www.w3.org/TR/SVG11/feature#Filter</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#BasicFilter -->
  <rect class="ko" x="10" y="810" height="25" width="430" />
  <rect class="ok" x="10" y="810" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#BasicFilter" />
  <text x="20" y="827">http://www.w3.org/TR/SVG11/feature#BasicFilter</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute -->
  <rect class="ko" x="10" y="835" height="25" width="430" />
  <rect class="ok" x="10" y="835" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute" />
  <text x="20" y="852">http://www.w3.org/TR/SVG11/feature#DocumentEventsAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute -->
  <rect class="ko" x="10" y="860" height="25" width="430" />
  <rect class="ok" x="10" y="860" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute" />
  <text x="20" y="877">http://www.w3.org/TR/SVG11/feature#GraphicalEventsAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute -->
  <rect class="ko" x="10" y="885" height="25" width="430" />
  <rect class="ok" x="10" y="885" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute" />
  <text x="20" y="902">http://www.w3.org/TR/SVG11/feature#AnimationEventsAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Cursor -->
  <rect class="ko" x="10" y="910" height="25" width="430" />
  <rect class="ok" x="10" y="910" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Cursor" />
  <text x="20" y="927">http://www.w3.org/TR/SVG11/feature#Cursor</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Hyperlinking -->
  <rect class="ko" x="10" y="935" height="25" width="430" />
  <rect class="ok" x="10" y="935" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Hyperlinking" />
  <text x="20" y="952">http://www.w3.org/TR/SVG11/feature#Hyperlinking</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#XlinkAttribute -->
  <rect class="ko" x="10" y="960" height="25" width="430" />
  <rect class="ok" x="10" y="960" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#XlinkAttribute" />
  <text x="20" y="977">http://www.w3.org/TR/SVG11/feature#XlinkAttribute</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#View -->
  <rect class="ko" x="10" y="1010" height="25" width="430" />
  <rect class="ok" x="10" y="1010" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#View" />
  <text x="20" y="1027">http://www.w3.org/TR/SVG11/feature#View</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Script -->
  <rect class="ko" x="10" y="1035" height="25" width="430" />
  <rect class="ok" x="10" y="1035" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Script" />
  <text x="20" y="1052">http://www.w3.org/TR/SVG11/feature#Script</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Animation -->
  <rect class="ko" x="10" y="1060" height="25" width="430" />
  <rect class="ok" x="10" y="1060" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Animation" />
  <text x="20" y="1077">http://www.w3.org/TR/SVG11/feature#Animation</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Font -->
  <rect class="ko" x="10" y="1085" height="25" width="430" />
  <rect class="ok" x="10" y="1085" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Font" />
  <text x="20" y="1102">http://www.w3.org/TR/SVG11/feature#Font</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#BasicFont -->
  <rect class="ko" x="10" y="1110" height="25" width="430" />
  <rect class="ok" x="10" y="1110" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#BasicFont" />
  <text x="20" y="1127">http://www.w3.org/TR/SVG11/feature#BasicFont</text>
  <!-- Testing : http://www.w3.org/TR/SVG11/feature#Extensibility -->
  <rect class="ko" x="10" y="1135" height="25" width="430" />
  <rect class="ok" x="10" y="1135" height="25" width="430"
        requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" />
  <text x="20" y="1152">http://www.w3.org/TR/SVG11/feature#Extensibility</text>
</svg>

						

CSS

.ko {
  fill: #900;
}
.ok {
  fill: #060;
}
rect {
  stroke: #000;
  stroke-width: 2px;
}
text{
  fill: #FFF;
  font: 12px sans-serif;
}

						

结果

另请参阅 requiredFeatures.svg

规范

规范 状态 注释
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of 'requiredFeatures' in that specification.
推荐 初始定义

浏览器兼容性

BCD tables only load in the browser

另请参阅

  • DOMImplementation.hasFeature()

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide .

最后修改: Jan 25, 2022 , 由 MDN 贡献者

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1