Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-898

[PATCH] CSS Value constant for "text-align: start" contains wrong String constant

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Resolution: Unresolved
    • 1.8
    • None
    • CSS
    • Operating System: All
      Platform: All

    Description

      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.

      Attachments

        1. text-align.patch
          0.9 kB
          Stephen Drake

        Activity

          People

            batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
            steve@drakenz.com Stephen Drake
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: