Commit Graph

6855 Commits

Author SHA1 Message Date
Kamil Jarosz 9ba7bb8629 core: Reverse tab order on Shift+Tab
When pressing Shift+Tab or Ctrl+Shift+Tab,
elements are tabbed in reverse.
2024-03-29 23:20:15 +01:00
Kamil Jarosz 208aae78ee core: Use either crate instead of a custom implementation 2024-03-29 23:20:15 +01:00
TÖRÖK Attila a59ec413ad chore: Update `egui` to `v0.27.1` 2024-03-29 14:46:25 +01:00
TÖRÖK Attila 5b4f808769 chore: Update `egui` to `v0.27.0` 2024-03-29 10:02:52 +01:00
Kamil Jarosz 9d18bcdd06 avm1: Add support for tabEnabled and tabIndex 2024-03-27 00:40:24 +01:00
Kamil Jarosz c7b16f4642 core: Add basic support for Tab key behavior
The Tab key is used to cycle through focusable elements in stage.
It supports two tab orderings: automatic and custom.
This patch adds basic support for this behavior.
2024-03-27 00:40:24 +01:00
Kamil Jarosz e6e23fc758 core: Simplify handling clip events in Player 2024-03-27 00:40:24 +01:00
Lord-McSweeney 1a9a36c1ed avm2: Properly push coerced value back to stack in optimizer for Coerce op 2024-03-26 10:43:13 -07:00
renovate[bot] 9dfc6dc224 fix(deps): update rust dependencies 2024-03-26 13:56:59 +01:00
sleepycatcoding 1b41abf3a3 chore: Remove unused dependencies 2024-03-25 17:45:26 +01:00
renovate[bot] 98cbe9cf31 fix(deps): update rust dependencies 2024-03-25 02:47:32 +01:00
Crowdin Bot 9793e3968d chore: Update translations from Crowdin 2024-03-24 22:55:51 +01:00
Tom Schuster 1d4fd1575b avm2: Make URLStream fire the HTTP_STATUS event 2024-03-24 12:42:12 +01:00
Tom Schuster 403f6eb511 avm2: Add URLStream.connected 2024-03-24 12:42:12 +01:00
Lord-McSweeney 0adac8f69d core: Remove `Collect` from `Color` and `DirtyState` as it was unnecessary 2024-03-23 21:18:02 -07:00
Lord-McSweeney 530319ce93 avm2: Add many more ops to optimizer 2024-03-23 20:17:41 -07:00
Lord-McSweeney 9f44281a52 avm2: Remove unnecessary range checks on local-modifying ops in optimizer 2024-03-23 20:17:41 -07:00
Lord-McSweeney dec9f07f5f avm2: Better optimizer handling for `FindProperty` and `FindPropStrict` 2024-03-23 20:17:41 -07:00
Lord-McSweeney 2646fcf148 avm2: Add more domain memory ops to optimizer 2024-03-23 20:17:41 -07:00
Lord-McSweeney 3c39acc2ae avm2: Increase number of actions before timeout check from 2000 to 64000 2024-03-23 20:17:41 -07:00
Lord-McSweeney 407314686e avm2: Verify `getouterscope` op 2024-03-23 20:17:41 -07:00
TÖRÖK Attila 156e4eb2ed core: Make sure that streams progress even with many small-dt ticks 2024-03-24 01:07:10 +01:00
Adrian Wielgosik 08157a056e build: Fix redundant import warnings 2024-03-23 19:23:18 +01:00
Lord-McSweeney ab254c93c6 avm2: Activation class is now guaranteed in `op_new_activation` 2024-03-22 18:55:23 -07:00
Lord-McSweeney af19d6f385 avm2: Fix `newactivation` in script initializer
This works the same as in a normal function
2024-03-22 18:55:23 -07:00
renovate[bot] d70560cb82 fix(deps): update rust dependencies 2024-03-22 11:10:59 +01:00
TÖRÖK Attila d9f17dac44 chore: Bump `image` to `v0.25`, without the `dxt` feature 2024-03-19 00:14:48 +01:00
michiel2005 28048e9b81 avm1: added the onScroller listener 2024-03-18 22:17:32 +01:00
michiel2005 5fc2505c07 core: made text fields scrollable 2024-03-18 22:17:32 +01:00
michiel2005 ec99bedcf8 avm1: added mouse_wheel_enabled to text fields 2024-03-18 22:17:32 +01:00
Adrian Wielgosik 3c2d629e0d core: Cull text under textfield 2024-03-18 22:00:34 +01:00
TÖRÖK Attila 7a269c054d fix(deps): update rust dependencies 2024-03-18 12:21:47 +01:00
Crowdin Bot 8345ace97e chore: Update translations from Crowdin 2024-03-18 11:49:48 +01:00
Lord-McSweeney e7924e564b avm2: Fix some parameter types and signatures for XML 2024-03-17 20:01:19 -07:00
Adrian Wielgosik 27cd08deeb avm2: Provide an option to disable the optimizer 2024-03-16 22:40:15 +01:00
soonsouth abf7d3fa20 chore: remove repetitive words
Signed-off-by: soonsouth <cuibuwei@163.com>
2024-03-15 21:10:53 +01:00
Adrian Wielgosik 69ba551f0d avm2: Add extra type propagation to astype 2024-03-14 22:32:48 +01:00
Adrian Wielgosik 88e5f9a898 avm2: unify abstract type propagation 2024-03-14 22:32:48 +01:00
renovate[bot] 3f9f19b7ac fix(deps): update rust dependencies 2024-03-14 16:45:29 +01:00
sleepycatcoding c7a34bb7dd avm2: Set default for XML.elements `name` argument in AS
This makes it consistent with other methods on XML and XMLList.
2024-03-14 15:38:49 +01:00
sleepycatcoding 2a70f45423 avm2: Implement XMLList.elements 2024-03-14 15:38:49 +01:00
Tom Schuster eabf7a0d58 avm2: Add Namespace.prototype.toString 2024-03-13 22:26:47 +01:00
Tom Schuster 623dba6f1f avm2: Remove all to_string implementations except Object and Class.
Turns out the Vector to_string function that I added (#15562) was just duplicating what the
default implementation did. The Namespace one was just plain wrong.

Fixes #15474
2024-03-13 22:26:47 +01:00
Tom Schuster 09a7bd61b5 avm2: Fix Object.prototype.toString applied to Vector 2024-03-13 20:16:49 +01:00
Tom Schuster 8ec203a227 avm2: Add Function.prototype.toString and toLocaleString 2024-03-13 10:14:27 +01:00
Tom Schuster 3f17523879 avm2: Fix toString for primitive objects 2024-03-12 21:00:26 -07:00
Adrian Wielgosik dce71fdfcb avm2: Make Activation::from_builtin non-Result 2024-03-10 23:08:04 +01:00
Adrian Wielgosik 064cc14905 avm2: Reduce memcpy overhead in BytecodeMethod calls 2024-03-10 23:08:04 +01:00
Tom Schuster 53aee62c38 avm2: Re-implement RegExp.prototype.toString
Also remove the TObject to_string implementation that isn't necessary.
2024-03-10 21:27:39 +01:00
Lord-McSweeney 788c3da4aa avm2: Add a `make_error_1014` function and use it 2024-03-10 09:49:24 -07:00
Lord-McSweeney f76117a2be avm2: Better target class and target variable name handling for exceptions
Lookup on the target class and variable name is now done in the verifier.
2024-03-10 09:49:24 -07:00
Lord-McSweeney b5f7fa0cd0 swf: `CallMethod` takes a `disp_id`, not any sort of `Index` 2024-03-10 09:49:24 -07:00
Lord-McSweeney 028a61e744 avm2: Pre-pool multiname for `FindDef` 2024-03-10 09:49:24 -07:00
Lord-McSweeney fdf92a9f2d avm2: Also early lookup classes for `IsType` and `AsType` 2024-03-10 09:49:24 -07:00
Lord-McSweeney 51b9dcfb1d avm2: Pool strings in verifier 2024-03-10 09:49:24 -07:00
Lord-McSweeney b69eabfcdc avm2: Lookup multinames in verifier and store them in `Op` 2024-03-10 09:49:24 -07:00
Aaron Hill 7752c32c8e
avm2: Stub GameInput.getDeviceAt and GameInputControl (#15409) 2024-03-09 22:01:10 +00:00
Tom Schuster ed4bb00115 avm2: Stage.stage3Ds must return a vector
Fixes #15472
2024-03-07 19:33:09 +01:00
Lord-McSweeney 12ffc8a347 avm2: Remove unused and unnecessary `init_slot` 2024-03-06 20:49:19 -08:00
Nathan Adams 1a6b73f496 avm2: Use chrono's new Duration::try_ methods 2024-03-06 21:58:40 +01:00
renovate[bot] a916369f21 fix(deps): update rust dependencies 2024-03-06 21:58:40 +01:00
Lord-McSweeney 95b5c700f5 avm2: Fix a minor optimizer bug 2024-03-06 07:21:28 -08:00
Lord-McSweeney 24d194a8b1 avm2: Propagate normal error for bad Multiname read in verifier 2024-03-06 07:21:28 -08:00
Lord-McSweeney 9a1196a7a0 avm2: Fix bugs and resolve reviews 2024-03-06 07:21:28 -08:00
Lord-McSweeney c98d61c376 avm2: Add a `make_error_1021` function and use it 2024-03-06 07:21:28 -08:00
Lord-McSweeney f28928dbc9 avm2: Match verifier reading implementation with FP's 2024-03-06 07:21:28 -08:00
Kamil Jarosz c260a45603 core: Close sockets and timers when replacing the root movie
Turns out that the comment from `set_root_movie` was right all along!
`set_root_movie` should not be used when replacing the root movie,
because it will leave out unclosed resources.
This patch introduces `replace_root_movie`, which is dedicated to be
used when replacing (instead of just setting) the root movie.

The best solution would be to use RAII, e.g. destroy and recreate
the whole Player instance, but this patch is a first step towards
proper resource control.
2024-03-05 23:14:08 +01:00
Nathan Adams 09dfa6427e desktop: Allow changing the language in Preferences 2024-03-05 00:02:27 +01:00
renovate[bot] fae1c458ec fix(deps): update rust dependencies 2024-03-04 22:18:19 +01:00
TÖRÖK Attila 7f268bf50e chore: Update `wasm-bindgen` to `v0.2.92`, wasm-bindgen-futures to `v0.4.42` 2024-03-04 19:01:04 +01:00
TÖRÖK Attila 755fa6cded chore: Switch `fluent-templates` back from `master` to `v0.9.0` 2024-03-04 11:05:08 +01:00
TÖRÖK Attila 85dd258168 cleanup: Remove a stale workaround for a `generational-arena` bug 2024-03-03 21:18:39 +01:00
TÖRÖK Attila 8764c08b01 cleanup: Define distinct key types for different kinds of slotmaps 2024-03-03 21:18:39 +01:00
TÖRÖK Attila 5bfd8af257 cleanup: Rename `Handle` in `loader.rs` to `LoaderHandle` to follow convention 2024-03-03 21:18:39 +01:00
Adrian Wielgosik 17c5b38bb1 avm2: Only construct type_error on error in astype, instanceof 2024-03-03 20:58:54 +01:00
MrCheeze a119e3e130 core: Improve placement of cursor when clicking in textbox
Currently when clicking in a textbox, the cursor will only be placed
correctly if you click exactly on top of a letter. The basic purpose of
this commit is to make it so that clicking in the surrounding margin
will put the cursor in the closest available position, as in Flash Player.

The logic is a bit complex because a single row of text can contain
multiple layout boxes, each with a different Y offset (but all with the
same Y extent). To be accurate, we need to treat each layout box in the
row "as if" it had the same Y offset that the tallest box in its row has.

This commit also contains a fix for an issue where lower_from_text_spans
was passing the wrong text strings and indexes to fixup_line for
newlines, which needed to be fixed in order to be able to click to place
the cursor in an empty row that was created by newlines.
2024-03-02 20:30:50 +01:00
Lv Yitian 556d16302b
avm2: Implement flash.media.ID3Info (#14916) 2024-03-02 19:13:31 +00:00
TÖRÖK Attila 55773f0205 chore: Replace `generational-arena` with `slotmap` 2024-03-02 19:42:11 +01:00
renovate[bot] c2179e88db fix(deps): update rust dependencies 2024-03-02 10:05:43 +01:00
renovate[bot] 35d72115a4 fix(deps): update wasm-bindgen 2024-03-02 02:42:45 +01:00
renovate[bot] 6e84b05b66 fix(deps): update rust dependencies 2024-03-01 22:46:32 +01:00
TÖRÖK Attila 10fa4175c4 chore: Bump jpegxr and nellymoser-rs git references 2024-03-01 21:54:18 +01:00
Tom Schuster 0cea5a0a9e core: Introduce gamepad button mapping support 2024-02-28 21:21:09 +01:00
Kamil Jarosz f6907a5c73 desktop: Add tests for connect_socket
Add tests for ExternalNavigatorBackend::connect_socket.
2024-02-28 19:42:54 +01:00
Kamil Jarosz cc8b0aa5dd core: Use async channels in NavigatorBackend
This has several advantages:
1. it allows using async variants of send and recv,
2. it adds consistency as until now Receiver was async,
   and Sender was not.
2024-02-28 19:42:54 +01:00
Aaron Hill 3e99dd3999 core: Use latest fluent-templates `master` for reproducible builds 2024-02-27 21:36:28 -05:00
Aaron Hill 900a8407d6 core: Implement lazy decoding of bitmaps
We hit a pathological case in House
(https://github.com/ruffle-rs/ruffle/issues/15154),
where eagerly decoding bitmaps during preloading results in
over 10GB of ram being used.

With this PR, we store the compressed bitmap, and only decode it
each time we instantiate it. In order to support bitmap fills,
we store the decoded width/height and a lazily-initialized GPU handle
in `Character::Bitmap`
2024-02-27 21:18:18 -05:00
TÖRÖK Attila ee0c1f42ff core,avm2: Make Timer.setDelay not change the timer ID. Fix #15005. 2024-02-27 23:56:33 +01:00
renovate[bot] 9cdb2f31cc fix(deps): update rust dependencies 2024-02-26 08:14:26 +01:00
Lord-McSweeney 11d5a8f7df avm2: Resolve reviews (no functional changes) 2024-02-25 21:52:24 -08:00
Lord-McSweeney 8542edf10c avm2: Handle lazy multinames in optimizer 2024-02-25 21:52:24 -08:00
Lord-McSweeney b637e5f108 avm2: Add a `popn` function to `Stack` and use it 2024-02-25 21:52:24 -08:00
Lord-McSweeney 4d8c98af0d avm2: Don't use a `Class`'s first `ClassObject` for its VTable if more than one `ClassObject` had been constructed for the class 2024-02-25 21:52:24 -08:00
Lord-McSweeney a763842b1b avm2: Extract optimizer logic into a different file 2024-02-25 21:52:24 -08:00
Lord-McSweeney ba9a975685 avm2: Add `push_raw` for faster stack pushes 2024-02-25 21:52:24 -08:00
Lord-McSweeney b07c0a99ea avm2: Also optimize `CallProperty` to `CallMethod` when possible 2024-02-25 21:52:24 -08:00
Lord-McSweeney 22117e3eb5 avm2: Add more ops to optimizer and let it use resolved argument types 2024-02-25 21:52:24 -08:00
Lord-McSweeney 4da708edb8 chore: appease clippy 2024-02-25 21:52:24 -08:00
Lord-McSweeney e227576093 chore: cleanup 2024-02-25 21:52:24 -08:00
Lord-McSweeney d7cebd020b avm2: Support type inference for chained `GetProperty`s 2024-02-25 21:52:24 -08:00
Lord-McSweeney 8b19012123 avm2: Handle more ops in abstract optimizer 2024-02-25 21:52:24 -08:00
Lord-McSweeney 0cb0d4a6da avm2: More advanced optimizer 2024-02-25 21:52:24 -08:00
renovate[bot] 6b89737093 fix(deps): update rust dependencies 2024-02-19 11:32:22 +01:00
Crowdin Bot 29821e9c84 chore: Update translations from Crowdin 2024-02-19 10:38:26 +01:00
Tom Schuster ba7c9a4e31 avm2: Always serialize as ECMAArray, which produces an AMF0 MixedArray 2024-02-19 10:13:18 +01:00
Adrian Wielgosik fe2ed81d8a avm2: Implement JS->AS3 Object deserialization 2024-02-16 15:25:55 +01:00
renovate[bot] 1651b7a5b0 desktop: chore: Update `egui` to 0.26.2 2024-02-16 01:52:41 +01:00
Aaron Hill 1a1ce91e98 core: Only report socket connected just before we fire 'connect'
Platform Racing 3 relies on 'Socket.connected' reporting 'false'
immediately after calling 'Socket.connect' - it internally buffers
data made when 'Socket.connected' is false
2024-02-16 01:10:57 +01:00
Tom Schuster 49b3b9d7de avm2: Stub all flash.sampler methods 2024-02-14 14:10:41 +01:00
svitkin b55db7083c tests: Add test for flash.net.navigateToURL 2024-02-12 17:14:11 +01:00
svitkin 5028f66608 avm2: parse data for flash.net.navigateToURL (closes #13898) 2024-02-12 17:14:11 +01:00
Marco Bartoli 50a8815a50
avm2: Deserialize AMF dictionary (#15169) 2024-02-09 00:06:08 +01:00
Aaron Hill 71f828a3fd avm2: Use playerglobals domain as parent for `new ApplicationDomain()`
We were incorrectly using the stage domain as the parent, which caused
classes to be incorrectly shared between domains.
2024-02-07 20:13:23 -05:00
Tom Schuster d7c7716c34 avm2: Implement TextField::getLineText 2024-02-07 20:34:43 +01:00
David Wendt d7583289c9 avm1: Make `NetConnection.isConnected`'s stub more functional 2024-02-07 19:46:39 +01:00
Tom Schuster cadae9303f avm2: Verify the URLRequest method 2024-02-06 17:52:08 +01:00
sleepycatcoding 4c6f2ba973 avm2: Fix `in` operator not handling attributes in XML object 2024-02-05 21:09:39 +01:00
Tom Schuster ecda68b81c avm2: has_property should do proto.has_property instead of
has_own_property
2024-02-05 19:34:09 +01:00
TÖRÖK Attila 28c380cfac desktop: Update egui to 0.26.0 2024-02-05 19:05:10 +01:00
renovate[bot] 477440d387 fix(deps): update rust dependencies 2024-02-05 07:56:07 +01:00
Kamil Jarosz f3f8a4522e text: Add support for relative font sizes in HTML 2024-02-04 22:01:32 +01:00
_Mads b5d0c965f0
avm2: Implement TimerEvent.toString 2024-02-03 21:54:52 +00:00
Kamil Jarosz 50b5f29c0a text: Make enter add a new line in multiline fields 2024-02-03 13:40:07 +01:00
Aaron Hill b02a96373b debug_ui: Show ClassObjects for domain class
This re-uses our existing infrastructure for displaying
AVM2 Class objector. One minor limitation of this approach
is the inability to view a `Class` that hasn't yet had its
`ClassObject` created - however, this should be rare in practice.

We show a collapsing header with all of the ClassObjects associated
with the given Class.
2024-02-02 19:24:36 -08:00
Lord-McSweeney 603a76bab0 avm2: Add fast path for `Value::abstract_lt`-ing two integers 2024-02-01 17:03:57 -08:00
Nathan Adams 71c9de410d core: Clarify CPU vs GPU branch in BitmapData.draw 2024-02-02 00:59:45 +01:00
Nathan Adams bac78442fc core: Don't do bmd.draw() on cpu if it exists on gpu 2024-02-02 00:59:45 +01:00
Nathan Adams 70fbb4a7ac render: Move away from SyncHandle.retrieve_offscreen_texture to RenderBackend::resolve_sync_handle 2024-02-02 00:59:45 +01:00
Marco Bartoli 5ae3be3ac9
avm2: Ignore version marks in non-playerglobal namespaces 2024-02-01 21:50:26 +00:00
Kamil Jarosz 4154a0945d text: Implement advanced horizontal text controls for EditText 2024-02-01 20:18:29 +01:00
Kamil Jarosz 0657d2daa2 text: Add advanced horizontal text control codes 2024-02-01 20:18:29 +01:00
Kamil Jarosz b39919951b wstr: Add UTF-8/UTF-16 index mapping
Methods `utf8_index` and `utf16_index` from `WStrToUtf8`
may be used to map code unit indices between UTF-8 (str)
and UTF-16 (WStr) strings.
2024-02-01 20:18:29 +01:00
Nathan Adams 50dedc3cb9 avm1: Invalidate cacheAsBitmaps when using Color API 2024-02-01 19:27:33 +01:00
Lord-McSweeney 2ccad62378
core: Implement `focusIn` `FocusEvent` for AVM2 (#14723) 2024-02-01 08:22:36 +00:00
Aaron Hill 78873e3670 avm2: Add new 'stub-report' binary crate
This writes the AVM2 stub report to the specified path.
2024-01-31 20:22:06 -05:00
Nathan Adams 25b5c7b4e2 avm2: Track progress of avm2 and generate an implementation.json 2024-01-31 20:22:06 -05:00
Robert Setter abc8815445 avm1: Match random behaviour to avm2 2024-02-01 00:19:21 +01:00
Lord-McSweeney e656ebf6ac avm2: Stub `flash.system::MessageChannel` 2024-01-31 09:24:42 -08:00
Adrian Wielgosik 4971f5be2d avm2: Prevent chained dependent strings 2024-01-30 23:21:37 +01:00
Adrian Wielgosik ecbb0f92f1 avm2: Add small string store to interner, expand use 2024-01-30 23:21:37 +01:00
Adrian Wielgosik 7aa95fe463 avm2: Dependent strings POC 2024-01-30 23:21:37 +01:00
Aaron Hill 12c47047b8 debug_ui: Display 'Movie' button on 'Class Info' panel 2024-01-30 17:26:05 +01:00
renovate[bot] 3737725a21 fix(deps): update rust dependencies 2024-01-30 09:23:15 +01:00
Lord-McSweeney dbc1015ef5 avm2: Resolve review comments and fix verifier brokenness 2024-01-29 22:48:00 -08:00
Lord-McSweeney 8b29ceaafa avm2: Write a `make_error_1032` function and use it 2024-01-29 22:48:00 -08:00
Lord-McSweeney c1c3351654 avm2: `Op::Coerce` should not accept a 0-index `Multiname` 2024-01-29 22:48:00 -08:00
Lord-McSweeney fcf83d7dd9 avm2: Properly verify constant pool lookups for `Op::Coerce` and `Op::AsType` 2024-01-29 22:48:00 -08:00
Lord-McSweeney 442391ea60 avm2: Fix a minor bug where `CoerceD` was removed after `Inc`/`DecLocal` 2024-01-29 22:48:00 -08:00
Lord-McSweeney 7b853a8cd9 avm2: One more lazy multiname fix 2024-01-29 22:48:00 -08:00
Lord-McSweeney ce41362b1e avm2: Fix some potentially-failing unwraps and broken code in the verifier 2024-01-29 22:48:00 -08:00