W3C home > Mailing lists > Public > www-svg@w3.org > January 2005

Re: ISSUE: current user space and <svg>

From: Jonathan Watt <jonathan.watt@strath.ac.uk>
Date: Tue, 11 Jan 2005 16:12:47 +0000
Message-ID: <41E3FAFF.1060103@strath.ac.uk>
To: www-svg@w3.org, Jon Ferraiolo <jon.ferraiolo@adobe.com>

Jon,

Thanks for replying. It would be useful if a statement could be added to 
the spec to clearly define "current user" coordinate system. I presume 
such clarification would/should be added to the errata? However, the 
concept of coordinate systems is fairly well understood, and I don't 
think this is the most important issue.

The spec frequently refers to the user coordinate system (singular) of 
an *element*. In the case where all of an element's attributes represent 
values in the same coordinate system, it is clear what the user 
coordinate system of *that element* is; but in the case of the 'svg', 
'symbol', 'marker', 'pattern' and 'view' elements, four of the element's 
attributes represent values in one coordinate system, and any others 
represent values in another. In this case, as you note, there are *two* 
"current user coordinate systems" for the element.

The real issue as I see it is that refering to the coordinate system 
(singular) of an *element* (either explicitly or implicitly) leads to 
ambiguity in the spec when used in the context of elements that may have 
a viewBox attribute.

I haven't had time to examine the spec to try to find all the places 
where such ambiguity arises as a result of this issue, but one such 
place is the sentence that describes the behaviour of the getCTM method 
of the SVGLocatable interface:

getCTM
"Returns the transformation matrix from current user units (i.e., after 
application of the transform attribute, if any) to the viewport 
coordinate system for the nearestViewportElement."

In the context of an 'svg' element say, this is ambiguous. The 
clarification that "user space" means the coordinate system established 
by the transform attribute is fairly redundant (although probably useful 
to leave for clarification) since elements that can have a transform 
attribute will only have one user coordinate system. What is really 
necessary, but omitted, is clarification on which user coordinate system 
is meant if a viewBox attribute is present. For our 'svg' element the 
spec leaves scope to argue that it's either the user coordinate system 
that exists before the viewBox attribute is applied (to which the x, y, 
width and hight attributes refer to), or to the user space that is 
established by the viewBox attribute (and to which any other attributes 
refer to).

I would very much like to see some discussion on what would be most 
useful, followed by a decision and clarification by the WG on what is 
meant in the case where a viewBox attribute is present. This ambiguity 
also exists for the other three methods of the interface of course. It 
would seem desirable that all the methods refer to the same user space 
when a viewBox attribute is present.

-Jonathan


Jon Ferraiolo wrote:
> Jonathan,
> The key thing is that there are often two "current user coordinate 
> systems" for a given element - the one before you process 'transform' or 
> 'viewBox' and the one after you process the transformations associated 
> with these attributes.
> 
> Section 7.4 of the SVG 1.1 spec 
> (http://www.w3.org/TR/SVG11/coords.html#EstablishingANewUserSpace) 
> includes the following snippet in the first paragraph:
> 
> ----------------------
> The transform <file://coords.html#TransformAttribute> and viewBox 
> <file://coords.html#ViewBoxAttribute> attributes transform user space 
> coordinates and lengths on sibling attributes on the given element (see 
> effect of the transform attribute on sibling attributes 
> <file://coords.html#TransformAttributeEffectOnSiblingAttributes> and 
> effect of the viewBox attribute on sibling attributes 
> <file://coords.html#ViewBoxAttributeEffectOnSiblingAttributes>) and all 
> of its descendants.
> ----------------------
> 
> and further on in the same section (if you follow the link to "effect of 
> the transform attribute on sibling attributes):
> ----------------------
> The transform attribute is applied to an element before processing any 
> other coordinate or length values supplied for that element. In the element
> 
> <rect x="10" y="10" width="20"
> height="20" transform="scale(2)"/>
> 
> the x, y, width and height values are processed after the current 
> coordinate system has been scaled uniformly by a factor of 2 by the 
> transform attribute
> ----------------------
> 
> However, I agree that it makes sense to add some additional 
> clarifications to the SVG spec.
> 
> Jon
> 
> At 09:19 AM 1/10/2005, Jonathan Watt wrote:
> 
>> SVG WG,
>>
>> What is the "current user coordinate system" for an element defined as 
>> (with emphesis on *current*, *user* and *element*)? Is it correct to 
>> say that it's the coordinate system refered to by the element's 
>> "coordinate" attributes (such as 'x' and 'y')?
>>
>> I'm specifically interested to know what the *current* user coordinate 
>> system is for an 'svg' element. Is it the user coordinate system that 
>> the element exists in (the one established by the 'svg' element's 
>> parent, and to which it's "coordinate" attributes refer to)? Or is it 
>> the user space it itself establishes via it's viewBox attribute?
>>
>> I don't believe this can be clearly answered from the contents of the 
>> specs.
>>
>> -Jonathan
Received on Tuesday, 11 January 2005 16:11:03 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:29 GMT