Closed Bug 722097 Opened 13 years ago Closed 11 years ago

Implement SVGLangSpace interface

Categories

(Core :: SVG, defect)

defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 824222

People

(Reporter: Jeremie, Unassigned)

References

()

Details

Attachments

(1 file)

bug #721920 propose to implement the lang attribute for SVG element in the same way as for HTML. Is it possible to consider implementing the SVGLangSpace interface as well?
I probably won't fix this at the same time, but it's good to have the bug filed. Thanks.
Assignee: nobody → longsonr
No longer depends on: 721920
Robert, there were some issues (forget the details) talked about in the SVG WG regarding this interface. I'm not sure we should implement it until those are revisited.
It's just a wrapper round setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", <value>) and getAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space") In fact it isolates you from whether SVG2 has xml:lang or lang as if you use this interface and we move from xml:lang to lang then we can update the implementation underneath.
Attached patch patchSplinter Review
Attachment #592536 - Flags: review?(jwatt)
We could make it in the spec so that .xmllang returns xml:lang="" or lang="". OTOH, I don't know that anyone in the world is using .xmllang. I think in the future we should have a .lang, just like HTML does. .xmlspace is probably less useful than xml:lang="", especially if we are moving away from it towards using the white-space property to control SVG text white space in SVG2.
I could remove xmlspace from the IDL and implementation and change xmllang in the IDL to lang. Setting the lang property would set the lang attribute in the null namespace. Getting the lang property would get the lang attribute in the null namespace. Would that suit you both?
I'm not sure yet. A couple of things worth noting. In HTML 'lang' is on the HTMLElement interface, and we should probably be consistent with HTML (maybe that means adding 'xmllang' to HTML though, since it supports 'xml:lang'). bz has been lamenting the fact that SVG IDL uses multiple inheritance, and how that's going to block the "replace quick-stubs" perf improvements he has planned for HTML.
lang is not relevant for animation elements for instance so it does make sense to have it like it is from a logic perspective.
(In reply to Jonathan Watt [:jwatt] from comment #7) > bz has been lamenting the fact that SVG IDL uses multiple inheritance, and > how that's going to block the "replace quick-stubs" perf improvements he has > planned for HTML. This will be fixed when I get around to rewriting SVG's IDL in Web IDL, where multiple inheritance is not possible. :)
And somehow I don't expect the HTML folks to like the idea of adding an xmllang property. The spec does allow xml:lang="" to be placed on any SVG element. (Which makes sense if you think of xml:lang="" as being something completely orthogonal to SVG.) HTML allows lang="" on any HTML element. Regarding whether it makes sense to allow lang="" on animation elements, you could have markup like: <svg ...> <animate lang="en" ...> <title>wibble wobble</title> </animate> </svg> I think in the end I want to see the spec just have something like interface SVGElement : Element { attribute DOMString lang; }; and not have anything for xml:space="". I guess if we're implementing lang="" on SVG elements before the spec has been changed, then we could just add this attribute now too (instead of SVGLangSpace).
Attachment #592536 - Flags: review?(jwatt)
Assignee: longsonr → nobody
Yeah, that makes sense to me.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: