W3C home > Mailing lists > Public > public-webcgm-wg@w3.org > January 2009

RE: ISSUE: what does getStyleProperty return?

From: Weidenbrueck, Dieter <dweidenbrueck@ptc.com>
Date: Tue, 20 Jan 2009 02:51:06 -0500
Message-ID: <1A56AD0206CE2B4788D0A10F7B08FD8F066882A2@HQ-MAIL4.ptcnet.ptc.com>
To: "Lofton Henderson" <lofton@rockynet.com>, "David Cruikshank" <dvdcruikshank@gmail.com>
Cc: "WebCGM WG" <public-webcgm-wg@w3.org>


apparently a small but tricky question.


getStyleProperty could return a variety of things:


1.      The value used by setStyleProperty
This would ensure that a script writer could retrieve values set via the
DOM, and change them. There is an analogy to setTransform/getTransform
here IMO.
Open: what should the call return if there was no prior setStyleProperty
call, should it be null or an error?

2.      The computed resulting value on the object
This is also an interesting value, because it would tell the script
writer about the original state of an object (in case there was no prior
setStyleProperty call) and the resulting value.
Issue: if you get resulting values back there is no way to detect
whether this value was in the file, or whether it had been manipulated
by script.


I personally had always expected 1) because of the analogy to
transforms. Whatever you set you can get back. So the term "style
property" to me refers to the value set by the call, and not to detailed
CGM elements. In fact, it was always my intent to eliminate references
to specific CGM elements as much as possible, because no script writer
has a clue how CGM elements work. Example: there is no straight
equivalent to stroke-width in a CGM file, it affects a variety of


A small issue is the return value in cases where there is no common
value. This may always happen, no matter what getStyleProperty will
return. Typical for these cases is to return an error or a special value
indicating that there is no common value.






From: public-webcgm-wg-request@w3.org
[mailto:public-webcgm-wg-request@w3.org] On Behalf Of Lofton Henderson
Sent: Dienstag, 20. Januar 2009 01:17
To: David Cruikshank
Subject: Re: ISSUE: what does getStyleProperty return?


At 02:49 PM 1/19/2009 -0800, David Cruikshank wrote:

On the other hand there isn't any analogous value for raster
intensity...so it has to return the intensity value that was set.

Right.  But I don't see that as a problem, since there is only one mode
for setting raster intensity.

Responding to your initial idea, I think there is some logic to
returning the value in the mode that corresponds to how the CGM:1999
attributes are expressed.  But wait!  It is not as simple as it looks:

stroke-weight SP:  NVDC or % [as a multiplier on current line/edge
LINE/EDGE WIDTH cgm attribute:  VDC, or MM, or ScaleFactor (times
impl-dependent "nominal"), or % (of VDC extent).

The APS content in the metafile could have the line/edge width in one of
4 Specification Modes, and it would seem that you would have to select
VDC/NVDC arbitrarily as the "canonical" mode.  

But the stroke-weight % option might present a wrinkle that determines
the answer of this issue.  Consider this example.

line width 5mm;
line width 10mm;

If a DOM call sets stroke-weight to 10mm, then both polylines are 10mm.
But if it sets stroke-weight to 200%, then the first polyline is 10mm
and the second is 20mm.

In the latter case, getSP('stroke-weight') could NOT return an NVDC
value that was meaningful, right?  So I think the answer to the issue
needs to be:  return it in the mode in which it was set (or "empty
string" if the SP was never set).  

Does anyone see a way around this conclusion, that does not involve a
bunch of weird rules and tedious calculations?


On Mon, Jan 19, 2009 at 12:38 PM, David Cruikshank
<dvdcruikshank@gmail.com> wrote:

Just shooting from the hip here, but I would expect the return value to
correspond to the common value of the attribute in CGM.  We introduced
these "intensity" or percentage values WebCGM, but for simplicity I
think the return should probably be the value that makes sense when you
consider the same attribute value in CGM.

Just my thoughts.


On Mon, Jan 19, 2009 at 9:10 AM, Lofton Henderson <lofton@rockynet.com>

ISSUE:  does getStyleProperty have to return the SP in the same form in
which it was set?


Discussion:  Benoit asks the simple question, which we apparently have
never addressed...

At 10:59 AM 1/7/2009 -0500, Bezaire, Benoit wrote:

[....] I wonder if the implementation has to return the exact same
string that was used to set the attribute. 
Example for stroke-weight: setStyleProperty("stroke-weight", "200%"),
getStyleProperty("stroke-weight") returns 0.5 (assuming original was

Question 1:  do any of our past minutes or email address this?

Question 2:  has anyone implemented yet?  What have you implemented?

RECOMMENDATION:  (none yet.)

### end ###
Received on Tuesday, 20 January 2009 07:51:56 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:23:41 UTC