web page background renders blue in JEditorPane

XMLWordPrintable

    • b10
    • x86_64
    • windows_7

        A DESCRIPTION OF THE PROBLEM :
        When displayed in JEditorPane, some web pages (ex: http://www.google.com/ ) have wrong background color (blue instead of white). This is related to https://bugs.openjdk.java.net/browse/JDK-4895924 "Strings in format #rgb not handled by Color.decode()"


        CUSTOMER SUBMITTED WORKAROUND :
        --- a/html/src/javax/swing/text/html/CSS.java
        +++ b/html/src/javax/swing/text/html/CSS.java
        @@ -1164,6 +1164,12 @@
                 } else {
                     digits = value;
                 }
        + if (digits.length() == 3) {
        + final String r = digits.substring(0, 1);
        + final String v = digits.substring(1, 2);
        + final String b = digits.substring(2, 3);
        + digits = String.format("%s%s%s%s%s%s", r, r, v, v, b, b);
        + }
                 String hstr = "0x" + digits;
                 Color c;
                 try {

        FREQUENCY : always


              Assignee:
              Prasanta Sadhukhan
              Reporter:
              Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: