avm2: Handle setting tabIndex to -1
Despite throwing an error that `tabIndex` cannot be negative, the value of -1 is allowed, and it means that `tabIndex` is unset.
This commit is contained in:
parent
f40cb6435f
commit
8ee514e62f
|
@ -168,7 +168,9 @@ pub fn set_tab_index<'gc>(
|
|||
) -> Result<Value<'gc>, Error<'gc>> {
|
||||
if let Some(obj) = this.as_display_object().and_then(|o| o.as_interactive()) {
|
||||
let value = args.get_i32(activation, 0)?;
|
||||
if value < 0 {
|
||||
// Despite throwing an error that tabIndex cannot be negative,
|
||||
// the value of -1 is allowed, and it means that tabIndex is unset.
|
||||
if value < -1 {
|
||||
return Err(make_error_2027(activation, value));
|
||||
}
|
||||
obj.set_tab_index(&mut activation.context, Some(value));
|
||||
|
|
Loading…
Reference in New Issue