RFR: 7083187: Class CSS.CssValue is missing implementations of equals() and hashCode() [v7]

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon May 22 09:53:52 UTC 2023


On Fri, 19 May 2023 16:19:20 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   hashCode fix
>
> src/java.desktop/share/classes/javax/swing/text/html/CSS.java line 2680:
> 
>> 2678:             if (percentage) {
>> 2679:                 return false;
>> 2680:             } else {
> 
> Why are percentage values never equal?
> 
> I expect two attribute sets produced from `"margin-top: 100%"` to be equal. However, the real length on rendering could be different if the attribute is applied to different elements.

I was not sure how to get the other value which is told in the spec where it says percentage needs another value to be passed in. Also checking for percentage equality resulted in regression in one closed test bug4690812.java so percentage equality was not handled.

https://github.com/openjdk/jdk/blob/8aa50288a1a6a853bf4d8d97b1849d5744ed7a32/src/java.desktop/share/classes/javax/swing/text/html/CSS.java#L2607-L2609

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13405#discussion_r1200275173



More information about the client-libs-dev mailing list