Bug 46896

Summary: [PATCH] CSS Value constant for "text-align: start" contains wrong String constant
Product: Batik - Now in Jira Reporter: Stephen Drake <steve>
Component: CSSAssignee: Batik Developer's Mailing list <batik-dev>
Status: NEW ---    
Severity: trivial Keywords: PatchAvailable
Priority: P2    
Version: 1.8   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch to SVG12ValueConstants

Description Stephen Drake 2009-03-23 15:02:27 UTC
Created attachment 23402 [details]
Patch to SVG12ValueConstants

Value constants for the css property text-align, used in flowed text elements, are stored in the interface SVG12ValueConstants, and reference String constants from SVG12CSSConstants.  The constant START_VALUE references "full" instead "start".

To reproduce:
1) Look up the text-align property for an element:
    Value textAlignValue = CSSUtilities.getComputedStyle(element, SVG12CSSEngine.TEXT_ALIGN_INDEX);
2) Get the String value of the property:
    String textAlignStringValue = textAlignValue.getStringValue();
3) Test the value of the String - if the property was set in svg / css to "text-align: start" the result will be "full".  Other values give the expected result.

Instead of testing the String value eg:
    if (SVG12CSSConstants.CSS_START_VALUE.equals(textAlignStringValue)) ...
test the Value object, eg:
    if (SVG12ValueConstants.START_VALUE == textAlignValue) ...

Initial assessment:
I have submitted this with a severity of "trivial" because it doesn't affect Squiggle, or any other program that compares the actual Value objects instead of the String value within.  It could cause a bit of confusion when debugging though.