Commit Graph

1700 Commits

Author SHA1 Message Date
Kamil Jarosz 86c0a30166 tests: Add textline_inapplicable_properties test
This test verifies the behavior of inapplicable
properties of `TextLine`.
2024-04-29 21:18:08 +02:00
Kamil Jarosz 31d8d98a10 tests: Add focusrect_mouse_swf8 test
This test verifies the behavior of focus highlight when
mouse is moved and mouse buttons are clicked for SWF8.
2024-04-24 00:49:37 +02:00
Kamil Jarosz a594d8d9ac tests: Add focusrect_mouse_swf9 test
This test verifies the behavior of focus highlight when
mouse is moved and mouse buttons are clicked for SWF9.
2024-04-24 00:49:37 +02:00
Kamil Jarosz 9bc5735d0d tests: Add stage_properties2 test 2024-04-23 23:13:02 +02:00
Adrian Wielgosik fd281cc715 avm2: Add IS_QNAME flag to Multiname, improve XML name matching 2024-04-22 22:08:40 +02:00
Kamil Jarosz 1f5d19971b tests: Add avm1/tab_ordering_events_mouse test
This test verifies how the behavior of tabbing is integrated with
the mouse with respect to rollOut/rollOver events.
2024-04-22 00:53:20 +02:00
Kamil Jarosz f3c9a84058 tests: Add avm1/tab_ordering_events test
This test verifies events produced by various interactive objects
while tabbing.
2024-04-22 00:53:20 +02:00
Kamil Jarosz d4bab66979 tests: Update avm1/selection_handlers test
Extend this test to cover rollOut/rollOver events too.
2024-04-22 00:53:20 +02:00
Lord-McSweeney ca4da9e5ee avm2: Fix regression from classes not being registered in order from the constant pool 2024-04-21 14:27:16 -07:00
turicfr 41bba9d5a5 tests: Update `movieclip_getbounds` test
This now enumerates the returned object using `Enumerate2` to match
the order of the stored properties.
2024-04-20 21:58:32 +02:00
Adrian Wielgosik 6ce88f24de avm2: Add an extra test for sparse arrays 2024-04-20 21:41:33 +02:00
jarca0123 7e349d9190 avm2: Add support for sparse arrays 2024-04-20 21:41:33 +02:00
Tom Schuster 02148b2891 tests: Test null data with navigateToURL 2024-04-19 18:56:25 +02:00
dependabot[bot] 5c1fcb9f26 build(deps): bump the cargo-minor group with 4 updates
Bumps the cargo-minor group with 4 updates: [serde](https://github.com/serde-rs/serde), [serde_json](https://github.com/serde-rs/json), [syn](https://github.com/dtolnay/syn) and [proc-macro2](https://github.com/dtolnay/proc-macro2).


Updates `serde` from 1.0.197 to 1.0.198
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.197...v1.0.198)

Updates `serde_json` from 1.0.115 to 1.0.116
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.115...v1.0.116)

Updates `syn` from 2.0.59 to 2.0.60
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.59...2.0.60)

