Button events are actually handled twofold:
1. KeyPress for printable characters is handled on TextInput,
2. KeyPress for special characters (e.g. enter, arrows)
is handled on KeyDown.
Before this patch, KeyPress was fired too early, so that for
special characters (2) it fired BEFORE KeyDown.
This was not a problem for printable characters, as they
fired on TextInput, which always fired separately after KeyDown.
This patch ensures that KeyPress is fired always in the proper order.
The option "Include Hidden" was not working properly,
as it did not exclude all hidden objects when disabled.
An object is hidden also when its ancestor is not visible.
This ensures that highlight does not become outdated
(e.g. when the highlighted content moves).
Additionally, it makes the highlight have 3px independently of zoom.
This patch improves performance of ecma_conversions::round_to_even():
1. by using f64::round_ties_even(), which has been stable
since 1.77.0, instead of a custom algorithm; and
2. by removing an unnecessary comparison to i32::MIN,
as casting a float to an integer automatically saturates
values smaller than the minimum integer value to the minimum
value of the integer type.
The logic of dropping the focus when it's removed
applies not only to TextFields but for every InteractiveObject.
This patch ensures that any focus is dropped when its parent is removed.
All the interactive objects had the has_focus flag in their concrete
implementations (even AVM2 button, which did not use it at all).
This patch moves it to InteractiveObject (as a bit flag), making it
easier to manage and use through the has_focus, set_has_focus methods.
Additionally, the operation of setting the current focus to None
when an object was having it was popular enough that it warranted its
own method of drop_focus.
This patch adds support for saving files on web using FileReference.
When writing data, a download is triggered with the default file name.
Currently, there's no dialog that lets the user select save destination.
This patch also ensures that all implementations of FileDialogResult
behave the same way: desktop, web, and tests.
The methods `write` and `refresh` have been merged into one:
`write_and_refresh`, which allows the tests and web implementations
behave the same way as desktop.
* avm2: XML.contains() implemented
* tests: XMLList known_failure removed
* avm2: XML manual checks removed
* avm2: XMLList.contains() behavior fixed
* avm2: XML contains method moved to xml.rs
* avm2: Empty line removed in xml.rs
* avm2: XML contains args name renamed to value
Before this patch, focus handlers were called from on_focus_changed,
only for selected objects. It seems that they should be called for
every object by default.
The field tab_enabled in AVM1 is effectively read-only as
tabEnabled is not a built-in property of objects.
That is not the case in AVM2, where tab_enabled is native.
This patch covers both of these cases by introducing methods:
* tab_enabled,
* set_tab_enabled,
* tab_enabled_avm1,
* tab_enabled_avm2_default.
Stage overrides some properties from its super classes.
Some of them are currently identical in Ruffle,
but in FP they are used for e.g. security checks.