slint/internal/compiler
Simon Hausmann 3d2daf6073
Fix crash when editing text that's rendered using the Skia renderer (#1786)
Olivier found the following steps that reproduce the crash with Skia:

1. Open the gallery and select the "Text Edit" tab.
2. In the first text edit widget, select the first three letters.
3. Click into the second text edit (while the first one shows the selected text)
4. At the beginning of the text, insert the letter "ù" a few times.

This sequence would result in the cursor_position property get out of
sync.  Since it represents a byte offset in the utf-8 text, it would
point straight into a utf-8 sequence, resulting in a panic when the
renderer would try to create a slice of the selected text.

As a remedy, this patch renames the cursor_position and anchor_position
properties and provides wrapper getter accessors for use within the
TextInput to safely bound the stored offset.

Eventually we need to intercept changes to the text property and adjust
the cursor and anchor position properties accordingly, so that they
remain valid.  However this requires that the compiler is aware that a
property is not accessible directly but has a setter that needs to be
called instead.

This likely/hopefully also fixes #1707.
2022-10-27 21:47:14 +02:00
..
generator Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
LICENSES Fix LICENSES symlinks 2022-02-09 17:05:47 +01:00
llr Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
parser New syntax: allow to create component without base 2022-10-26 18:09:57 +02:00
parser-test-macro Bump version number to 0.3.1 2022-09-15 14:39:51 +02:00
passes New syntax: allow to create component without base 2022-10-26 18:09:57 +02:00
tests Test: fix the parser tests when running without SLINT_EXPERIMENTAL_SYNTAX defined 2022-10-27 13:06:40 +02:00
widgets Add support for fluent-light and fluent-dark styles 2022-10-26 13:30:09 +02:00
build.rs switch to yeslogic-fontconfig-sys from servo-fontconfig 2022-10-05 15:21:54 +02:00
builtin_macros.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
builtins.slint Fix crash when editing text that's rendered using the Skia renderer (#1786) 2022-10-27 21:47:14 +02:00
Cargo.toml Bump various dependencies 2022-10-26 18:01:29 +02:00
diagnostics.rs LSP: fetch the file content from cache instead of from disk to compute the line number 2022-06-02 21:45:50 +02:00
embedded_resources.rs swrenderer: Optimize image drawing by using premultiplied colors 2022-06-14 11:23:02 +02:00
expression_tree.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
fileaccess.rs Scan for style files in the include directories 2022-02-15 13:55:50 +01:00
generator.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
langtype.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
layout.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
lexer.rs Update copyright information to reflect name change 2022-02-09 10:27:47 +01:00
lib.rs Move the mcu backend to become a board support helper crate for examples 2022-08-25 12:54:52 +02:00
literals.rs Update copyright information to reflect name change 2022-02-09 10:27:47 +01:00
llr.rs Fix a bunch of documentation warnings 2022-04-26 12:47:34 +02:00
load_builtins.rs New syntax: allow to create component without base 2022-10-26 18:09:57 +02:00
lookup.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
namedreference.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
object_tree.rs New syntax: allow to create component without base 2022-10-26 18:09:57 +02:00
parser.rs Test: fix the parser tests when running without SLINT_EXPERIMENTAL_SYNTAX defined 2022-10-27 13:06:40 +02:00
passes.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
README.md Change the Url from sixtyfps.io to slint-ui.com 2022-02-08 08:52:46 +01:00
typeloader.rs Refactoring: split ElementType away from the types used as property type 2022-10-26 14:50:44 +02:00
typeregister.rs New syntax: allow to create component without base 2022-10-26 18:09:57 +02:00

The Slint Compiler Library

NOTE: This library is an internal crate of the Slint project. This crate should not be used directly by applications using Slint. You should use the slint crate instead.

WARNING: This crate does not follow the semver convention for versioning and can only be used with version = "=x.y.z" in Cargo.toml.