Hi Prashanta, I have a question on the proposed solution. Shouldn’t one check 
for the color depth of the system like true color(24 bit) or high color 
system(12 bit or non-true color system) before applying this logic? Assuming 24 
bit color system isn't the right thing to do I think but again that may be 
mostly default these days. I also think we should receive the expanded form at 
the hexToColor() rather than expanding at this function. We should simply apply 
the received color at this lower function level I think.

Thanks and regards,
Shashi

-----Original Message-----
From: Prasanta Sadhukhan 
Sent: Thursday, February 21, 2019 2:04 PM
To: swing-dev@openjdk.java.net
Subject: <Swing Dev> [13] RFR JDK-8213781:web page background renders blue in 
JEditorPane

Hi All,

Please review a fix for an issue where it is seen that some webpage shows wrong 
background color when displayed in JEditorPane.

It seems that some webpage can have #rgb [as in #fff] as CSS attributes which 
when parsed and passed to hexToColor() it is decoded as 0x000fff resulting in 
primarily blue background instead of white as desired.
Now, hexToColor() is only able to handle 24 bit hex string as in #FFFFFF but 
not 12bit hexstring. So, fix is to make it recognize #fff and use
Color.decode() to decode it correctly to 0xffffff.

Bug: https://bugs.openjdk.java.net/browse/JDK-8213781
webrev: http://cr.openjdk.java.net/~psadhukhan/8213781/webrev.0/

Regards
Prasanta

Reply via email to