Hi All,

Please review a fix for the bug JDK-8218674: 
https://bugs.openjdk.java.net/browse/JDK-8218674 
<https://bugs.openjdk.java.net/browse/JDK-8218674>
Webrev: http://cr.openjdk.java.net/~kaddepalli/8218674/webrev00/ 
<http://cr.openjdk.java.net/~kaddepalli/8218674/webrev00/>

This is a regression introduced due to fix for JDK-8208638. The default 
behaviour for ImageView is to load an image asynchronously. Hence, it uses the 
ImageHandler::imageUpdate to get the updates to the image being loaded. That 
will set the width and height of the image view. ImageView::updateImageSize 
does not alter the width and height in this case. When a JToolTip is created 
and html text set as tooltip, internally, the image is requested to be loaded 
synchronously, and in this case, ImageView::updateImageSize is the only way to 
calculate the image size. Since the width and height were not specified in the 
tooltip, the image was not being drawn.
The fix is to check if the image is requested to be loaded synchronously, and 
if so, then do the same calculation as for the fix for JDK-8208638, which will 
provide valid image width and height, additionally also taking care of the 
scaling issues fixed for JDK-8208638.
I have tested the fix on Windows, Linux(Ubuntu) and Mac, and found that it is 
working. I have also run all the jtreg tests under the 
test/jdk/javax/swing/text/html, and found no new failures.

Thanks,
Krishna

Reply via email to