On Mon, 17 Nov 2025 21:46:06 GMT, Andy Goryachev <[email protected]> wrote:
> Requesting `VFlow` re-layout when signaled by a `Node` embedded in `TextCell`. > > > ### NOTES > > - this PR depends on https://github.com/openjdk/jfx/pull/1974 > - the fix can be verified visually using the latest Monkey Tester > > <img width="1232" height="741" alt="Screenshot 2025-11-17 at 13 43 12" > src="https://github.com/user-attachments/assets/58b2ef77-094c-45bd-8a04-3caaa4672df1" > /> modules/jfx.incubator.richtext/src/main/java/com/sun/jfx/incubator/scene/control/richtext/util/RichUtils.java line 751: > 749: // with the author's permission > 750: /** returns a parent of the specified type, or null. if node is an > instance of the specified class, returns node */ > 751: public static <T> T getAncestorOfClass(Class<T> c, Node node) { I would really recommend to not do anything like that. Normally, the layouting system, especially when requesting a layout should work and bubble up correctly. I wonder why this is needed. And if we found a special case, if we can solve it better. Background: In the past projects, I often saw code like that and it turned out that this was never needed. It is often less readable and hurts the performance a bit. We also improve coupling between components, which I would not recommend as well. Especially since subclasses can change a lot and it would be nice if everything still work out of the box. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1975#discussion_r2541102625
