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 test verifies the behavior of focus hightlight when the
focused element is transformed; additionally, it verifies how
the active highlight behaves when _focusrect is set to false.
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 matrix::round_to_i32()
by using f32::round_ties_even(), which has been stable
since 1.77.0, instead of a custom algorithm.
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 test ensures that the error 2037 is thrown
when load is called after save.
It's currently a known failure as Ruffle is not as strict as FP
regarding throwing the error 2037.
This test verifies how FileReference behaves when a browse (and load)
operations are triggered after save.
Additionally, it marks the commented out code related to reporting
file size as FIXME, because the current implementation reports
the size at all times, instead of only after saving.
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.