<Swing Dev> RFR: 8260687: Inherited font size is smaller than expected when using StyleSheet to add styles [v3]
Alexander Zuev
kizune at openjdk.java.net
Thu Feb 11 22:33:39 UTC 2021
On Thu, 11 Feb 2021 22:28:48 GMT, Stanimir Stamenkov <github.com+1247730+stanio at openjdk.org> wrote:
>>> > I have copied the changes from the [aivanov-jdk/jdk at f9e9977](https://github.com/aivanov-jdk/jdk/commit/f9e997776fe4) branch earlier and made my revision to include the `font-size: 100%` case. I have the following adjustments that don't appear included in @aivanov-jdk's latest change:
>>> >
>>> > • The `<p style="font-size: 100%">...</p>` has to be before the `<p>...</p>` to trigger the pre-existing problem (f.e. in Java 11);
>>>
>>>
>>> I do not think the order matters. The paragraph which does not specify the font size and the paragraph which specifies it as 100% have the same size. This can be confirmed with another added check, does it make sense?
>>
>> Okay, the order does matter, it produces different results. With percentage value first, one more scenario is covered.
>>
>> The third comparison does not make sense. If the two not-equal-to conditions are false, `fontSizeInherited != fontSizePercentage` is also false.
>
>> I do not think the order matters...
>
> It doesn't matter just after the #1759 fix. If you try this with Java 11 or 15 you'll see the problem is present even before that fix. That's the point.
>
>> Does it not? I can't see it has much of difference: visually...
>
> That's the point, what you see visually is what you get from `GlyphView.getFont()` not necessarily what you get from `StyleConstants.getFontSize()` after the document has been completely laid out and the styles to all views computed. The latter depends on the last `CSS.styleSheet` state after the last style gets evaluated. This could be seen again by trying the test by having `<p style="font-size: 100%">` as the first element and Java 11, 15 – the test passes programmatically although visually it obviously failed.
Shouldn't you update copyright years in the headers of edited files?
-------------
PR: https://git.openjdk.java.net/jdk/pull/2515
More information about the swing-dev
mailing list