Closed Bug 1526854 Opened 6 years ago Closed 6 years ago

Support crossorigin attribute on SVG elements

Categories

(Core :: SVG, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1240357

People

(Reporter: xidorn, Unassigned)

Details

It seems to me that crossorigin attribute is not supported on SVG elements like <image>.

This is part of the SVG 2.0 spec: https://svgwg.org/svg2-draft/embedded.html#ImageElementCrossoriginAttribute

Chrome seems to support it. Also it seems that Chrome's support is probably case-insensitive, that both crossorigin and crossOrigin seem to be working.

If that disagree with the spec, we may want to change the spec, because React would generate crossOrigin even for SVG, and they refused to change that because HTML attributes are case-insensitive, and that saves runtime work for it. See facebook/react#14216.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE

So, the statement that Chrome handles it case-insensitively is wrong. Chrome lower-cases the attribute name during parsing. However, if the attribute is added via setAttribute, it will be case-sensitive, and crossOrigin is not going to work, as I mentioned in the React bug.

You need to log in before you can comment on or make changes to this bug.