aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/textinput.rs
diff options
context:
space:
mode:
authorteapotd <teapot404@gmail.com>2020-01-10 19:02:41 +0100
committerteapotd <teapot404@gmail.com>2020-01-10 19:02:41 +0100
commitc7a31990a253d4c47608cdc6130236010efdb919 (patch)
treed87f1d72271fc8f851ac815ab94575be5d45e38d /components/script/textinput.rs
parentc6192dc286ce0496b76998c900b48cdf7cdabdfe (diff)
downloadservo-c7a31990a253d4c47608cdc6130236010efdb919.tar.gz
servo-c7a31990a253d4c47608cdc6130236010efdb919.zip
Allow deletion from overflowed textinput
Diffstat (limited to 'components/script/textinput.rs')
-rw-r--r--components/script/textinput.rs6
1 files changed, 0 insertions, 6 deletions
diff --git a/components/script/textinput.rs b/components/script/textinput.rs
index 0401134bd66..bc4c1c4a6cb 100644
--- a/components/script/textinput.rs
+++ b/components/script/textinput.rs
@@ -450,12 +450,6 @@ impl<T: ClipboardProvider> TextInput<T> {
let allowed_to_insert_count = if let Some(max_length) = self.max_length {
let len_after_selection_replaced =
self.utf16_len().saturating_sub(self.selection_utf16_len());
- if len_after_selection_replaced >= max_length {
- // If, after deleting the selection, the len is still greater than the max
- // length, then don't delete/insert anything
- return;
- }
-
max_length.saturating_sub(len_after_selection_replaced)
} else {
UTF16CodeUnits(usize::MAX)