mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Added support for SVG clipPath element and clip-path attribute
This commit is contained in:
@@ -30,7 +30,7 @@ thead time title tr track u ul var video wbr
|
||||
The following SVG elements are supported:
|
||||
|
||||
```
|
||||
circle defs ellipse g line linearGradient mask path pattern polygon polyline
|
||||
circle clipPath defs ellipse g line linearGradient mask path pattern polygon polyline
|
||||
radialGradient rect stop svg text tspan
|
||||
```
|
||||
|
||||
@@ -77,7 +77,7 @@ There is also the React-specific attribute `dangerouslySetInnerHTML` ([more here
|
||||
### SVG Attributes
|
||||
|
||||
```
|
||||
cx cy d dx dy fill fillOpacity fontFamily fontSize fx fy gradientTransform
|
||||
clip-path cx cy d dx dy fill fillOpacity fontFamily fontSize fx fy gradientTransform
|
||||
gradientUnits markerEnd markerMid markerStart offset opacity
|
||||
patternContentUnits patternUnits points preserveAspectRatio r rx ry
|
||||
spreadMethod stopColor stopOpacity stroke strokeDasharray strokeLinecap
|
||||
|
||||
@@ -153,6 +153,7 @@ var ReactDOM = mapObject({
|
||||
|
||||
// SVG
|
||||
circle: 'circle',
|
||||
clipPath: 'clipPath',
|
||||
defs: 'defs',
|
||||
ellipse: 'ellipse',
|
||||
g: 'g',
|
||||
|
||||
@@ -19,6 +19,7 @@ var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
|
||||
|
||||
var SVGDOMPropertyConfig = {
|
||||
Properties: {
|
||||
clipPath: MUST_USE_ATTRIBUTE,
|
||||
cx: MUST_USE_ATTRIBUTE,
|
||||
cy: MUST_USE_ATTRIBUTE,
|
||||
d: MUST_USE_ATTRIBUTE,
|
||||
@@ -64,6 +65,7 @@ var SVGDOMPropertyConfig = {
|
||||
y: MUST_USE_ATTRIBUTE
|
||||
},
|
||||
DOMAttributeNames: {
|
||||
clipPath: 'clip-path',
|
||||
fillOpacity: 'fill-opacity',
|
||||
fontFamily: 'font-family',
|
||||
fontSize: 'font-size',
|
||||
|
||||
Vendored
+1
@@ -29,6 +29,7 @@ var shouldWrap = {
|
||||
// Force wrapping for SVG elements because if they get created inside a <div>,
|
||||
// they will be initialized in the wrong namespace (and will not display).
|
||||
'circle': true,
|
||||
'clipPath': true,
|
||||
'defs': true,
|
||||
'ellipse': true,
|
||||
'g': true,
|
||||
|
||||
Reference in New Issue
Block a user