Bug 46896 - [PATCH] CSS Value constant for "text-align: start" contains wrong String constant
Summary: [PATCH] CSS Value constant for "text-align: start" contains wrong String cons...
Status: NEW
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: CSS (show other bugs)
Version: 1.8
Hardware: All All
: P2 trivial
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2009-03-23 15:02 UTC by Stephen Drake
Modified: 2009-03-24 02:30 UTC (History)
0 users



Attachments
Patch to SVG12ValueConstants (895 bytes, patch)
2009-03-23 15:02 UTC, Stephen Drake
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.

Workaround:
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.