<Swing Dev> RFR: 8257664: HTMLEditorKit: Wrong CSS relative font sizes [v2]

Stanimir Stamenkov github.com+1247730+stanio at openjdk.java.net
Fri Jan 15 12:56:05 UTC 2021


On Fri, 15 Jan 2021 09:38:16 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Stanimir Stamenkov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fixup! 8257664: Fix font-size inheritance with percentage values
>>   
>>   -   Renamed bug8257665.java -> TestWrongCSSFontSize.java
>>   -   Added full copyright statement
>>   -   Removed redundant @key headless
>>   -   Corrected bug no. 8257665 -> 8257664
>
> src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java line 3423:
> 
>> 3421:      */
>> 3422:     static final Object FONT_SIZE_INHERIT =
>> 3423:             new CSS().new FontSize().parseCssValue("100%");
> 
> Do we need to instantiate new CSS object here? Can't we reuse "css" variable which is already initialized?

I hadn't previously realized the `ViewAttributeSet` class is not static, so it should be possible to reuse the instance `css`.  Not sure if a separate instance per style sheet is necessary, but I'll prepare a revision.

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

PR: https://git.openjdk.java.net/jdk/pull/1759


More information about the swing-dev mailing list