From e0e84fd64c1a36f78a327bd030995bc9003f7136 Mon Sep 17 00:00:00 2001 From: Brandon Dail Date: Mon, 11 Feb 2019 21:12:40 -0800 Subject: [PATCH] Special case crossOrigin for SVG image elements --- packages/react-dom/src/shared/DOMProperty.js | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/react-dom/src/shared/DOMProperty.js b/packages/react-dom/src/shared/DOMProperty.js index f049205d199cc..3dd08203d4951 100644 --- a/packages/react-dom/src/shared/DOMProperty.js +++ b/packages/react-dom/src/shared/DOMProperty.js @@ -525,13 +525,15 @@ const capitalize = token => token[1].toUpperCase(); ); }); -// Special case: this attribute exists both in HTML and SVG. -// Its "tabindex" attribute name is case-sensitive in SVG so we can't just use -// its React `tabIndex` name, like we do for attributes that exist only in HTML. -properties.tabIndex = new PropertyInfoRecord( - 'tabIndex', - STRING, - false, // mustUseProperty - 'tabindex', // attributeName - null, // attributeNamespace -); +// These attribute exists both in HTML and SVG. +// The attribute name is case-sensitive in SVG so we can't just use +// the React name like we do for attributes that exist only in HTML. +['tabIndex', 'crossOrigin'].forEach(attributeName => { + properties[attributeName] = new PropertyInfoRecord( + attributeName, + STRING, + false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + ); +});