On Tue, 14 Feb 2023 21:11:12 GMT, Damon Nguyen <dngu...@openjdk.org> wrote:
>> @DamonGuy Additionally, you might need to make sure the conditional and the >> fix works under different combinations especially when you have an html with >> `<img>` tag + icon, both added to the button. > > Yes, I tested with these combinations: > Icon with HTML image > <img width="274" alt="Screen Shot 2023-02-14 at 12 30 23 PM" > src="https://user-images.githubusercontent.com/96267980/218855067-68186106-77df-4c2b-81d7-2cd24e28f4bb.png"> > > Icon with HTML text > <img width="270" alt="Screen Shot 2023-02-14 at 1 10 28 PM" > src="https://user-images.githubusercontent.com/96267980/218863780-de2293ea-9da6-4db9-9201-4788b7567478.png"> > > And the `HtmlButtonImageTest` still passes as expected Looks good. I might have missed it earlier, adding an instanceof check makes it safer before calling getIcon(). What do you think? `if (v != null && c instanceof AbstractButton && ((AbstractButton) c).getIcon() == null)){` ------------- PR: https://git.openjdk.org/jdk/pull/12520