[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: JDK-8269921 TextFlow: listeners on bounds can throw NPE while computing text bounds [v5]
From:       Andy Goryachev <angorya () openjdk ! org>
Date:       2023-10-31 15:02:51
Message-ID: j3zgefmS-tCDwpapg7QbIZ4PjEjXzL1A_Jj6_TDmp4I=.d2938453-7ca9-406e-a896-48757a7c31db () github ! com
[Download RAW message or body]

On Tue, 31 Oct 2023 14:37:15 GMT, Kevin Rushforth <kcr@openjdk.org> wrote:

> > generally speaking - the behavior relating to the bounds is broken.
> > 
> > Some components behave differently, after setting a listener to the bounds.
> > 1.) Groups tend to call layout in the children.
> > 2.) And Text seems to call layout on it's parent TextFlow
> > Both cases are serious problems in my opinion - and this should be designed \
> > somehow differently. 
> > But for now, i would be happy if the affected applications don't crash by this \
> > bug here.
> 
> As long as we have some understanding of how `runs` can become null at this point \
> (which I think we do), then the current proposed fix seems fine to me. 
> Let's also file a follow-up bug to investigate whether we can make the computation \
> of bounds during layout more robust so that we don't have transiently wrong \
> results.

I've had a similar problem - solved by explicitly recomputing the layout if it was \
"dirty". In this case, it might be ok if the call to getSpanBounds with null runs is \
followed by another where runs are not null so the client code gets the valid bounds \
eventually.

But if it's not, the caller ends up with incorrect bounds.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/564#discussion_r1377732077


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic