Commit Graph

12152 Commits

Author SHA1 Message Date
Nathan Adams 55161f431c desktop: Made align and force_align Option 2024-05-10 19:51:37 +02:00
Nathan Adams 22a2bf56a2 desktop: Made quality Option 2024-05-10 19:51:37 +02:00
Nathan Adams 86c2015524 desktop: Made tcp_connections Option 2024-05-10 19:51:37 +02:00
Nathan Adams 9a74da2782 desktop: Made max_execution_duration Option<Duration>, where None is infinite 2024-05-10 19:51:37 +02:00
Nathan Adams 34c994a28f desktop: Made OptionalUrlField an OptionalField<UrlField> 2024-05-10 19:51:37 +02:00
Nathan Adams 9d6d945ca4 desktop: Rename PlayerOptions to LaunchOptions 2024-05-10 19:51:37 +02:00
TÖRÖK Attila 11c1120364 core: Invalidate cached bitmap on every newly decoded video frame
Not just when seeking manually. And request rendering to be sure.
2024-05-10 09:56:47 +02:00
Lord-McSweeney 8eaede1c2c avm2: Try to speed up domain memory ops 2024-05-09 16:41:12 -07:00
Lord-McSweeney 8ab19054aa avm2: Create bad branch errors lazily in verifier 2024-05-09 16:41:12 -07:00
Lord-McSweeney 4df7722aab avm2: Add fast path for setting array property 2024-05-09 16:41:12 -07:00
Crowdin Bot 6d89f657f8 chore: Update translations from Crowdin 2024-05-10 00:49:55 +02:00
Kamil Jarosz ea3ac098dd tests: Add avm1/button_key_events_special test
This test verifies the behavior of button events when
special characters are pressed.
2024-05-09 21:13:13 +02:00
Kamil Jarosz ed037214b1 core: Always fire KeyPress after KeyDown for buttons
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.
2024-05-09 21:13:13 +02:00
Kamil Jarosz fb2d8222eb tests: Add avm1/button_keypress_vs_textinput test
This test ensures that button key press events take precedence
over text input.
2024-05-09 21:13:13 +02:00
Kamil Jarosz 5541daa105 debug_ui: Add interactive tab order list 2024-05-09 20:57:53 +02:00
Kamil Jarosz baa87ff016 core: Add FocusTracker::tab_order method
This method returns the current tab order as a list of objects.
2024-05-09 20:57:53 +02:00
Kamil Jarosz ccf6b3edb5 debug_ui: Add possibility to clear current focus 2024-05-09 20:57:53 +02:00
Kamil Jarosz ab62b740a7 debug_ui: Use open_display_object_button for focus 2024-05-09 20:57:53 +02:00
sleepycatcoding 18f86634a4 frontend-utils: Do not panic when recent limit is zero and file is empty 2024-05-09 19:55:45 +03:00
Kamil Jarosz 4e39598da4 debug_ui: Exclude hidden objects properly when searching
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.
2024-05-09 08:12:59 -07:00
sleepycatcoding 059abb17ce desktop: Add a way to clear recently played files 2024-05-09 11:10:44 +02:00
Crowdin Bot 4422445f6a chore: Update translations from Crowdin 2024-05-09 10:36:21 +02:00
Kamil Jarosz cc3316188a tests: Add focus_highlight_move test
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.
2024-05-09 00:40:25 +02:00
Kamil Jarosz ece156e478 core: Use draw_rect_outline for focus highlight
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.
2024-05-09 00:40:25 +02:00
Kamil Jarosz 07bfa0c3e2 core: Use draw_rect_outline for debug rects
This improves debug rect rendering so that debug rects
do not have missing corners as before.
2024-05-09 00:40:25 +02:00
Kamil Jarosz eabf76dae8 core: Add RenderContext::draw_rect_outline
This method may be used to efficiently draw a simple rectangle outline
for debug rects and focus rects.
2024-05-09 00:40:25 +02:00
Kamil Jarosz b99bdadb8f render: Improve performance of round_to_i32
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.
2024-05-08 22:16:40 +02:00
Kamil Jarosz 6ad4bc4999 render: Add tests for round_to_i32 2024-05-08 22:16:40 +02:00
Kamil Jarosz bc4ed4c5a1 core: Improve performance of round_to_even
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.
2024-05-08 22:16:40 +02:00
Kamil Jarosz 8eaf844cdc core: Add tests for round_to_even 2024-05-08 22:16:40 +02:00
Crowdin Bot 4b8bebd74a chore: Update translations from Crowdin 2024-05-08 00:10:37 +02:00
Kamil Jarosz 45dca764c6 tests: Add avm2/focus_remove test
This test verifies the behavior of stage.focus
when the focus is removed from the stage.
2024-05-07 22:56:25 +02:00
Kamil Jarosz b3091ec785 tests: Add avm1/focus_remove test
This test verifies the behavior of Selection.getFocus()
when the focus is removed.
2024-05-07 22:56:25 +02:00
Kamil Jarosz b551d14a59 avm2: Ensure the focus is dropped when it's removed
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.
2024-05-07 22:56:25 +02:00
Kamil Jarosz 428688e7e7 core: Add DisplayObject.on_parent_removed method
This method prevents code duplication performed when overwriting
set_parent to inject some behavior when the parent is removed.
2024-05-07 22:56:25 +02:00
Kamil Jarosz 8d50d1fead core: Move has_focus to InteractiveObject
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.
2024-05-07 22:56:25 +02:00
Adrian Wielgosik 19b7cc9025 avm2: Add extra failing tests for button child events 2024-05-07 22:42:52 +02:00
Adrian Wielgosik 120bfa2b30 avm2: Send ADDED_TO_STAGE in SimpleButton at correct time 2024-05-07 22:42:52 +02:00
Kamil Jarosz d852c74b3a tests: Add avm2/filereference_save_and_load test
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.
2024-05-07 22:26:30 +02:00
Kamil Jarosz 6ea64c92f4 tests: Add avm2/filereference_save_and_browse test
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.
2024-05-07 22:26:30 +02:00
Kamil Jarosz 8e6e71b2f7 web: Download the file on FileReference.save
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.
2024-05-07 22:26:30 +02:00
dependabot[bot] 79137ec95e build(deps): bump webbrowser from 0.8.15 to 1.0.1
Bumps [webbrowser](https://github.com/amodm/webbrowser-rs) from 0.8.15 to 1.0.1.
- [Release notes](https://github.com/amodm/webbrowser-rs/releases)
- [Changelog](https://github.com/amodm/webbrowser-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/amodm/webbrowser-rs/compare/v0.8.15...v1.0.1)

---
updated-dependencies:
- dependency-name: webbrowser
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-07 22:10:27 +02:00
dependabot[bot] 5bc55f5f3b build(deps): bump the cargo-minor group with 3 updates
Bumps the cargo-minor group with 3 updates: [anyhow](https://github.com/dtolnay/anyhow), [getrandom](https://github.com/rust-random/getrandom) and [zip](https://github.com/zip-rs/zip2).


Updates `anyhow` from 1.0.82 to 1.0.83
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.82...1.0.83)

Updates `getrandom` from 0.2.14 to 0.2.15
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.2.14...v0.2.15)

Updates `zip` from 1.1.4 to 1.2.0
- [Release notes](https://github.com/zip-rs/zip2/releases)
- [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zip-rs/zip2/compare/v1.1.4...v1.2.0)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: getrandom
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: zip
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 23:26:01 +02:00
Kamil Jarosz 0f1c647c1c tests: Add avm2/edittext_selected_text test 2024-05-06 22:17:41 +02:00
Kamil Jarosz eef694e9da tests: Add missing text control codes 2024-05-06 22:17:41 +02:00
Kamil Jarosz e09e199eb3 tests: Fix text control codes mapping 2024-05-06 22:17:41 +02:00
Kamil Jarosz 64df0368fd avm2: Fix TextField.selectedText 2024-05-06 22:17:41 +02:00
_Mads 901a88db29 avm2: Implement selectedText in class flash.text.TextField 2024-05-06 22:17:41 +02:00
Colin 88d8eebce6 docs: Fix scanner command and broken mtasc links 2024-05-06 22:04:25 +02:00
J0sh0nat0r 0c38cc9e28 avm2: share binding skip optimization with `call_method` 2024-05-06 22:02:45 +02:00