Updates `proc-macro2` from 1.0.80 to 1.0.81
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.80...1.0.81)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-18 17:30:02 +02:00
Adrian Wielgosik a69b80b4bb avm2: Allow splice() on a Vector with fixed=true 2024-04-18 00:56:22 +02:00
Kamil Jarosz 93cd772b20 tests: Fix a typo in tab_ordering_tabbable 2024-04-17 11:20:52 -07:00
dependabot[bot] d3cc9d5fa5 build(deps): bump the cargo-minor group with 11 updates
Bumps the cargo-minor group with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.81` | `1.0.82` |
| [async-channel](https://github.com/smol-rs/async-channel) | `2.2.0` | `2.2.1` |
| [chrono](https://github.com/chronotope/chrono) | `0.4.37` | `0.4.38` |
| [encoding_rs](https://github.com/hsivonen/encoding_rs) | `0.8.33` | `0.8.34` |
| [fluent-templates](https://github.com/XAMPPRocky/fluent-templates) | `0.9.1` | `0.9.2` |
| [either](https://github.com/rayon-rs/either) | `1.10.0` | `1.11.0` |
| [quote](https://github.com/dtolnay/quote) | `1.0.35` | `1.0.36` |
| [syn](https://github.com/dtolnay/syn) | `2.0.58` | `2.0.59` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.79` | `1.0.80` |
| [webbrowser](https://github.com/amodm/webbrowser-rs) | `0.8.14` | `0.8.15` |
| [libtest-mimic](https://github.com/LukasKalbertodt/libtest-mimic) | `0.7.0` | `0.7.2` |


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

Updates `async-channel` from 2.2.0 to 2.2.1
- [Release notes](https://github.com/smol-rs/async-channel/releases)
- [Changelog](https://github.com/smol-rs/async-channel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-channel/compare/v2.2.0...v2.2.1)

Updates `chrono` from 0.4.37 to 0.4.38
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.37...v0.4.38)

Updates `encoding_rs` from 0.8.33 to 0.8.34
- [Commits](https://github.com/hsivonen/encoding_rs/compare/v0.8.33...v0.8.34)

Updates `fluent-templates` from 0.9.1 to 0.9.2
- [Release notes](https://github.com/XAMPPRocky/fluent-templates/releases)
- [Changelog](https://github.com/XAMPPRocky/fluent-templates/blob/master/CHANGELOG.md)
- [Commits](https://github.com/XAMPPRocky/fluent-templates/compare/fluent-templates-v0.9.1...fluent-templates-v0.9.2)

Updates `either` from 1.10.0 to 1.11.0
- [Commits](https://github.com/rayon-rs/either/compare/1.10.0...1.11.0)

Updates `quote` from 1.0.35 to 1.0.36
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.35...1.0.36)

Updates `syn` from 2.0.58 to 2.0.59
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.58...2.0.59)

Updates `proc-macro2` from 1.0.79 to 1.0.80
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.79...1.0.80)

Updates `webbrowser` from 0.8.14 to 0.8.15
- [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.14...v0.8.15)

Updates `libtest-mimic` from 0.7.0 to 0.7.2
- [Release notes](https://github.com/LukasKalbertodt/libtest-mimic/releases)
- [Changelog](https://github.com/LukasKalbertodt/libtest-mimic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/LukasKalbertodt/libtest-mimic/commits)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: async-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: encoding_rs
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: fluent-templates
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: either
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: quote
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: webbrowser
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: libtest-mimic
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-15 23:34:51 +02:00
Nick 752ced391c
avm1: use correct coordinates for hitTest (#15894) 2024-04-09 17:11:21 +00:00
Kamil Jarosz fc37555f66 tests: Add button_key_events test
This test verifies that all key-related events are properly firing
when a key is pressed and a button is focused.
2024-04-08 22:16:50 +02:00
Lord-McSweeney acd2d36790 tests: Add a test for a lookupswitch edge case 2024-04-05 00:34:50 +02:00
Lord-McSweeney 41100a9111 avm2: Add test for checking that exception targets are considered 2024-04-05 00:34:50 +02:00
Kamil Jarosz 686790409b tests: Add tab_ordering_tabbable test
This test verifies what objects are tabbable by default
and after setting tabEnable & tabIndex. This test includes:
* invisible objects,
* objects with 0x0 size,
* object outside of visible window bound,
* objects within invisible containers,
* non-selectable texts,
* non-editable texts.
2024-04-04 22:53:19 +02:00
Nathan Adams b7c9c870bb chore: Use workspace version for walkdir 2024-04-04 17:29:00 +02:00
Nathan Adams 19c914c5a8 chore: Use workspace version for url 2024-04-04 17:29:00 +02:00
Nathan Adams 9d665ce448 chore: Use workspace version for serde 2024-04-04 17:29:00 +02:00
Nathan Adams d8fec1cabc chore: Use workspace version for image 2024-04-04 17:29:00 +02:00
Nathan Adams 2036d85a95 chore: Use workspace version for futures 2024-04-04 17:29:00 +02:00
Nathan Adams 6cca9bb3b7 chore: Use workspace version for clap 2024-04-04 17:29:00 +02:00
Nathan Adams 26df7d78c4 chore: Use workspace version for chrono 2024-04-04 17:29:00 +02:00
Nathan Adams 4e3cd75c30 chore: Use workspace version for bitflags 2024-04-04 17:29:00 +02:00
Nathan Adams 8a390163d6 chore: Use workspace version for async-channel 2024-04-04 17:29:00 +02:00
Nathan Adams 8e4127aef6 chore: Use workspace version for anyhow 2024-04-04 17:29:00 +02:00
Kamil Jarosz 7f3c046a76 tests: Add focusrect_swf5 test
This test verifies the behavior of _focusrect for SWF5.
2024-04-04 10:58:42 +02:00
Kamil Jarosz cebd7f0e5c tests: Add focusrect_swf6 test
This test verifies the behavior of _focusrect for SWF6.
2024-04-04 10:58:42 +02:00
Kamil Jarosz 254cdabaf3 tests: Add focusrect_property_swf5 test
This test verifies the behavior of _focusrect for SWF 5.
2024-04-04 10:58:42 +02:00
Kamil Jarosz 7510780c67 tests: Add focusrect_property_swf6 test
This test verifies the behavior of _focusrect for SWF 6.
2024-04-04 10:58:42 +02:00
Kamil Jarosz fe43e1aa6a tests: Add focusrect_property_swf7 test
This test verifies the behavior of _focusrect for SWF 7.
2024-04-04 10:58:42 +02:00
Kamil Jarosz 501b42c63f tests: Add tab_ordering_movieclip_enabled_default test
This test verifies the logic behind the default value of
`MovieClip.tabEnabled` when it's undefined.
2024-04-02 00:31:34 +02:00
Kamil Jarosz a150fb3e69 tests: Add focus_highlight/focus_highlight_render 2024-04-01 23:38:59 +02:00
Kamil Jarosz 04eedcd4b4 tests: Add focus_highlight/focus_highlight_basic 2024-04-01 23:38:59 +02:00
Kamil Jarosz 95983bf4f3 core: Render yellow highlight on keyboard focus
This patch implements rendering of the yellow rectangle around
a focused element after pressing Tab. Focus tracker which is responsible
for keeping track of the current focus is now also responsible
for keeping track of the highlight and rendering thereof.
2024-04-01 23:38:59 +02:00
Kamil Jarosz f30824bf06 tests: Add tab_ordering_automatic_order_same_position test
This test verifies the behavior of duplicate (x,y) positions of objects.
Turns out, FP actually ignores other objects with the same position,
retaining only the first one.
2024-04-01 22:48:59 +02:00
Kamil Jarosz 12ff34d536 tests: Add tab_ordering_automatic_order_grid test
This test tests a grid with randomized (x,y) positions,
depths, and SWF tag positions.
It proves that mainly the position on the screen
determines the automatic order.
2024-04-01 22:48:59 +02:00
TÖRÖK Attila 36413a70f2 chore: Remove or ignore any unused deps detected by cargo-machete 2024-04-01 22:29:38 +02:00
Tom Schuster a8c917a788 tests: Add a test for DisplayObject.metaData 2024-04-01 12:31:59 +02:00
Kamil Jarosz d0e2483bc7 tests: Add tab_ordering_children test
This test verifies the behavior of `tabChildren`: how it affects
automatic and custom tabbing, and how it behaves in a hierarchy.
2024-03-30 00:15:45 +01:00
Kamil Jarosz c3843d2bf9 tests: Add tab_ordering_reverse test 2024-03-29 23:20:15 +01:00
Kamil Jarosz bc9aa18d6f tests: Add AutomatedEvent::KeyUp 2024-03-29 23:20:15 +01:00
Kamil Jarosz 67a04dcc75 tests: Add tab_ordering_properties_tab_index_edge_case test
This test covers the edge case of MovieClip.tabIndex,
where setting it to a string at the start returns this string
instead of a numerical value.
2024-03-27 00:40:24 +01:00
Kamil Jarosz 14820e59bf tests: Add tab_ordering_properties test
This test verifies the behavior of properties related to tab ordering.
2024-03-27 00:40:24 +01:00
Kamil Jarosz cc800da878 tests: Add tab_ordering_custom_basic test
This test checks the basic support of tab ordering
and its custom mode.
2024-03-27 00:40:24 +01:00
Kamil Jarosz 7e872a1b00 tests: Add tab_ordering_automatic_basic test
This test checks the basic support of tab ordering
and its automatic mode.
2024-03-27 00:40:24 +01:00
renovate[bot] 9dfc6dc224 fix(deps): update rust dependencies 2024-03-26 13:56:59 +01:00
renovate[bot] 98cbe9cf31 fix(deps): update rust dependencies 2024-03-25 02:47:32 +01: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 ec99bedcf8 avm1: added mouse_wheel_enabled to text fields 2024-03-18 22:17:32 +01:00
TÖRÖK Attila 7a269c054d fix(deps): update rust dependencies 2024-03-18 12:21:47 +01:00
renovate[bot] 3f9f19b7ac fix(deps): update rust dependencies 2024-03-14 16:45:29 +01:00
Tom Schuster a3a83ab1b8 tests: Test Object.prototype.toString when called on Vectors 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 a72d56c3ad tests: Test AVM2 toString on primitive objects 2024-03-12 21:00:26 -07:00
Tom Schuster 0466605b62 tests: Test RegExp toString behavior 2024-03-10 21:27:39 +01:00
Aaron Hill 7752c32c8e
avm2: Stub GameInput.getDeviceAt and GameInputControl (#15409) 2024-03-09 22:01:10 +00:00
Tom Schuster f27d11443b tests: Test avm2 Stage.stage3Ds vector-ness 2024-03-07 19:33:09 +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 41bac2ce98 tests: Add another verification test 2024-03-06 07:21:28 -08:00
Lord-McSweeney 2ff4bf5634 tests: Improve verification test 2024-03-06 07:21:28 -08:00
Nathan Adams 09dfa6427e desktop: Allow changing the language in Preferences 2024-03-05 00:02:27 +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
renovate[bot] c2179e88db fix(deps): update rust dependencies 2024-03-02 10:05:43 +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
TÖRÖK Attila e288375543 tests: Add a failing test for Timer.setDelay changing ID 2024-02-27 23:56:33 +01:00
renovate[bot] 9cdb2f31cc fix(deps): update rust dependencies 2024-02-26 08:14:26 +01:00
renovate[bot] 6b89737093 fix(deps): update rust dependencies 2024-02-19 11:32:22 +01:00
Tom Schuster ba7c9a4e31 avm2: Always serialize as ECMAArray, which produces an AMF0 MixedArray 2024-02-19 10:13:18 +01:00
Nathan Adams 8d9b50d4f4 tests: Port remainder of shumway tests over 2024-02-18 18:01:28 +01:00
Nathan Adams 0eab4405f6 tests: When a test is known_failure but doesn't have an expected.png, don't mark it as now-passing 2024-02-18 18:01:28 +01:00
Nathan Adams 50961bd684 tests: Don't test NaN output in amf_vector 2024-02-16 01:33:22 +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
svitkin b55db7083c tests: Add test for flash.net.navigateToURL 2024-02-12 17:14:11 +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 ec403e614d tests: Test TextField::getLineText 2024-02-07 20:34:43 +01:00
David Wendt e1bfd6f360 tests: Fix text failures caused by improper `output.txt` contents
For some reason, FP8 doesn't show the events anymore on its test output, even though the test it has clearly outputs both the connection status and events.

Also, the AVM2 test needs a trailing newline like all the others.
2024-02-07 19:46:39 +01:00
David Wendt 2e0dbba1b4 tests: AVM2 should also test to make sure `NetConnection.connected` works 2024-02-07 19:46:39 +01:00
David Wendt d7583289c9 avm1: Make `NetConnection.isConnected`'s stub more functional 2024-02-07 19:46:39 +01:00
Tom Schuster 95f5701072 tests: Verify the URLRequest method setter can throw 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
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
Kamil Jarosz 50b5f29c0a text: Make enter add a new line in multiline fields 2024-02-03 13:40:07 +01:00
Nathan Adams 50dedc3cb9 avm1: Invalidate cacheAsBitmaps when using Color API 2024-02-01 19:27:33 +01:00
Tom Schuster 120394ca7c tests: Add test for focusIn FocusEvent on a TextField 2024-02-01 12:52:10 +01:00
renovate[bot] 3737725a21 fix(deps): update rust dependencies 2024-01-30 09:23:15 +01:00
Lord-McSweeney a756970072 tests: Add a test for AVM2 verification 2024-01-29 22:48:00 -08:00
Aaron Hill 1cf669c75e avm2: Convert invalid rectangle to zero rectangle in getBounds 2024-01-29 13:25:16 -05:00
Aaron Hill f31d9bc491 avm2: Make Math.random() more closely match Flash Player
See the comments for details. Our previous implementation
was 'too good', and broke Bloons Tower Defense 5 by
generating `Number`s that Flash Player would never generate.
2024-01-28 22:46:19 -05:00
Aaron Hill 5b685d411f chore: Fix nightly Clippy lints 2024-01-28 16:03:29 -05:00
Tom Schuster 40c0f90105 tests: Test all remaining FileReference properties 2024-01-28 17:14:10 +01:00
Nathan Adams f678d13ca8 tests: Throw an Err, not panic, in Approximations::compare 2024-01-26 18:59:06 +01:00
Nathan Adams aee051fa45 tests: Split test running into tick/test phases. This is enough to make it work on web. 2024-01-26 18:59:06 +01:00
Nathan Adams b6614d9705 tests: Turn Test::run() into Test::create_test_runner() - handle running externally 2024-01-26 18:59:06 +01:00
Nathan Adams 1b8d3f7392 tests: Output comparison is part of the TestRunner 2024-01-26 18:59:06 +01:00
Nathan Adams 7c4e345905 tests: Make Environment::create_renderer only make one renderer, not N amount 2024-01-26 18:59:06 +01:00
Nathan Adams bd64ee2942 tests: Extract out Test::movie() 2024-01-26 18:59:06 +01:00
Nathan Adams 5040bf3aff tests: Extract out a TestRunner struct 2024-01-26 18:59:06 +01:00
Moulins ac7086528f avm1: Implement proper behavior for Gradient***Filter array setters
Among other things:
- resizing `colors` should also resize `alphas` and `ratios`
- shrinking `ratios` should also shrink `colors` and `alphas`, but
  growing it doesn't change the size
2024-01-26 18:40:06 +01:00
Moulins 31e69c51b5 test: Rewrite AVM filter tests and regroup them in a single file
This uncovers some bugs in our implementation, so mark the test as a
known failure for now.
2024-01-26 18:40:06 +01:00
Kamil Jarosz 225f42db2a tests: Test EditText's HTML behavior for SWF version 6 2024-01-26 18:20:06 +01:00
Kamil Jarosz ed59195ad1 tests: Test EditText's HTML behavior for SWF version 7 2024-01-26 18:20:06 +01:00
Kamil Jarosz 03b88259ca tests: Test EditText's HTML behavior for SWF version 8 2024-01-26 18:20:06 +01:00
Kamil Jarosz 62a46c7b60 core: Ignore font style in default TextFormat for HTML fields
It seems that font styles in the default text format
are ignored when dealing with an HTML field.

This patch revisits the fix from feacbdc1 (#13615),
which assumed that `<font>` resets font style.
That does not seem to be the case, but rather the bug
was caused by the invalid default text format,
which forced the text to be bold, due to the bold
variant of the font being linked to the text field.

This patch reverts 2f84d468 (#1201), which assumed that
the default color for a text span has 100% alpha.
The test added here contradicts it and it seems that
the default color is in fact rgba(0,0,0,0).
Testing the original SWF suggests that the underlying problem
has been fixed since that time.
2024-01-26 08:37:24 +01:00
David Wendt 006c3af4b8 core: Add backend method for getting the expected length of a response. 2024-01-25 23:24:09 -07:00
David Wendt 91dd9563bb core: Add method to read downloads in chunks instead of all-at-once. 2024-01-25 23:24:09 -07:00
David Wendt 06eb2e1ee8 core: `Request` is now a trait. Body download is deferred to a second async method. 2024-01-25 23:24:09 -07:00
Tom Schuster 70b6f62eab tests: Add tests for FileReferenceList browse 2024-01-25 19:10:56 +01:00
Aaron Hill bb9e7c04f7 avm2: Fix handling of Loader.loadBytes for images
I've switched back to the original code for creating
the bitmap/bitmapdata, rather than relying on custom
initialization logic that we only used in loader.

To make sure that the Bitmap/BitmapData are only exposed
to ActionScript at the correct time, I've added a new flag
to control when 'LoaderInfo.content' becomes non-null
2024-01-25 10:35:28 -05:00
Aaron Hill 820e7e828a wgpu: Allow Stage3D texture upload where source is smaller than dest
Fancy Pants World 4 relies on this behavior.
2024-01-25 00:30:10 +01:00
Aaron Hill 1cb24b41b0 render: Support PixelBender ByteArray/Vector.<Number> input/output
When ActionScript uses a ByteArray/Vector.<Number> as a shader input
or target, we create a temporary Rgba32Float texture, and copy the
input float32 bytes to/from the texture.

Unfortunately, wgpu doesn't seem to support an Rgb32Float (3-channel)
texture. When the shader uses 3 channels, we use a Rgba32Float
(4-channel) texture, and manually insert/remove padding for the
alpha channels. This isn't very efficient, but it's the simplest
solution.

The temporary textures themselves aren't cached anywhere - if this
becomes a performance issue, we could look into using some of our
existing wgpu texture/buffer pooling code.
2024-01-24 08:31:52 -05:00
Tom Schuster fbab0f6521 avm2: FileReference save test 2024-01-23 18:43:36 +01:00
Tom Schuster e4e0996fa1 avm2: FileReference load test 2024-01-23 18:43:36 +01:00
Tom Schuster 601748a987 avm2: FileReference browse select test 2024-01-23 18:43:36 +01:00
Tom Schuster 154e7e52ae avm2: FileReference browse canceling test 2024-01-23 18:43:36 +01:00
Tom Schuster 84e3280a41 avm2: Basic tests for FileReference 2024-01-23 18:43:36 +01:00
Tom Schuster 07afb04896 avm2: Fix FileFilter description getter 2024-01-23 18:43:36 +01:00
Aaron Hill 8dbcfe26f9 core: Display image load when using Loader.loadBytes
The handling of images in Loader.loaderBytes is similar to
the handling of SWFs - some of the data is exposed immediately
following the 'Loader.loadBytes' call, but the DisplayObject isn't
loaded until later.
2024-01-22 19:35:08 -05:00
sleepycatcoding 1804c23b93 avm2: Fix `Error.toString` regression
This was introduced by #14897, and to make sure this won't happen again I added a test.

Fixes #14901.
2024-01-22 19:34:12 +01:00
sleepycatcoding 2057417824 avm2: Implement `Error.prototype.toString`
And remove `ErrorObject::to_string` implementation. This fixes a few avmplus tests.
2024-01-22 15:09:55 +01:00
renovate[bot] 262dff83a4 fix(deps): update rust dependencies 2024-01-22 03:09:33 +01:00
Nathan Adams 4d16e24889 wgpu: Update wgpu and naga to 0.19 2024-01-21 19:36:08 +01:00
Tom Schuster 7e40abe0f0 tests: Test net.getClassByAlias 2024-01-21 17:23:29 +01:00
Tom Schuster e6f18b8b13 tests: Add DefineFont4 test 2024-01-19 23:14:58 +01:00
Tom Schuster e0f5b8906d desktop: Support device font with a non-zero index 2024-01-19 19:21:48 +01:00
Tom Schuster 0f445f4c80 tests: Test XML lookup with no namespace 2024-01-18 16:31:00 +01:00
Nathan Adams d717f92403 tests: Don't set logger in test framework, it's the responsibility of the caller 2024-01-18 16:07:24 +01:00
TÖRÖK Attila d153290fd6 nits: Fix a whole bunch of typos all over the place 2024-01-17 23:59:19 +01:00
Daniel Jacobs 8f2292c2c7 core: Add error for loading invalid SWF files and display as appropriate 2024-01-17 17:38:47 -05:00
Aaron Hill 97f868b8d5 avm2: Don't hold GcCell read ref open for Loader.loadBytes
We were holding this open while dispatching an event,
leading to a panic if anything attempted to modify the
ByteArray.
2024-01-17 17:05:52 -05:00
Tom Schuster aa64ace9d8 tests: Test XML with explicit 'use namespace' 2024-01-17 21:11:25 +01:00
Aaron Hill 6c420fa5d5 avm2: Run most of Loader.loadBytes immediately
This requires moving `set_root_movie` into `UpdateContext`.

Now, we preload the entire movieclip immediately - Flash Player
does this regardless of the size of the SWF.
The 'Loader::load_complete' is delayed to the end of the frame
(which is when the root class is constructed for the loaded clip).
2024-01-17 00:53:08 +01:00
Lord-McSweeney 95057ee214 tests: Add tests for `_lockRoot` 2024-01-15 17:15:36 -08:00
renovate[bot] 3c115238fd fix(deps): update rust dependencies 2024-01-16 01:13:38 +01:00
sleepycatcoding 5b19ecec97 avm2: Implement XML.setLocalName 2024-01-15 23:53:17 +01:00
Aaron Hill 3cbfbdd4a6 avm2: Add weird parse-as-uint special case to Object keys
When handling dynamic properties, avmplus will always try to
parse the string key name as a uint. If it succeeds, then the
key will be stored internally as a integer (via Atom), which is
observable by property iteration. The intention appears to have
been to support `obj[25] = someVal`, but it causes `obj["25"]`
and `obj[25]` to map to the same key (though iterating over the
object's keys will always produce a `number`).
2024-01-13 19:47:58 -05:00
Aaron Hill 639d17d259 Apply 'xml["@myattr"]' logic when setting/deleting properties
We previously only applied this when getting properties.
2024-01-12 19:13:35 -05:00
sleepycatcoding 2775c917bf avm2: Correctly handle `@*` in string_to_multiname 2024-01-13 00:27:28 +02:00
Kamil Jarosz 70486465e8 core: Support TextField.restrict when pasting 2024-01-11 23:22:49 +01:00
Kamil Jarosz 1db34993a2 tests: Add AutomatedEvent::SetClipboardText
Currently in tests (input.json) it is possible to trigger Ctrl-V using:

    { "type": "TextControl", "code": "Paste" },

But there is no way of populating the clipboard.
This patch adds AutomatedEvent::SetClipboardText, so the clipboard
may be populated before pasting:

    { "type": "SetClipboardText", "text": "<value>" },
    { "type": "TextControl", "code": "Paste" },
2024-01-11 23:22:49 +01:00
Kamil Jarosz 2ef63d3a61 avm2: Implement TextField.restrict 2024-01-11 23:22:49 +01:00
Kamil Jarosz 1c15cd55b9 avm1: Implement TextField.restrict 2024-01-11 23:22:49 +01:00
Kamil Jarosz 5feafb2ca3 avm1: Add support for onSetFocus & onKillFocus
Methods `onSetFocus` & `onKillFocus` are invoked when focus is changed
for `TextField`, `Button`, and `MovieClip`.
Multiple SWFs use these methods to listen to a focus change,
e.g. in order to implement placeholders for text fields.
2024-01-10 21:59:25 -05:00
Aaron Hill 57f6963133
render: Implement PixelBender Operation::Select (renamed from Loop) (#14503) 2024-01-11 01:04:50 +00:00
sleepycatcoding aeedec19fa avm2: Implement XML.normalize 2024-01-11 01:30:47 +01:00
Tom Schuster 629e8f89ab tests: Add a test for optimized index access from the interpreter 2024-01-10 23:18:40 +01:00
Tom Schuster f47e15b68c tests: Add a device font test using Tinos 2024-01-08 23:00:18 +01:00
Aaron Hill 6c2e28a08f Correctly handle zero-frame MovieClip
A MovieClip with zero frames can still have a child added
through ActionScript, which ticks normally.
2024-01-08 08:19:17 -05:00
renovate[bot] a328deab11 fix(deps): update rust dependencies 2024-01-08 02:59:04 +01:00
Aaron Hill 47db84473a avm2: Improve handling of Stage3D profile
We now validate the passed in profile, and return the selected profile
from 'Context3D.profile'. We don't yet alter the available
registers/textures based on the profile.
2024-01-07 22:34:33 +01:00
Aaron Hill 3156bf31ce avm2: Throw correct errors in Graphics.[drawPath,drawGraphicsData]
This is pretty straightforward, except for the fact that Flash
completely ignores the provided commands when the 'data' vector
is empty (if 'data' has even a single entry, then Flash will validate
that all of the commands have the correct amount of data to run).

One SWF that I tested relies on this behavior.
2024-01-07 19:57:47 +01:00
TÖRÖK Attila 268a1f5d18 tests: Remove most uses of exclude_warp
They no longer seem necessary with cargo nextest.
2024-01-07 05:58:13 +01:00
Tom Schuster c28be7bb5f tests: Test XML attribute name handling 2024-01-06 09:16:04 +01:00
Kamil Jarosz 47deaf50a2 core: Fix non-ASCII characters input in EditText
Casting the character to u8 and back to char caused some non-ASCII
non-control characters to be treated as control characters.
For instance the letter "ą" (U+0105) after casting to u8 and back
became ENQ (U+0005) which is a control character.
Some other letters worked, for instance the letter "ł" (U+0142)
became "B" (U+0042) and was not classified as a control character.

The test edittext_input was added to verify this behavior.
2024-01-05 13:03:43 -08:00
TÖRÖK Attila 217585daa8 chore: Delegate `[lints]` in `Cargo.toml` of all packages to the workspace 2024-01-05 11:28:19 +01:00
Lord-McSweeney 0a6a95e6f1 tests: Add a test 2024-01-03 15:14:11 +01:00
renovate[bot] 6a0a35c370 fix(deps): update rust dependencies 2024-01-01 02:44:40 +01:00
renovate[bot] 91d0520a43 fix(deps): update rust dependencies 2024-01-01 02:03:54 +01:00
Lord-McSweeney eac68a0647 tests: Add a test for accessing an unnamed Graphic 2023-12-31 07:06:08 +03:00
Aaron Hill 583327ff62 avm2: Properly set LoaderInfo.contentType from sniffed type 2023-12-29 18:40:25 -05:00
sleepycatcoding 41fb30a6a9 avm2: Do not set dispatched flag if dispatcher does not have a listener 2023-12-29 07:31:53 +03:00
Tom Schuster 28a3c7178a avm2: Check the text.engine.FontDescription properties before setting 2023-12-26 23:16:27 +01:00
renovate[bot] 216a8f3b14 fix(deps): update rust dependencies 2023-12-25 10:09:07 +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 d443bd9def avm1: Correctly handle undefined delimiter in String.split() 2023-12-20 10:38:17 -08: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
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
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
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
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
michiel2005 f28270376f avm1: Implement TextField.maxChars and fix pasting behavior 2023-12-12 14:06:14 -05: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
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
renovate[bot] 40b92e69f7 fix(deps): update rust dependencies 2023-12-05 21:08:16 +01:00
TÖRÖK Attila 82d61faa2c avm2: Use explicitly wrapping integer arithmetic operations 2023-12-03 16:34:27 +01:00
Aaron Hill 656d41f022 tests: Add tests for early SimpleButton allocation 2023-11-30 12:49:32 -08:00
Aaron Hill 58fe23857b tests: Add missing test class files
This does not change the test behavior
2023-11-30 12:49:32 -08:00
Lord-McSweeney 1ce3ec636a avm2: Prevent `AVM1Movie`s from being moved around in the DO hierarchy 2023-11-30 07:12:37 -08:00
Lord-McSweeney 4eec6afc0e tests: Add a test for AVM1 loading AVM2 2023-11-30 07:12:37 -08:00
Lord-McSweeney b2bd91d0ac tests: Add a test for AVM1 in AVM2 2023-11-30 07:12:37 -08:00
Aaron Hill 7289a8bd95 naga-agal: Zero-extend input vectors for cross-product
This matches the behavior of Flash Player
2023-11-30 01:15:21 +01:00
renovate[bot] 6da223a875 fix(deps): update rust dependencies 2023-11-27 09:44:47 +01:00
Aaron Hill e0998642f6 core: Divide by 255 in blend_over calculation
This prevents the value from being changed when blending a
source pixel of 0x0 over a destination pixel (with alpha).
2023-11-25 22:29:30 +01:00
Lord-McSweeney f41059a60a avm2: Version-gate `JSON` to SWFv13 and above 2023-11-25 13:15:42 -08:00
Aaron Hill f12f457f5d avm2: Fix handling of public indices with nested iteration
This more closely aligns our code with the corresponding avmplus code.
A user-supplied index of '0' is special-cased, and we correctly
resume iteration when a public index mismatch is detected.
2023-11-25 21:34:48 +01:00
MrCheeze 5920a6426e core: Allow Regular/Bold/Italic device fonts to be registered separately 2023-11-24 17:08:35 +01:00
sleepycatcoding 7be2eae4b8 avm2: Implement QName enumeration 2023-11-23 19:25:08 +01:00
Aaron Hill c920ceba51 avm2: Set RUNNING_CONSTRUCT_FRAME flag inside DisplayObject ctor
This ensures that this flag is set regardless of whether the
object is constructed by the timeline or from ActionScript
(it was previously only set when constructed by the timeline).
2023-11-23 10:36:37 -05:00
Robin Allen 253b1df928 Add failing test for bug involving constructor call order 2023-11-23 10:36:37 -05:00
Robin Allen cad162121b
core: Fix MorphShape inaccuracy on complex paths (#14089)
* core: Fix MorphShape inaccuracy on complex paths

It's inaccurate to interpolate the moveTo/lineTo deltas individually
because on complex paths they're often small integers, which won't
interpolate smoothly.

Instead, interpolate absolute positions.
2023-11-21 12:41:45 +00:00
MrCheeze d23d16cb11 avm2: Report ProgressEvent when a sound is loaded (close #8932) 2023-11-20 16:14:03 -08:00
renovate[bot] 7757d060ff fix(deps): update rust dependencies to v2 2023-11-20 09:03:08 +01:00
Lord-McSweeney 5be2eb499a avm1: Copy `Activation`'s local register set when running a `catch` 2023-11-19 10:15:36 -08:00
sleepycatcoding a78a67ee24 avm2: Implement [[HasProperty]] for XMLList 2023-11-16 16:09:37 -05:00
Nathan Adams 3a55b3a5fc tests: Clean up main method a bit 2023-11-13 22:28:10 +01:00
Nathan Adams d6f16b0be5 tests: Make tests use a virtual filesystem, which currently maps to the regular physical FS rooted in a test directory 2023-11-13 22:28:10 +01:00
Tom Schuster c7a1e1178a avm2: TLF GroupElement tests 2023-11-13 21:59:29 +01:00
renovate[bot] 32c65e6460 fix(deps): update rust dependencies 2023-11-13 09:10:26 +01:00
Aaron Hill 1501a858f6 avm2: Improve E4XNode::matches_name
Avmplus constructs a full `QName`, and uses the normal
Multiname matching logic. This would be a large refactor,
so I've just modified the existing method to properly
handle multiple namespaces.

I've also included a closely related fix - we should only treat
a multiname with the literal local name "@foo" as an attribute
when the namespace is the empty public namespace. We were incorrectly
reparsing multinames that contained multiple namespaces.
2023-11-12 17:38:56 -05:00
Aaron Hill c360d45729 avm2: Use 'has_own_property' to check for prop in 'resolve_definition'
If Actionscript explicitly sets the property to 'undefined', we
should still succeed.
2023-11-12 00:38:35 +01:00
Lord-McSweeney 1bb2422595
avm2: Correctness fixes to AMF serialization (#13537)
Fixes some cases where `amf::serialize_value` returns `None`
---------

Co-authored-by: Lord-McSweeney <Lord-McSweeney@github.com>
2023-11-10 17:59:26 -08:00
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
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
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
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
Richy McGregor dad0bbaac8 tests: Add tests for AutoSize text 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
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 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
Nathan Adams fa7e7cc8c1 tests: Add tests for NetConnection with Flash Remoting, and fix implementation to match 2023-11-09 12:39:22 +01:00
Nathan Adams e6b5ac9a2b tests: Allow tests to request http://example.org/foo/bar by loading ./example.org/foo/bar 2023-11-09 12:39:22 +01:00
Nathan Adams b06926f04d tests: Print fetched byte response 2023-11-09 12:39:22 +01:00
Nathan Adams 6d901a7463 avm2: Implement many NetConnection properties 2023-11-09 12:39:22 +01:00
Nathan Adams 08c707caa6 avm2: Implement NetConnection.close() 2023-11-09 12:39:22 +01:00
Nathan Adams 1ed1dba88e tests: Document log_fetch option 2023-11-08 16:50:24 +01:00
sleepycatcoding f334963b47 avm2: Handle single element XMLLists in XML.insertChildBefore/After 2023-11-07 23:23:53 +01:00
sleepycatcoding cea636da30 avm2: Include CData nodes in XMLList.text output 2023-11-07 23:23:53 +01:00
Tom Schuster e99eaafcd0 avm2: Fix two bugs in XML/XMLList set_property_local 2023-11-07 18:12:59 +01:00