Skip to content

Commit

Permalink
Add xmlns to svg attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
salzhrani authored and samio committed Apr 18, 2016
1 parent dc6fc8c commit 0d6441e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/renderers/dom/shared/SVGDOMPropertyConfig.js
Expand Up @@ -271,6 +271,7 @@ var ATTRS = {
yChannelSelector: 'yChannelSelector',
z: 0,
zoomAndPan: 'zoomAndPan',
xmlns: 0,
};

var SVGDOMPropertyConfig = {
Expand Down
8 changes: 8 additions & 0 deletions src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js
Expand Up @@ -1281,5 +1281,13 @@ describe('ReactDOMComponent', function() {
ReactTestUtils.renderIntoDocument(<div onFocusOut={() => {}} />);
expect(console.error.argsForCall.length).toBe(2);
});
it('should set xmlns on svg if specified', function() {
var container = document.createElement('div');
ReactDOM.render(<svg xmlns="http://www.w3.org/2000/svg" />, container);
expect(container.firstChild.namespaceURI).toEqual('http://www.w3.org/2000/svg');
expect(container.firstChild.getAttribute('xmlns')).toEqual('http://www.w3.org/2000/svg');
ReactDOM.render(<svg />, container);
expect(container.firstChild.getAttribute('xmlns')).toEqual(null);
});
});
});

0 comments on commit 0d6441e

Please sign in to comment.