Special case crossOrigin for SVG image elements (#14832)
Brandon Dail committed
Feb 12, 2019 at 20:13 UTC
fa6205d522a9d3e3f228be18dd29f11f8930c394
1 file changed
+12
-10
packages/react-dom/src/shared/DOMProperty.js
+12
-10
@@ -525,13 +525,15 @@ const capitalize = token => token[1].toUpperCase();
525
);
526
});
527
528
-// Special case: this attribute exists both in HTML and SVG.
529
-// Its "tabindex" attribute name is case-sensitive in SVG so we can't just use
530
-// its React `tabIndex` name, like we do for attributes that exist only in HTML.
531
-properties.tabIndex = new PropertyInfoRecord(
532
- 'tabIndex',
533
- STRING,
534
- false, // mustUseProperty
535
- 'tabindex', // attributeName
536
- null, // attributeNamespace
537
-);
528
+// These attribute exists both in HTML and SVG.
529
+// The attribute name is case-sensitive in SVG so we can't just use
530
+// the React name like we do for attributes that exist only in HTML.
531
+['tabIndex', 'crossOrigin'].forEach(attributeName => {
532
+ properties[attributeName] = new PropertyInfoRecord(
533
+ attributeName,
534
+ STRING,
535
+ false, // mustUseProperty
536
+ attributeName.toLowerCase(), // attributeName
537
+ null, // attributeNamespace
538
+ );
539
+});