Commit Graph

11303 Commits

Author SHA1 Message Date
TÖRÖK Attila 36c550b97f chore: Fix a beta lint in our `gc_arena` facade: `ambiguous_wide_pointer_comparisons`
As per our discussion with @kyren on Discord.
2023-12-23 13:06:47 +01:00
Tom Schuster 704bd7502e core: Do exact matching for device fonts first, because we might be able to load bold/italic variants 2023-12-22 13:47:48 +01:00
Tom Schuster e3d8a279ad core: load_device_font register function must be &mut 2023-12-22 13:47:48 +01:00
nosamu a5560587da tests: Add AVM1 SWFv5 string methods test 2023-12-20 10:38:17 -08:00
nosamu 4f62e7de47 avm1: Implement String.charCodeAt() SWFv5 behavior 2023-12-20 10:38:17 -08:00
nosamu 95851e6e9a avm1: Implement undocumented SWFv5 string split behavior 2023-12-20 10:38:17 -08:00
nosamu d443bd9def avm1: Correctly handle undefined delimiter in String.split() 2023-12-20 10:38:17 -08:00
Crowdin Bot ba6ba842d7 chore: Update translations from Crowdin 2023-12-18 23:28:34 +01:00
TÖRÖK Attila f5f8962ce1 chore: Update naga to 0.14.2, run `cargo update` 2023-12-18 17:07:16 -05:00
Aaron Hill 5c37533761 avm2: Avoid marking interface method definitions with VM_INTERNAL
Our asc.jar doesn't seem to apply a version suffix to namespaces for
interface method definitions. This was causing these methods to
get marked as VM_INTERNAL when we loaded playerglobals, preventing SWF
from invoking these methods through the interface (e.g. having a
variable of type `IEventDispatcher`, and calling `dispatchEvent` on it)
2023-12-18 21:50:34 +01:00
nosamu 98ebc339b4 core: Use i32 for font ascent and descent 2023-12-18 09:31:53 +01:00
renovate[bot] 0e5ef32654 fix(deps): update rust dependencies 2023-12-18 08:16:28 +01:00
nosamu 989988631f desktop: Fix egui scaling
Fixes #14413
2023-12-17 22:14:14 -08:00
Lord-McSweeney ecfb3b1c4c core/avm1: Improve some stubs
Add `Avm1Constructor` stub and use it in `NetConnection`; only log a stub warning in `run_inner_goto_frame` if movie is AVM2
2023-12-17 13:01:23 -08:00
friedkeenan 834e745652 swf: Make avm2 Writer::write_op public 2023-12-17 15:41:44 +01:00
friedkeenan c7966cea77 swf: Add test for avm2 Writer::write_op 2023-12-17 15:41:44 +01:00
zhenghaoz e89f458df8 avm2: Add missing property objectEncoding to SharedObject 2023-12-17 13:23:06 +01:00
Aaron Hill 287ca8801a avm2: Implement AIR playerglobal versioning
This builds on our existing playerglobal versioning support
to add in AIR versioning. We closely follow the avmplus implementation:

* When an SWF is loaded, we chose either a FlashPlayer or AIR
APIVersion for its SWF version, based on our configured player runtime.
* When loading playerglobals, we look at the player runtime. In AIR
  mode, we map FlashPlayer-versioned definitions to the closest AIR
  version. This ensures that all runtime APIVersions are in the
  same series (either AIR or FlashPlayer). In FlashPlayer mode,
  all AIR-versioned definitions get mapped to VM_INTERNAL, hiding
  them from user code.

Part of our existing api versioning code was implemented incorrectly.
Within playerglobals, we need to treat all unmarked namespaces as
VM_INTERNAL - this allows things like playerglobal script
initializer "initproperty" opcodes to see any VM_INTERNAL AIR
definitions (when we run under FlashPlayer mode). Previously, we
were using AllVersions, which would result in those VM_INTERNAL
definitions being hidden from other playerglobal code, which is
not correct.

Using this support, I've added a stub for the AIR-only
'flash.net.DatagramSocket'. I've also extended the test framework
with a new 'player_options.runtime' config option, which can be
set to "AIR" or "FlashPlayer" to configure the test runtime mode.

I've also added two new tests:
* 'air_hidden_lookup' runs under the FlashPlayer runtime, and verifies
  that a list of classes (currently just "DatagramSocket" are
  inacessible).
* 'air_datagram_socket', which uses `player_options.runtime = "AIR"`
  to construct an instance of `flash.net.DatagramSocket`. We can
  extend this test once we implement more of `DatagramSocket`

With this commit, we have all of the needed infrastructure to start
implementing and testing AIR-only classes and methods.
2023-12-16 19:11:50 -05:00
Lord-McSweeney 375c99e601 core: More mixed AVM fixes, improve test
This commit breaks mixed AVM without #13889.
2023-12-16 19:40:57 +01:00
Lord-McSweeney 7461c03049 core: More fixes for mixed AVM 2023-12-16 19:40:57 +01:00
Tom Schuster 8071a14d4d web/extension: Correct the version used for the Firefox extension 2023-12-16 18:16:52 +01:00
Aaron Hill 837143bb12 naga-agal: Fix handling of sampler overrides
After some testing, and looking at OpenFL, I believe I've
determined the correct behavior for AGAL sampling:

Each time a Context3D.setProgram or Context3D.setSamplerStateAt
call is made, the sampler config for the used texture slot(s)
is updated with the new wrapping/filter behavior. For setProgram,
this comes from all of the 'tex' opcodes used within the program.

However, when the 'ignoresampler' flag is set in a 'tex' opcode,
the setProgram call does *not* override the existing sampler config.
As a result, that program will sample with the behavior determined
by the most recent setSamplerStateAt or setProgram call involving
the used texture slot(s).

