On Fri, 9 Oct 2026 18:49:38 GMT, Andy Goryachev <[email protected]> wrote:
>> modules/jfx.incubator.richtext/src/main/java/jfx/incubator/scene/control/richtext/model/StyledTextModel.java >> line 456: >> >>> 454: li.onContentChange(ch); >>> 455: } >>> 456: markers.update(start, end, charsTop, linesAdded, charsBottom); >> >> A listener that reads the marker will now see the old value rather than the >> new. This is a behavioral change that goes beyond image import. Is this a >> necessary part of adding support for importing images? If not, it should be >> reverted. If it is, it should be called out in the CSR. > > It was a bug discovered during the image import development. I will update > the `Marker` doc, I think it's ok to include this change in this PR, since > it's an incubator. This change might be OK given that it is intentional and you are documenting it. Are there cases where a change listener might want to read the new position? ChangeListeners handle this by passing in the old value, but I realize this isn't the same case. If you've thought this through, and this is the semantic behavior you want, then this is fine. It does highlight an implementation concern: if any listener throws an Exception, the marker position will not be updated. This means that an application bug or other problem in a listener could lead to stale markers, which I don't think is desirable. A preexisting problem is that an exception in one listener will prevent subsequent listeners from running. Both of these issues could be handled in a follow-up. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/2224#discussion_r4235483837
