Previous fix to HTML in AquaButtonUI fixed spacing issue for HTML images in a 
JButton in Aqua L&F. The new issue comes from having text inside the HTML as 
the button's text. If an icon is used, this icon exceeds the bounds of the 
button and overlaps the border.

Added additional logic to check if HTML contains an img. If so, apply the 
previous fix. Otherwise, the original implementation for Aqua's JButton HTML 
layout works correctly, so use this behavior.

Added a test based on the provided test in the bug report. Automated the test 
using a BufferedImage and changed the icon color to RED. Tested with multiple 
runs on Aqua L&F, and the test passes with the update where it fails without 
the update.

-------------

Commit messages:
 - Fix whitespace error
 - Add ending line in test
 - Update AquaButton conditional. Add automated test for Aqua

Changes: https://git.openjdk.org/jdk/pull/12520/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12520&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8302173
  Stats: 174 lines in 2 files changed: 162 ins; 3 del; 9 mod
  Patch: https://git.openjdk.org/jdk/pull/12520.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12520/head:pull/12520

PR: https://git.openjdk.org/jdk/pull/12520

Reply via email to