Previously, we were always overriding the opcode sampler config
with the values from Context3D.setSamplerStateAt. However, I didn't
realize that the order of the calls matter, so none of my tests ended
up observing the effect of 'ignoresampler'.

We now need to process AGAL bytecode twice - a quick initial
parse to determine the sampler configs (which need to be updated
when we call 'setProgram'), and a second time when to build the
Naga module (which needs to wait until we have the vertex attributes
available, which can be changed by ActionScript after setting
the program).
2023-12-15 22:05:30 -07:00
Robin Allen f427cd58bb
core: Fix mouse coords reported to ActionScript (#14243)
The order in which Flash Player concatenates matrices causes reported
mouse coords to often be rounded.
2023-12-15 23:37:52 +00:00
sleepycatcoding d21be2091b avm2: Remove ArrayObject `to_string` impl
This was causing the `Object.prototype.toString` to throw error 1050,
instead of returning `[object Array]`, which was causing quite a few avmplus test failures.
2023-12-15 23:36:33 +01:00
TÖRÖK Attila f8260e1d3f web: Simplify the TS_NODE_COMPILER_OPTIONS value for mocha in core test 2023-12-15 20:21:12 +01:00
MrCheeze 0f6dae56b5 core: Improve spacing of device font letters (close #14185) 2023-12-15 20:14:08 +01:00
TÖRÖK Attila 9e87de1089 tests/avm2: Exclude Stage3D visual tests on WARP
As they are a prime suspects for causing hangs on CI.
2023-12-15 14:52:04 +01:00
TÖRÖK Attila bb7d2d9214 tests/avm2: Exclude PixelBender visual tests on WARP
As they are a prime suspects for causing hangs on CI.
2023-12-15 14:52:04 +01:00
dependabot[bot] e39fc86ee5 build(deps): bump zerocopy from 0.7.30 to 0.7.31
Bumps [zerocopy](https://github.com/google/zerocopy) from 0.7.30 to 0.7.31.
- [Release notes](https://github.com/google/zerocopy/releases)
- [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/zerocopy/compare/v0.7.30...v0.7.31)

---
updated-dependencies:
- dependency-name: zerocopy
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 07:20:50 +01:00
Tom Schuster c43f76eb2b avm2: Stub InteractiveObject needsSoftKeyboard and softKeyboardInputAreaOfInterest 2023-12-14 23:13:18 +01:00
TÖRÖK Attila 906433e049 core: Clean up Timers::remove, remove Timer::is_alive
Now that we have BinaryHeap::retain, stable since Rust 1.70.
2023-12-14 18:47:39 +01:00
TÖRÖK Attila bf9cf92af8 render/wgpu: Update wgpu to 0.18.0, naga to 0.14.1, naga_oil to 0.11.0, egui to 0.24.1 2023-12-14 01:36:42 +01:00
TÖRÖK Attila 4e689c6c17 tests/avm2: Reduce the number of digits in Vector3D tests
This makes them pass on aarch64 (for example, Android),
it looks nicer (no secret robot math), and more digits
are not necessary anyway. Also fix up formatting a bit.
2023-12-14 01:20:45 +01:00
TÖRÖK Attila 430f69de7b chore: Run `cargo update` 2023-12-13 22:01:02 +01:00
Tom Schuster 0fad4c23d2 desktop: Also spoof top.location.href 2023-12-13 20:10:39 +01:00
Nathan Adams 282f712f54 chore: Add browerstack message to readme 2023-12-12 20:33:17 +01:00
michiel2005 f28270376f avm1: Implement TextField.maxChars and fix pasting behavior 2023-12-12 14:06:14 -05:00
Crowdin Bot 9a02ca76ff chore: Update translations from Crowdin 2023-12-12 19:08:09 +01:00
renovate[bot] 3a033f0f28 fix(deps): update rust dependencies 2023-12-11 15:51:12 +01:00
renovate[bot] e196a544dd fix(deps): update rust crate bitstream-io to v2 2023-12-11 11:25:12 +01:00
bi4k8 4d07e43bc4
desktop: Add "wayland-data-control" feature for arboard
This fixes a crash on start when running under Wayland.
2023-12-11 10:08:15 +00:00
Matt Trescott 06646bc4b8 avm1: Support FLV date conversion
Fixes Riva Web Player crash (rivavx.de)
2023-12-10 22:30:39 -07:00
TÖRÖK Attila 512a03815d core/avm1: Stub NetConnection 2023-12-10 15:56:54 -07:00
David Wendt 27e1e1477a tests: Update the seek test as we now wind up on a different frame. 2023-12-09 12:19:10 -07:00
David Wendt 9c3d197e2f core: FLV must always backseek after finding our target otherwise we miss the keyframe. 2023-12-09 12:19:10 -07:00
David Wendt f1a1299707 core: Don't execute no-op seeks. 2023-12-09 12:19:10 -07:00
TÖRÖK Attila 1008a9559a web/extension: Lower minimum Firefox version on Android to 120 2023-12-09 18:49:18 +01:00
sleepycatcoding 742ccaf705 avm2: Correctly set the return type of AS defined native methods
Previously, the return type of ActionScript defined native methods was always incorrectly set to the any (`*`) type.
2023-12-09 18:32:31 +01:00
Lord-McSweeney 8096146a0d avm1: Correctly mark unloaded movies as unloaded instead of relying on depth 2023-12-09 00:29:37 +01:00
Aaron Hill 44c4080ae4 wgpu: Fix overly strict assertion for setVertexBufferAt
The offsets for bound attributes can overlap, which caused
us to compute the total size incorrectly. Fix this check
to take overlapping into account.
2023-12-08 23:53:39 +01:00