[
https://issues.apache.org/jira/browse/BATIK-1360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17782013#comment-17782013
]
Stanimir Stamenkov commented on BATIK-1360:
-------------------------------------------
Some references... The SVG 1.1 spec on the
[‘stroke-dasharray’|https://www.w3.org/TR/2011/REC-SVG11-20110816/painting.html#StrokeDasharrayProperty]
property:
bq. ... a list of comma and/or white space separated <length>s and
<percentage>s...
[<length>|https://www.w3.org/TR/2011/REC-SVG11-20110816/types.html#DataTypeLength]
further refers to
[<number>|https://www.w3.org/TR/2011/REC-SVG11-20110816/types.html#DataTypeNumber]
(note the CSS vs. SVG difference):
{quote}
Real numbers are specified in one of two ways. When used in a style sheet, a
<number> is defined as follows:
{noformat}
number ::= integer
| [+-]? [0-9]* "." [0-9]+
{noformat}
This syntax is the same as the definition in CSS ([CSS2], section 4.3.1).
When used in an SVG attribute, a <number> is defined differently, to allow
numbers with large magnitudes to be specified more concisely:
{noformat}
number ::= integer ([Ee] integer)?
| [+-]? [0-9]* "." [0-9]+ ([Ee] integer)?
{noformat}
{quote}
[CSS2
numbers|https://www.w3.org/TR/2011/REC-CSS2-20110607/syndata.html#numbers]:
bq. Real numbers and integers are specified in decimal notation only. An
<integer> consists of one or more digits "0" to "9". A <number> can either be
an <integer>, or it can be zero or more digits followed by a dot (.) followed
by one or more digits.
Compared to current [SVG2
draft|https://svgwg.org/svg2-draft/painting.html#StrokeDashing]:
bq. ... a list of comma and/or white space separated <number> or
<length-percentage> values.
Refers to [CSS3 numbers|https://www.w3.org/TR/css-values/#numbers]:
{quote}
Number values are denoted by <number>, and represent real numbers, possibly
with a fractional component.
When written literally, a number is either an integer, optionally, it can be
concluded by the letter “e” or “E” followed by an integer indicating the
base-ten exponent in scientific notation. It corresponds to the <number-token>
production in the CSS Syntax Module [CSS-SYNTAX-3].
{quote}
[Changes from CSS 2.1 and Selectors Level
3|https://www.w3.org/TR/css-syntax-3/#changes-css21]:
bq. Scientific notation is supported for numbers/percentages/dimensions to
match SVG, per WG resolution.
> Support parsing CSS stroke properties containing values with scientific
> notations
> ---------------------------------------------------------------------------------
>
> Key: BATIK-1360
> URL: https://issues.apache.org/jira/browse/BATIK-1360
> Project: Batik
> Issue Type: Improvement
> Components: CSS
> Reporter: Radu Coravu
> Priority: Major
>
> One of our end users gave us at some point an SVG which contained this piece
> of CSS inside it which breaks Batik:
> {code}stroke-dasharray:10.3913,5.1956,1.000000e-02,5.1956,1.000000e-02,5.1956;{code}
> I think the org.apache.batik.css.engine.value.LengthManager.createValue
> method needs to be made more flexible to read a value written in scientific
> notation and convert it to an integer.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]