Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend SVGAnimatedString with putForwards/stringifier WebIDL behaviors #546

Open
AmeliaBR opened this issue Sep 20, 2018 · 1 comment
Open

Comments

@AmeliaBR
Copy link
Contributor

As discussed in #175, this would help make SVGAnimatedString behave more like a simple DOMString, e.g. for SVGElement.className.

el.className += " new-class" would work by coercing the SVGAnimatedString to a simple string in order to concatenate it, and then setting the baseVal sub-property when the className property is set to a simple string.

(Not expecting this to happen for SVG 2.0, since we don't have implementations. Although @dstorey said he could make it happen in Edge.)

@AmeliaBR
Copy link
Contributor Author

See David's comment about implementation, from #175 (comment) :

I'll do another PR to add putForwards/stringifier. I can also implement in Edge. PutForward generates all the code needed automatically so that is a trivial change. stringifier should be straightforward too. At least on baseVal. If we want to add on SVGAElement (probably in href's mixin) to match HTMLAElement.toString() behaviour of returning the href string, then that will need a custom specified stringifier. I believe you do that in WebIDL by specifying new member stringifier and defining the behaviour in prose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant