JDK-8213781 : web page background renders blue in JEditorPane
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10,7,8,9,10,11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2018-10-26
  • Updated: 2019-03-04
  • Resolved: 2019-02-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b10Fixed
Related Reports
Duplicate :  
Relates :  
Description
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



Comments
Webpage background renders blue in JEditorPane. The issue exists from the past (ref: JDK-4895924). Checked this for reported versions and could confirm the issue. Results: ========= 6u10: Fail 8u191: Fail 9: Fail 12 ea b19: Fail To verify, run the attached test case with respective JDK versions. Try outside OWAN. See Capture.png as reference.
13-11-2018