<Swing Dev> [9] Review request for 8058120: Rendering / caret errors with HTMLDocument

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Wed Oct 8 12:04:50 UTC 2014


   The fix looks good to me.

   Could you also test the fix with the JCK and regression tests?

   Thanks,
   Alexandr.

On 10/8/2014 2:08 PM, dmitry markov wrote:
> Hi Alexandr,
>
> Thank you for the review.
>
> HTMLDocument does not override getLength() method, so 
> AbstractDocument.getLength() is used. AbstractDocument.getLength() 
> returns one less than the length of the Content (see Java Docs for 
> more details). So if we add anything to the end of the document, we 
> can not position the caret before the inserted fragment without this 
> change. I do not think it should depend on insertInBody value.
>
> Thanks,
> Dmitry
> On 08/10/2014 12:29, Alexander Scherbatiy wrote:
>> On 10/8/2014 10:32 AM, dmitry markov wrote:
>>> Hello,
>>>
>>> Any volunteers to review the fix?
>>
>> Could you give more details about the change:
>> -------------
>> -                if (offset > getLength()) {
>> +                if (offset > (getLength() + 1)) {
>>                      offset--;
>>                  }
>> -------------
>>
>> Should it depend on the insertInBody value?
>>
>> Thanks,
>> Alexandr.
>>
>>>
>>> Thanks,
>>> Dmitry
>>>
>>> On 03/10/2014 09:58, dmitry markov wrote:
>>>> Hello,
>>>>
>>>> Friendly reminder... Could anyone review the fix, please?
>>>>
>>>> Thanks,
>>>> Dmitry
>>>> On 29/09/2014 11:10, dmitry markov wrote:
>>>>> Hello,
>>>>>
>>>>> Could you review the fix for jdk9, please?
>>>>>
>>>>>     bug: https://bugs.openjdk.java.net/browse/JDK-8058120
>>>>>     webrev: 
>>>>> http://cr.openjdk.java.net/~dmarkov/8058120/jdk9/webrev.00/
>>>>>
>>>>> Problem description: if some text (not wrapped by HTML tags) is 
>>>>> inserted via insertAfterEnd() method, the text is added directly 
>>>>> to the body of HTML document. This will cause incorrect 
>>>>> representation of added fragment.
>>>>> Fix: it is necessary to detect the insertion of the text to the 
>>>>> body and wrap the text by p-implied tags.
>>>>>
>>>>> Thanks,
>>>>> Dmitry
>>>>
>>>
>>
>




More information about the swing-dev mailing list