Commit Graph

11067 Commits

Author SHA1 Message Date
sleepycatcoding e8ccbf4e2c avm2: Support enumeration for XML objects
Previously, iterating the XML object would iterate the prototype. This broke filtering expressions on XML objects, which should work.
2023-11-10 22:50:19 +01:00
Crowdin Bot 949b294bdf chore: Update translations from Crowdin 2023-11-10 22:30:29 +01:00
Nathan Adams f03b6307a8 core: Don't invalidate when setting filters to the same value 2023-11-10 22:24:45 +01:00
Nathan Adams eb72cfb498 tests: Removed the need for test framework to depend on libtest_mimic 2023-11-10 22:02:18 +01:00
Nathan Adams 2b450af8d5 tests: Test framework doesn't need walkdir 2023-11-10 22:02:18 +01:00
Nathan Adams 7b7785e56d tests: Allow multiple renderers to handle a single test 2023-11-10 22:02:18 +01:00
Nathan Adams 8697a313ac tests: Move rendering interface into its own trait 2023-11-10 22:02:18 +01:00
Nathan Adams 86939e0e82 tests: Move TestUiBackend to backends/ui.rs 2023-11-10 22:02:18 +01:00
Nathan Adams bce0608e1f tests: Move all wgpu code out of test framework, make it abstract over any/no renderer, and make wgpu option if imgtests isn't enabled 2023-11-10 22:02:18 +01:00
Nathan Adams c36f4cfe95 tests: Move PrettyString out of lib 2023-11-10 22:02:18 +01:00
Nathan Adams 8a85a24213 tests: Move TestLogBackend to backends/log.rs 2023-11-10 22:02:18 +01:00
Nathan Adams 6a413e28f7 tests: Move TestAudioBackend to backends/audio.rs 2023-11-10 22:02:18 +01:00
Nathan Adams d1713010d2 tests: Move TestNavigatorBackend to backends/navigator.rs 2023-11-10 22:02:18 +01:00
Nathan Adams 2a2a717a06 tests: Appease clippy by implementing Default for some backends 2023-11-10 22:02:18 +01:00
Nathan Adams 673d52f013 tests: Move test framework into its own crate 2023-11-10 22:02:18 +01:00
Lord-McSweeney 2f5166790c chore: Update flash-lso 2023-11-10 18:26:02 +01:00
Lord-McSweeney d51cfff03d chore: Remove leftover `println!` 2023-11-09 22:38:09 -05:00
Aaron Hill c821d0564e avm2: Use class aliases to serialize Vector type
This allows us to round-trip `Vector.<CustomType>` when
`CustomType` has an alias registered.
2023-11-09 22:01:59 -05:00
Aaron Hill 7110be920c Suport uploading ATFTextureData::CompressedRawAlpha
Fortunately, this is very simple - we can just take
the DXT5 data and upload it directly to the wgpu texture.
2023-11-10 02:00:40 +01:00
Aaron Hill 2cb1efca8c avm2: Improve AVM2 button construction handling
An Avm2 button appears to run a 'nested frame' during construction -
the same type of 'nested frame' performed by a goto. This will
run framescripts for all objects in the display hierarchy (including
orphans), resulting in an unusual child->parent framescript execution
order that DeathVsMonstars_decrypted.swf depends on.
2023-11-10 01:33:07 +01:00
renovate[bot] d98a2750a0 chore(deps): update dependency chromedriver to v119 [security] 2023-11-10 00:14:34 +01:00
Daniel Jacobs 33e9227a50 tests: Bump tolerance of acid_color_0 to accommodate runner discrepancy 2023-11-09 16:31:17 -05:00
Daniel Jacobs bee3984104 tests: Stop ignoring shumway's acid_color_0 test 2023-11-09 16:31:17 -05:00
Mike Welsh 5232854f00 avm1: Implement `MovieClip.scale9Grid` 2023-11-09 21:38:53 +01:00
Mike Welsh aacc67b096 avm2: Implement `DisplayObject.scale9Grid` 2023-11-09 21:38:53 +01:00
Mike Welsh cc6320a2dc core: Add `DisplayObject::scaling_grid` 2023-11-09 21:38:53 +01:00
Richy McGregor 10ebc60a7d core: Always redraw text in relayout 2023-11-09 21:20:10 +01:00
Richy McGregor 924e5ef632 core: Store EditText requested height and width (close #13026)
remove now unused EditTextStatic bounds
2023-11-09 21:20:10 +01:00
Richy McGregor 4c819b5fca core: Make set_width & set_height call relayout
this requires an UpdateContext to be passed into both methods
2023-11-09 21:20:10 +01:00
Richy McGregor dad0bbaac8 tests: Add tests for AutoSize text 2023-11-09 21:20:10 +01:00
Richy McGregor fcc0d14188 core: Derive Debug for AutoSizeMode 2023-11-09 21:20:10 +01:00
Richy McGregor dd083dd502 chore: Fix typos 2023-11-09 21:20:10 +01:00
Nathan Adams 6061186c0f core: Fix formatting texts when they start with any amount of <br>s 2023-11-09 20:52:16 +01:00
Lord-McSweeney 249454885b render: In `ShapeTessellator`, set `mask_index_count` to `None` in `flush_draw` before aborting 2023-11-09 20:22:25 +01:00
Nathan Adams fe2ff4f242 chore: Update flash-lso 2023-11-09 20:01:52 +01:00
Aaron Hill bab2a80d64 Fix vtable property amf serialization 2023-11-09 19:43:55 +01:00
Aaron Hill 10d6157755 avm2: Work on AMF3 custom object serialization 2023-11-09 19:43:55 +01:00
Aaron Hill 2982c12ed4 Use VM_INTERNAL api version in helper methods
This is a better default than using the lowest possible version,
as it allows things like AMF deserialization to see all properties
on the target object.

This only affects explicit Ruffle-side property setting - interpreted
code will continue to use the namespace version determined by the
SWF version.
2023-11-09 19:22:27 +01:00
Aaron Hill fa05c66e2a avm2: Implement namespace versioning
This allows us to hide things like `MovieClip.isPlaying` from older
SWFs, which may define an `isPlaying` method without marking it
as an override.

This has the largest impact on public namespaces. There is no longer
just one public namespace - we now have a public namespace per API
version. Most callsites should use `Avm2.find_public_namespace()`,
which determines the public namespace based on the root SWF API version.
This ensures that explicit property access in Ruffle (e.g. calling
"toString") are able to see things defined in the user SWF.

This requires several changes other:

* A new `ApiVersion` enum is introduced, storing all of the api versions
  defined in avmplus
* NamespaceData::Namespace now holds an `ApiVersion`. When we read a
  namespace from a user-defined ABC file, we use the `ApiVersion` from
  the root movie clip. This matches Flash Player's behavior - when a
  child SWF is loaded through `Loader`, its API version gets overwritten
  with the parent's API version, which affects definition visibility and
  'override' requirements in the child SWF. Note that 'behavior changes'
  in methods like `gotoAndPlay` are unaffected.
* The `PartialEq` impl for `Namespace` has been removed - each call site must now choose
  to compare namespaces either by an exact version match, or by
  'compatible' versions (a `<=` check) with `Namespace::matches_ns`
* `PropertyMap` now uses `Namespace::matches_ns` to check for a
  compatible version when looking up a definition.
* When compiling our playerglobal, we pass in the `-apiversioning` flag,
  which causes asc.jar to convert `[API]` metadata into a special
  Unicode 'version mark' suffix in namespace URLs. We parse this
  when loading namespaces to determine the API version to use for
  playerglobal definitions (unmarked definitions use the lowest possible
  version).

Unfortunately, this makes ffdec unable to decompile our
playerglobal.swc
I've going to file an upstream issue
2023-11-09 15:27:33 +01:00
Lord-McSweeney 4d99459849 avm2: Add another FIXME to `create_text_line` 2023-11-09 13:38:48 +01:00
Lord-McSweeney af878c69b2 avm2: Always return same TextLine passed to `recreateTextLine` in `recreateTextLine` 2023-11-09 13:38:48 +01:00
Lord-McSweeney 9be62bf561 chore: fmt 2023-11-09 13:38:48 +01:00
Lord-McSweeney 8301ac16cf avm2: Stub TextJustifier.lineJustification; add constructor handling code 2023-11-09 13:38:48 +01:00
Lord-McSweeney 1f62c29738 avm2: Proper handling of null text of content element 2023-11-09 13:38:48 +01:00
Lord-McSweeney 952955099d avm2: Add a FIXME notice on TextBlock.recreateTextLine 2023-11-09 13:38:48 +01:00
Lord-McSweeney ef847cdbc4 avm2: Implement ContentElement.rawText 2023-11-09 13:38:48 +01:00
Lord-McSweeney dfdd8287fb avm2: Add a FIXME notice about DO Container methods being called on a TextLine 2023-11-09 13:38:48 +01:00
Lord-McSweeney f5a16ad46f chore: appease clippy 2023-11-09 13:38:48 +01:00
Lord-McSweeney 141b50d999 avm2: Implement TextLine.previousLine 2023-11-09 13:38:48 +01:00
Lord-McSweeney 2afb96c41b avm2: Stub InteractiveObject.accessibilityImplementation 2023-11-09 13:38:48 +01:00