@samitouri / QOS-React-2 / commits / e3cf48cd7f

Added support for SVG clipPath element and clip-path attribute

codesuki committed Apr 18, 2015 at 18:23 UTC e3cf48cd7fd4fa543134a289d12783cce828b048
4 files changed +6 -2
docs/docs/ref-04-tags-and-attributes.md
+2 -2
@@ -30,7 +30,7 @@ thead time title tr track u ul var video wbr
30 The following SVG elements are supported:
31
32 ```
33 -circle defs ellipse g line linearGradient mask path pattern polygon polyline
33 +circle clipPath defs ellipse g line linearGradient mask path pattern polygon polyline
34 radialGradient rect stop svg text tspan
35 ```
36
@@ -77,7 +77,7 @@ There is also the React-specific attribute `dangerouslySetInnerHTML` ([more here
77 ### SVG Attributes
78
79 ```
80 -cx cy d dx dy fill fillOpacity fontFamily fontSize fx fy gradientTransform
80 +clip-path cx cy d dx dy fill fillOpacity fontFamily fontSize fx fy gradientTransform
81 gradientUnits markerEnd markerMid markerStart offset opacity
82 patternContentUnits patternUnits points preserveAspectRatio r rx ry
83 spreadMethod stopColor stopOpacity stroke strokeDasharray strokeLinecap
src/browser/ReactDOM.js
+1
@@ -153,6 +153,7 @@ var ReactDOM = mapObject({
153
154 // SVG
155 circle: 'circle',
156 + clipPath: 'clipPath',
157 defs: 'defs',
158 ellipse: 'ellipse',
159 g: 'g',
src/browser/ui/dom/SVGDOMPropertyConfig.js
+2
@@ -19,6 +19,7 @@ var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE;
19
20 var SVGDOMPropertyConfig = {
21 Properties: {
22 + clipPath: MUST_USE_ATTRIBUTE,
23 cx: MUST_USE_ATTRIBUTE,
24 cy: MUST_USE_ATTRIBUTE,
25 d: MUST_USE_ATTRIBUTE,
@@ -64,6 +65,7 @@ var SVGDOMPropertyConfig = {
65 y: MUST_USE_ATTRIBUTE
66 },
67 DOMAttributeNames: {
68 + clipPath: 'clip-path',
69 fillOpacity: 'fill-opacity',
70 fontFamily: 'font-family',
71 fontSize: 'font-size',
src/vendor/core/getMarkupWrap.js
+1
@@ -29,6 +29,7 @@ var shouldWrap = {
29 // Force wrapping for SVG elements because if they get created inside a <div>,
30 // they will be initialized in the wrong namespace (and will not display).
31 'circle': true,
32 + 'clipPath': true,
33 'defs': true,
34 'ellipse': true,
35 'g': true,