You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Rufus Buschart <Ru...@rtc.bosch.com> on 2003/10/29 20:01:14 UTC

Problems with setProperty, getPropertyValue() and adding Attributes

Hello,

i tried to view the example from 
http://www.xml.com/pub/a/2002/09/11/quint.html in Squiggle. This example 
displays without any problem in the Adobe SVG-Viewer. But when I tried 
to view it in Squiggle, I found three major problems:

First problem (not very serious):
In line 151 and others: tspan.style.setProperty('word-spacing', space + 
'px'); Doesn't work. I had to change it into: 
tspan.style.setProperty('word-spacing', space + 'px', ""); Is this a bug 
in Rhino or is the ECMAScript Implementation by Adobe more sleazy?

Second problem (very serious):
The method style.getPropertyValue() (line 71ff) is not working always 
correctly. It works for:

this.setFontFamily( style.getPropertyValue('font-family') );
this.setFontSize( style.getPropertyValue('font-size') );
this.setTextRendering( style.getPropertyValue('text-rendering') );

but not for

style.getPropertyValue(''text-align') );
style.getPropertyValue(''line-interval') );

Whats this??

Third problem:
I can't add the same attribute twice to a element (lines 203 and 215). 
This is probably a bug in Rhino, because i do think, that the second 
attribute should overwrite the first.

Thanks,

Rufus

-- 
                             '""'"
                            ( o o )
-----------------------oOOo--(__)----oOOo-------------
Rufus J.W. Buschart                              BOSCH

Robert Bosch Corporation
Research and Technology Center
RTC
4009 Miranda Avenue
Palo Alto, CA 94304
United States
Phone: 650-320-2967
Fax: 650-320-2925



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Problems with setProperty, getPropertyValue() and adding Attributes

Posted by Thomas DeWeese <Th...@Kodak.com>.
Rufus Buschart wrote:

> Hello,
> 
> i tried to view the example from 
> http://www.xml.com/pub/a/2002/09/11/quint.html in Squiggle. This example 
> displays without any problem in the Adobe SVG-Viewer. But when I tried 
> to view it in Squiggle, I found three major problems:
> 
> First problem (not very serious):
> In line 151 and others: tspan.style.setProperty('word-spacing', space + 
> 'px'); Doesn't work. I had to change it into: 
> tspan.style.setProperty('word-spacing', space + 'px', ""); Is this a bug 
> in Rhino or is the ECMAScript Implementation by Adobe more sleazy?

    The CSS DOM specifies three parameters for this method.  Some have
argued that in EcmaScript you should accept only two treating the
third as "", make your own decision who is wrong - but Batik requires
three parameters.

> Second problem (very serious):
> The method style.getPropertyValue() (line 71ff) is not working always 
> correctly. It works for:
> 
> this.setFontFamily( style.getPropertyValue('font-family') );
> this.setFontSize( style.getPropertyValue('font-size') );
> this.setTextRendering( style.getPropertyValue('text-rendering') );
> 
> but not for
> 
> style.getPropertyValue(''text-align') );
> style.getPropertyValue(''line-interval') );

   I don't see 'text-align' or 'line-interval' as properties in the
SVG specification ;)

   Seriously I don't think this is good coding practice there is _lots_
of missing information for these unknown properties.  What is there type,
what is there default value, are they inheritable, what is the computed
value (for example '1.5em' is typically not a computed value - so these
are not Idle concerns).

> Whats this??
> 
> Third problem:
> I can't add the same attribute twice to a element (lines 203 and 215). 
> This is probably a bug in Rhino, because i do think, that the second 
> attribute should overwrite the first.

   It does it's just that the first time this is called this._y
is 'null' so your transform becomes "translate(10 )"  which is not a
valid transform.


> 
> Thanks,
> 
> Rufus
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org