Skip to content

fix: Normalizes SVG attributeName attribute case#31

Closed
SkyZeroZx wants to merge 1 commit into
angular:mainfrom
SkyZeroZx:fix/casing-atrributename
Closed

fix: Normalizes SVG attributeName attribute case#31
SkyZeroZx wants to merge 1 commit into
angular:mainfrom
SkyZeroZx:fix/casing-atrributename

Conversation

@SkyZeroZx
Copy link
Copy Markdown

@SkyZeroZx SkyZeroZx commented Jun 4, 2026

Corrects the casing of the attributeName attribute for SVG elements. The SVG DOM typically expects attributeName to be camelCase. This change normalizes attributename (lowercase) to attributeName when calling setAttribute on SVG elements, ensuring consistent and spec-compliant behavior.

Includes a new test to validate this attribute name adjustment and its retrieval.

Fixed issue in angular/angular#69161

Corrects the casing of the `attributeName` attribute for SVG elements. The SVG DOM typically expects `attributeName` to be camelCase. This change normalizes `attributename` (lowercase) to `attributeName` when calling `setAttribute` on SVG elements, ensuring consistent and spec-compliant behavior.

Includes a new test to validate this attribute name adjustment and its retrieval.
Comment thread lib/Element.js

// Set the attribute without error checking. The parser uses this.
_setAttribute: { value: function _setAttribute(qname, value) {
if (this.namespaceURI === NAMESPACE.SVG) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been reviewing the code a bit more; could we possibly add it here?

domino/lib/svg.js

Lines 19 to 31 in a9e9e17

var SVGElement = define({
superclass: Element,
name: 'SVGElement',
ctor: function SVGElement(doc, localName, prefix) {
Element.call(this, doc, localName, utils.NAMESPACE.SVG, prefix);
},
props: {
style: { get: function() {
if (!this._style)
this._style = new CSSStyleDeclaration(this);
return this._style;
}}
}

@alan-agius4 alan-agius4 self-requested a review June 5, 2026 06:00
@alan-agius4
Copy link
Copy Markdown

Closing as per discussion in angular/angular#69161

@alan-agius4 alan-agius4 closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants