<Swing Dev> [14] RFR 8226513:, JEditorPane is shown with incorrect size
Prasanta Sadhukhan
prasanta.sadhukhan at oracle.com
Thu Aug 8 09:23:54 UTC 2019
On 07-Aug-19 9:42 PM, Phil Race wrote:
> I have a minor quibble that "rootViewInitialized" is no longer a very
> appropriate variable name,
> since it is not just about initialization.
> Can we rename it to "rootViewNeedsLayout" ?
>
Renamed.
>
> Also because the windows 10 issue has a different cause, potentially
> this test can be adjusted
> to allow some tolerance to tell the difference between
> "not re-layed out at all", and "I'm a few pixels off in my expectations".
> ie the test should be about "did I relayout?", not "is my preferred
> size exactly the actual size?".
>
> Could this be a hi-dpi issue ? Are you running at 96 dpi or something
> else when this fails ?
>
Yes, it is. I have modified the jtreg command line to test in uiScale 1.
It now pass in windows and others and fails without the fix.
http://cr.openjdk.java.net/~psadhukhan/8226513/webrev.02/
Regards
Prasanta
>
> -phil.
>
>
> On 8/7/19 2:04 AM, Prasanta Sadhukhan wrote:
>>
>> I confirm that the test pass on linux and mac with the fix and fail
>> without the fix. Only on windows, it fails.
>>
>> But I also see that the failure is not because of the fix. The
>> "problem" was there even before the fix, for example with jdk13
>> (fails with jdk11, jdk12 too )
>>
>> jdk13-b24/bin/java JEditorPaneLayoutTest
>> Exception in thread "main" java.lang.RuntimeException: Wrong size
>> java.awt.Dimension[width=183,height=10] expected
>> java.awt.Dimension[width=177,height=44]
>> at JEditorPaneLayoutTest.main(JEditorPaneLayoutTest.java:84)
>>
>> which got somewhat improved by JDK-8217731
>> <https://bugs.openjdk.java.net/browse/JDK-8217731>
>>
>> jdk13-b25/bin/java JEditorPaneLayoutTest
>> Exception in thread "main" java.lang.RuntimeException: Wrong size
>> java.awt.Dimension[width=181,height=10] expected
>> java.awt.Dimension[width=180,height=44]
>> at JEditorPaneLayoutTest.main(JEditorPaneLayoutTest.java:84)
>>
>> So, the 1 pixel difference in width was there even before this fix
>> and also this fix fixes the height of the basic text component and
>> the unit tests of JBS works ok, so to me this fix looks ok to me.
>>
>> +1 for the fix from me and
>>
>> I have added the test to problem list only for windows to figure out
>> the 1 pixel difference in width which seems to be because of
>> layouting in windows.
>>
>> http://cr.openjdk.java.net/~psadhukhan/8226513/webrev.01/
>>
>> Regards
>> Prasanta
>> On 22-Jul-19 4:01 PM, Prasanta Sadhukhan wrote:
>>> Hi Semyon,
>>>
>>> Although the JBS testcase is passing with your change, your testcase
>>> is failing even with the fix for me in windows10
>>>
>>> java.lang.RuntimeException: Wrong size
>>> java.awt.Dimension[width=181,height=44] expected
>>> java.awt.Dimension[width=180,height=44]
>>> at JEditorPaneLayoutTest.main(JEditorPaneLayoutTest.java:84)
>>>
>>> Regards
>>>
>>> Prasanta
>>>
>>> On 17-Jul-19 1:33 AM, semyon.sadetsky at oracle.com wrote:
>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8226513
>>>>
>>>> webrev: http://cr.openjdk.java.net/~ssadetsky/8226513/webrev.00/
>>>>
>>>> The fix adds resetting the root view initialization flag when the
>>>> text component underling document is changed and also removes the
>>>> check for the zero component size for the root view initialization
>>>> to correct the resulting preferred component size in some scenarios
>>>> when the root view need to be initially layouted.
>>>>
>>>> --Semyon
>>>>
>>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20190808/0206d24b/attachment.html>
More information about the swing-dev
mailing list