diff --git a/core/src/avm1/globals/selection.rs b/core/src/avm1/globals/selection.rs index a0ff59290..fded959e6 100644 --- a/core/src/avm1/globals/selection.rs +++ b/core/src/avm1/globals/selection.rs @@ -16,7 +16,7 @@ pub fn get_begin_index<'gc>( .focus_tracker .get() .and_then(|o| o.as_edit_text()) - .and_then(EditText::get_selection) + .and_then(EditText::selection) { Ok(Value::Number(selection.start() as f64)) } else { @@ -34,7 +34,7 @@ pub fn get_end_index<'gc>( .focus_tracker .get() .and_then(|o| o.as_edit_text()) - .and_then(EditText::get_selection) + .and_then(EditText::selection) { Ok(Value::Number(selection.end() as f64)) } else { @@ -52,7 +52,7 @@ pub fn get_caret_index<'gc>( .focus_tracker .get() .and_then(|o| o.as_edit_text()) - .and_then(EditText::get_selection) + .and_then(EditText::selection) { Ok(Value::Number(selection.to() as f64)) } else { diff --git a/core/src/avm1/globals/text_field.rs b/core/src/avm1/globals/text_field.rs index 7edc3de93..b303b8644 100644 --- a/core/src/avm1/globals/text_field.rs +++ b/core/src/avm1/globals/text_field.rs @@ -579,7 +579,7 @@ pub fn attach_virtual_properties<'gc>( Some(fn_proto), fn_proto, )), - ReadOnly.into(), + DontDelete | ReadOnly | DontEnum, ); object.add_property( gc_context, diff --git a/core/src/display_object/edit_text.rs b/core/src/display_object/edit_text.rs index 4d72789a1..443ca6f1a 100644 --- a/core/src/display_object/edit_text.rs +++ b/core/src/display_object/edit_text.rs @@ -933,7 +933,7 @@ impl<'gc> EditText<'gc> { } } - pub fn get_selection(self) -> Option { + pub fn selection(self) -> Option { self.0.read().selection } @@ -1003,7 +1003,7 @@ impl<'gc> EditText<'gc> { return; } - if let Some(selection) = self.get_selection() { + if let Some(selection) = self.selection() { match character as u8 { 8 | 127 if !selection.is_caret() => { // Backspace or delete with multiple characters selected