Commit Graph

7339 Commits

Author SHA1 Message Date
Lord-McSweeney 604ac514b8 avm2: Properly push return value of `getsuper` in optimizer 2024-07-12 09:50:58 +03:00
Lord-McSweeney 08b2c5d0d6 avm2: Function's c_class should be named `Function$`, not `Function` 2024-07-12 09:50:58 +03:00
Lord-McSweeney f15128f6a2 avm2: Add `CallProperty` -> `Coerce(I/U/D)SwapPop` optimization, propagate types from `AsTypeLate` 2024-07-12 09:50:58 +03:00
Tom Schuster f788586e22 avm2: Add flash.events.NetFilterEvent 2024-07-12 00:20:16 +02:00
Kamil Jarosz ac9b39a652 core: Fix double caret rendering in justified text
The condition

  visible_selection.start() >= *start && visible_selection.end() <= *end

was inaccurate, because the end of the selection is exclusive.
That caused the condition to be true for two adjacent boxes.
For instance:

  box 1: from 0 to 6,  "hello "
  box 2: from 6 to 11, "world"

The caret was rendered for both boxes when it was at position 6.

When applying a correct condition (i.e. treating the end as exclusive)
there is a problem with rendering the caret at the very end of the text,
because the condition will not be triggered for any box
(position 11 in the example above).

That is why a condition specific to this case is added, i.e.

  *end == text_len

When the box is the last box in the text, we are forcing
the caret to be rendered.
2024-07-10 14:36:27 +02:00
Tom Schuster 8768143d7e avm2: Throw error for missing end tag in E4X 2024-07-09 01:01:15 +02:00
Tom Schuster 5aeae40bc5 avm2: Ignore mismatched end tags in E4X 2024-07-09 01:01:15 +02:00
dependabot[bot] 69abfa4528 build(deps): bump the cargo-minor group with 3 updates
Bumps the cargo-minor group with 3 updates: [bitstream-io](https://github.com/tuffy/bitstream-io), [syn](https://github.com/dtolnay/syn) and [toml_edit](https://github.com/toml-rs/toml).


Updates `bitstream-io` from 2.4.2 to 2.5.0
- [Commits](https://github.com/tuffy/bitstream-io/compare/v2.4.2...v2.5.0)

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

Updates `toml_edit` from 0.22.14 to 0.22.15
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.14...v0.22.15)

---
updated-dependencies:
- dependency-name: bitstream-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: toml_edit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 00:42:31 +02:00
dependabot[bot] 54ce439a5b build(deps): bump quick-xml in the cargo-minor group
Bumps the cargo-minor group with 1 update: [quick-xml](https://github.com/tafia/quick-xml).


Updates `quick-xml` from 0.35.0 to 0.36.0
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](https://github.com/tafia/quick-xml/compare/v0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: quick-xml
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 21:38:42 +02:00
Lord-McSweeney 62fd898c0d avm2: Remove two unused `Class` functions
`define_builtin_class_properties` and `define_slot_number_instance_traits`
2024-07-08 12:59:15 +03:00
Lord-McSweeney fffcd5184e avm2: Don't mark a class created from `Class::custom_new` as having its traits already loaded 2024-07-08 12:59:15 +03:00
Lord-McSweeney 1b5daf5981 avm2: Initialize global scope object earlier and remove `set_instance_class` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 0d637d34dd avm2: Remove `void`'s ClassObject 2024-07-08 12:59:15 +03:00
Lord-McSweeney f81136af2c avm2: De-optionify ScriptObjectData.instance_class 2024-07-08 12:59:15 +03:00
Lord-McSweeney 6cc1488f73 avm2: Remove all classless objects 2024-07-08 12:59:15 +03:00
Lord-McSweeney 953a02533f avm2: Fix created receiver value when constructing function 2024-07-08 12:59:15 +03:00
Lord-McSweeney 73e3728c03 avm2: Merge `init_instance_vtable` into `ClassObject::from_class_partial` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 01bdbd20d6 avm2: Pass a `Mutation` to `VTable::init_vtable` instead of an `UpdateContext` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 343ea346d2 avm2: Rename `Class::instance_vtable` to `Class::vtable` 2024-07-08 12:59:15 +03:00
Lord-McSweeney a68c48037b avm2: Remove `class_vtable` field from `ClassObject` 2024-07-08 12:59:15 +03:00
Lord-McSweeney b67dafb93c avm2: Convert `i_class` and `c_class` to a single enum 2024-07-08 12:59:15 +03:00
Lord-McSweeney 4442350912 avm2: Push correct type in optimizer for `NewClass` op 2024-07-08 12:59:15 +03:00
Lord-McSweeney efbaf6a0b0 avm2: Use proper slot type for `TraitKind::Class` 2024-07-08 12:59:15 +03:00
Lord-McSweeney e222a1646c avm2: Remove `Class::class_init` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 13ee356b8c avm2: Fix function prototype 2024-07-08 12:59:15 +03:00
Lord-McSweeney bac18c1a84 avm2: Simplify `ClassObject::link_type` 2024-07-08 12:59:15 +03:00
Lord-McSweeney 9c872860e9 avm2: Actually apply class refactor to ClassObject and describeType
This requires changing the AVM2 ClassObject symbol registry to use Classes
2024-07-08 12:59:15 +03:00
Lord-McSweeney bb50a6f926 avm2: Split `Class` into a i_class `Class` and a c_class `Class` 2024-07-08 12:59:15 +03:00
TÖRÖK Attila acc84769b6 desktop,chore: Bump `egui` to `v0.28.1` 2024-07-08 01:29:40 +02:00
Nathan Adams dd7692b211 core: Document audio+DO methods slightly 2024-07-07 23:57:24 +02:00
Nathan Adams 229697fbbd core: Correctly handle sound events attached to buttons. Fixes #2473 2024-07-07 23:57:24 +02:00
Nathan Adams 1ffb9d2ab9 avm1: Remove sounds when their clip is unloaded, fixes #7447, #14663 2024-07-07 23:57:24 +02:00
Nathan Adams 84df034f84 core: When stopping sounds associated with movieclips, go by path instead of pointer - fixes #9795 2024-07-07 23:57:24 +02:00
Kamil Jarosz dda4cbfd62 core: Use existing methods for rounding twips
Replace `round_to_pixel_half_even` and `round_down_to_pixel` with
existing methods used for rounding twips to pixels.
2024-07-07 21:45:52 +02:00
Lord-McSweeney 1c1fc099cb avm2: Add `flash.net.drm::LoadVoucherSetting` class 2024-07-07 16:03:52 +03:00
Lord-McSweeney 2d650faec0 avm2: Implement `flash.events::AVStatusEvent` and `flash.media::AVCaptionStyle` 2024-07-07 16:03:52 +03:00
Aaron Hill f0d224d88e avm2: Make 'Loader.unloadAndStop' call 'Loader.unload'
We still need to implement the 'stop' behavior, but this should
bring us closer to matching Flash Player.
2024-07-07 08:13:10 -04:00
dependabot[bot] cb8770663f build(deps): bump the cargo-minor group with 3 updates
Bumps the cargo-minor group with 3 updates: [serde](https://github.com/serde-rs/serde), [syn](https://github.com/dtolnay/syn) and [gilrs](https://gitlab.com/gilrs-project/gilrs).


Updates `serde` from 1.0.203 to 1.0.204
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

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

Updates `gilrs` from 0.10.7 to 0.10.8
- [Commits](https://gitlab.com/gilrs-project/gilrs/compare/v0.10.7...v0.10.8)

---
updated-dependencies:
- dependency-name: serde
  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: gilrs
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-07 13:10:44 +02:00
Lord-McSweeney 62f0e07171 avm2: Implement `flash.media::AVResult` 2024-07-07 13:10:33 +03:00
Polo da4eccfc68 avm2: Implement AuthenticationMethod 2024-07-06 22:23:00 +02:00
Polo e015695f47 avm2: Implement NetStreamAppendBytesAction 2024-07-06 22:23:00 +02:00
Polo 430c799e9d avm2: API versioning added for NetStreamPlayTransitions 2024-07-06 22:23:00 +02:00
Polo 3f0c693793 avm2: Implement NetStreamPlayTransitions 2024-07-06 22:23:00 +02:00
Kamil Jarosz 594201adc8 text: Implement double/triple click selection
This patch implements selecting words by double-clicking and
selecting lines by triple-clicking.
It also includes support for selecting words and lines while dragging.
2024-07-06 18:32:10 +02:00
Kamil Jarosz dc4ea60d13 text: Add TODO related to opening links 2024-07-06 18:32:10 +02:00
Kamil Jarosz d770422724 core: Calculate click index when not supplied 2024-07-06 18:32:10 +02:00
Kamil Jarosz 9f9d462381 core: Add click index to PlayerEvent::MouseDown 2024-07-06 18:32:10 +02:00
Kamil Jarosz 9188005820 core: Add click index to ClipEvent::Press 2024-07-06 18:32:10 +02:00
Nathan Adams f8cba925c3 core: Update flash-lso, removes cookie-factory 2024-07-06 12:27:26 +02:00
dependabot[bot] 26ee124eb7 build(deps): bump the cargo-minor group across 1 directory with 2 updates
Bumps the cargo-minor group with 2 updates in the / directory: [ttf-parser](https://github.com/RazrFalcon/ttf-parser) and [fontdb](https://github.com/RazrFalcon/fontdb).


Updates `ttf-parser` from 0.21.1 to 0.24.0
- [Changelog](https://github.com/RazrFalcon/ttf-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/ttf-parser/compare/v0.21.1...v0.24.0)

Updates `fontdb` from 0.18.0 to 0.20.0
- [Changelog](https://github.com/RazrFalcon/fontdb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/fontdb/compare/v0.18.0...v0.20.0)

---
updated-dependencies:
- dependency-name: ttf-parser
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: fontdb
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-05 01:41:48 +02:00
Tom Schuster 7884a35e87 avm2: Properly enumerate Proxy objects for AMF serialization
Fixes #16931:
2024-07-04 18:43:01 +02:00
TÖRÖK Attila 4dd77f903e desktop: Update `egui` to `v0.28.0` 2024-07-04 11:32:48 +02:00
Aaron Hill c65033aa37 avm2: Ignore errors when setting properties in amf deserializer
Flash Player *traces* any errors that occur during setting properties
on the newly-constructed object durting AMf deserialization, and
continues deserializing.
2024-07-03 17:42:02 -04:00
Kamil Jarosz 5aaff966aa text: Render caret using lines
This patch makes the caret be drawn using lines.
This ensures that the width of the caret is always 1px.

Additionally, it improves caret positioning, so that it's closer to FP.
2024-07-03 15:09:31 +02:00
Kamil Jarosz 59c0bcf073 core: Improve EditText's border and background rendering
This patch removes the drawing used for rendering the border and
the background and renders them using primitives instead.

It provides two methods for drawing the border and the background:
* draw_device_text_box -- when device fonts are used,
* draw_text_box -- when fonts are embedded.

Updated expected images in tests as they are closer to FP now:
* text/auto_size/height,
* text/auto_size/return,
* text/auto_size/width,
* visual/shumway_acid_tests/acid_color_0.

For the test avm2/stage3d_texture it's hard to say whether the current
output is closer to FP or not, as FP renders it with a different scale.
However, I have confirmed that there exists a scale at which FP renders
the text fields exactly as Ruffle after this patch.
2024-07-02 23:40:50 +02:00
Kamil Jarosz 23f01e0dd9 render: Add Matrix::create_box_with_rotation
This patch splits the current method of create_box into
1. create_box -- without rotation, and
2. create_box_with_rotation -- with rotation.

The reason for that refactor is that create_box was often used without
rotation, and always passing 0.0 as rotation and having
a dedicated condition for 0.0 was superfluous.
2024-07-02 23:40:50 +02:00
Marco Bartoli fe08638d26
Implement ImportAssets/ImportAssets2 (#16420) 2024-07-02 11:41:48 +00:00
Aaron Hill 617cb3330d avm2: Ignore ClassObject call receiver
This allows a class to be used with `callproplex`
2024-07-02 07:18:22 -04:00
Lord-McSweeney 83d0316ac3 avm2: Add stub notices for reusing Loader 2024-07-02 06:58:37 +03:00
Lord-McSweeney d2e3de4cc4 avm2: Unload the contents of a Loader before `load` and `loadBytes` 2024-07-02 06:58:37 +03:00
Aaron Hill ebab349458 avm2: Stub Stage.mouseLock 2024-07-01 23:13:02 -04:00
dependabot[bot] 28aa2e65a9 build(deps): bump the cargo-minor group across 1 directory with 7 updates
Bumps the cargo-minor group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.7` | `4.5.8` |
| [bitflags](https://github.com/bitflags/bitflags) | `2.5.0` | `2.6.0` |
| [log](https://github.com/rust-lang/log) | `0.4.21` | `0.4.22` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.117` | `1.0.120` |
| [num-bigint](https://github.com/rust-num/num-bigint) | `0.4.5` | `0.4.6` |
| [id3](https://github.com/polyfloyd/rust-id3) | `1.13.1` | `1.14.0` |
| [either](https://github.com/rayon-rs/either) | `1.12.0` | `1.13.0` |



Updates `clap` from 4.5.7 to 4.5.8
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.7...v4.5.8)

Updates `bitflags` from 2.5.0 to 2.6.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.5.0...2.6.0)

Updates `log` from 0.4.21 to 0.4.22
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.21...0.4.22)

Updates `serde_json` from 1.0.117 to 1.0.120
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.120)

Updates `num-bigint` from 0.4.5 to 0.4.6
- [Changelog](https://github.com/rust-num/num-bigint/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-bigint/compare/num-bigint-0.4.5...num-bigint-0.4.6)

Updates `id3` from 1.13.1 to 1.14.0
- [Changelog](https://github.com/polyfloyd/rust-id3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/polyfloyd/rust-id3/compare/v1.13.1...v1.14.0)

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

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: log
  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: num-bigint
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: id3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: either
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 01:04:52 +02:00
Lord-McSweeney 67c9936bf4 avm2: Use proper coercion in XMLList prototype methods 2024-07-01 18:40:47 +02:00
Tom Schuster 58c231588d core: Stop searching after finding the first default font 2024-06-30 11:32:06 +02:00
TÖRÖK Attila 6aa2dde859 chore: Update quick-xml to 0.35.0 2024-06-30 11:17:38 +02:00
Tom Schuster 5618a3d048 avm2: FP10 version DisplayObject rotationX/Y/Z and scaleZ
Fixes #16910
2024-06-30 09:48:40 +02:00
Kamil Jarosz 19649cc69b text: Do not clamp font size for SWF13+ 2024-06-29 22:57:55 +02:00
Kamil Jarosz c350be43b8 avm2: Implement TextField.getTextRuns() 2024-06-29 22:57:55 +02:00
Kamil Jarosz bcbf3ba3d1 text: Support TextFormat.display 2024-06-29 22:57:55 +02:00
Kamil Jarosz 3bf5e28348 avm2: Implement TextRun 2024-06-29 22:57:55 +02:00
Kamil Jarosz 95cc3c52f3 avm2: Fix highlight bounds for buttons
Similarly to AVM1, AVM2 buttons also use their
hit bounds as highlight bounds.
2024-06-29 22:42:25 +02:00
Kamil Jarosz a3dddbd80d avm2: Roughly implement `TextField.*IndexAtPoint`
Both implementations currently use `screen_position_to_index`, which
is inaccurate, and that's why these methods still produce a stub warning.
However, this implementation makes some games work, is a lot better than
a perfect implementation which would require a lot of work and time,
and infinitely better than no implementation at all.
2024-06-29 22:28:16 +02:00
Kamil Jarosz a9708a8017 debug_ui: Draw bounds on hover
When the user hovers on world bounds and highlight bounds,
debug rects signifying their positions are automatically drawn.
2024-06-29 21:57:32 +02:00
Kamil Jarosz 59a8d1e8a1 debug_ui: Improve debug rect bounds calculation
Before this patch, it was possible that some objects did not have a
debug rect despite existing on the stage and interacting with the user.
That was the case for instance for buttons with hit bounds and no up state.

This patch ensures that debug rect is at least as big as highlight bounds,
which are used to highlight focused objects on the stage.
2024-06-29 21:57:32 +02:00
Kamil Jarosz 056650337e chore: Remove unnecessary returns 2024-06-29 11:29:02 +02:00
Kamil Jarosz ee8c9e21fa avm2: Implement TextField.getLineIndexOfChar() 2024-06-29 11:29:02 +02:00
Kamil Jarosz b55d4d1021 avm2: Fix TextField.getLineText()
This patch makes the implementation more performant, simpler, and
fixes its behavior related to returning the line delimiter and tabs.
2024-06-27 22:02:41 +02:00
Kamil Jarosz 9a6708f4b1 avm2: Implement TextField.getLineOffset() 2024-06-27 22:02:41 +02:00
Kamil Jarosz 57b371900b avm2: Implement TextField.getLineLength() 2024-06-27 22:02:41 +02:00
Kamil Jarosz 8569df9503 text: Add start and end text positions to LayoutLine
By adding start and end positions to LayoutLine, it's now easy to
calculate the line length, get its text, or search through lines.
2024-06-27 22:02:41 +02:00
Kamil Jarosz dcafb3d291 text: Assume at least one span is present during layout
After some past refactors, it's true now that during layout there's
at least one text span, which is ensured by the span normalization.
This refactor simplifies code.
2024-06-27 22:02:41 +02:00
Kamil Jarosz a606fcc8ed text: Implement Debug for LayoutContent 2024-06-27 22:02:41 +02:00
Kamil Jarosz 47ea369047 text: Add text positions to all layout boxes
This refactor adds positions to all layout boxes, not only texts.
Positions for bullets and drawings are used only for obtaining
information about their location relative to other layout boxes,
so that searching and other various operations on boxes are easier.
2024-06-27 22:02:41 +02:00
Aaron Hill 8bea6d4ef9 avm2: Parse and load DoAbc/DoAbc2 tags during frame execution
Parsing and loading the definitions from an DoAbc/DoAbc2 tag
is visible to ActionScript - any definitions will become accessible,
and the script initializer will be run when accessing any of those
definitions.

We now delay the actual parsing/loading traits from DoAbc2 tags.
This is run before we process any SymbolClass tags, and only runs
the first time that we execute a frame.

This also fixes an issue where we would incorrectly produce a
`VerifyError` during preloading when trying to load a superclass
for a `Class` for a tag in a future frame. That frame might require
other class definitions to be populated first (e.g. by a `Loader`
in the first frame).
2024-06-27 21:44:40 +02:00
TÖRÖK Attila e75299702b chore: Bump bitstream-io to 2.4.2 2024-06-27 21:19:36 +02:00
Kornelius Rohrschneider 4d6dd38616 core: Make the form loader use Windows-1252 if SWF version <= 5
The form loader now loads files using Windows-1252 if the SWF version is
smaller than 6. This roughly matches Flash's behaviour (Flash uses
Windows-1252 on Windows, on macOS a slightly different custom encoding
is used).
Previously, UTF-8 has been (wrongly) used for all SWF files if
System#useCodepage hasn't been set to true, leading to incorrectly
displayed characters.
2024-06-26 02:37:44 +02:00
Kornelius Rohrschneider 0b30b7fdda core: Use HTTP response encoding if existing
If System#useCodepage has been set to true, the form loader now uses the
encoding specified in the HTTP response content type field, if existing,
to decode remote text files. chardetng is now (only) used if the HTTP
response doesn't specify any encoding or if the file is local.
2024-06-26 02:37:44 +02:00
Kornelius Rohrschneider 870bdae6fd core: Add support of non-UTF-8 encodings to the form loader
Flash's form loader loads text files in the local system codepage if
System#useCodepage has been set to true. Previously, Ruffle always
(wrongly) used UTF-8, leading to incorrectly displayed characters.
This has been fixed. Ruffle now supports loading files with an encoding
other than UTF-8.
As Ruffle doesn't always have access to the system codepage and as it's
not reliably the correct encoding, the crate chardetng has been added.
It's used instead of the system codepage to detect the encoding, and the
data is converted into UTF-8.
2024-06-26 02:37:44 +02:00
Crowdin Bot e83e39ad27 chore: Update translations from Crowdin 2024-06-25 00:26:30 +02:00
dependabot[bot] 8877eebdb2 build(deps): bump the cargo-minor group across 1 directory with 4 updates
Bumps the cargo-minor group with 4 updates in the / directory: [bytemuck](https://github.com/Lokathor/bytemuck), [syn](https://github.com/dtolnay/syn), [proc-macro2](https://github.com/dtolnay/proc-macro2) and [libloading](https://github.com/nagisa/rust_libloading).


Updates `bytemuck` from 1.16.0 to 1.16.1
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.16.0...v1.16.1)

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

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

Updates `libloading` from 0.8.3 to 0.8.4
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.3...0.8.4)

---
updated-dependencies:
- dependency-name: bytemuck
  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: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 00:08:16 +02:00
Tom Schuster fe754d7fed avm2: Change map().unwrap_or() to map_or() 2024-06-24 16:36:25 +02:00
Tom Schuster 0a513f273e avm2: Cleanup some Value::Object matching 2024-06-24 16:36:25 +02:00
Kamil Jarosz 04dfd1f22f avm2: Do not fire roll over events on focus change (yet)
This patch bypasses AVM2 conditionally when firing roll over events
triggered by a focus change until a proper support for AVM2 events
is implemented.
2024-06-23 13:30:27 +02:00
Lord-McSweeney 9271618185 avm2: Properly import stub_getter and stub_setter in Shader 2024-06-22 13:28:01 -07:00
Aaron Hill dc03f541db avm2: Match Flash behavior for DoAbc/SymbolClass script initializers
Flash Player handles SymbolClass tags and eager (non-lazy) DoAbc2 tags in an unusual way:
During the first time that a given frame is executed:
1. All SymbolClass tags are processed in order, triggering ClassObject loading (and the associated
   script initializer execution, if it hasn't already been run)
2. All eager (non-lazy) DoAbc/DoAbc2 tags have their *final* script initializer executed.

To implement this, we now cache the needed `Script` and symbol class
data during preloading. The first time we execute a frame, we run
the symbolclass class lookup and assignment, followed by the final
script initializer for each DoAbc2 tag in the frame.

This fixes 'minidash' (and probably other crossbridge games as well).
2024-06-21 16:57:06 +02:00
Kamil Jarosz adea7ae743 text: Refactor EditText.line_text
This refactor takes advantage of the
new layout structure to simplify code.
2024-06-21 16:41:56 +02:00
Kamil Jarosz bfbd2dbd19 text: Refactor EditText.layout_metrics
This refactor takes advantage of the
new layout structure to simplify code.
2024-06-21 16:41:56 +02:00
Kamil Jarosz 50ade23779 text: Implement Layout.bounds 2024-06-21 16:41:56 +02:00
Kamil Jarosz ba13386788 text: Restructure layout to include text lines
This patch removes `LineData` & `get_line_data` and incorporates
their logic into layout calculation adding `Layout` and `LayoutLine`.
The goal is to simplify operations on the layout, as now
line data is always present and integrated with the layout.
Specialized methods may be added to `Layout` and `LayoutLine`
in the future.
2024-06-21 16:41:56 +02:00
Kamil Jarosz d2f5b78503 text: Move lower_from_text_spans to module level 2024-06-21 16:41:56 +02:00
Lord-McSweeney 1164dd747a avm2: Merge locals better 2024-06-20 17:02:13 -07:00
Lord-McSweeney 1389f5fa67 avm2: Record all jump sources in verifier 2024-06-20 17:02:13 -07:00
Kamil Jarosz 8b2c9d8157 avm2: Add stub for winding behavior of drawing triangles in Graphics
Currently, even-odd winding rule is used to render triangles,
but FP uses non-zero.
2024-06-19 23:24:55 +02:00
Kamil Jarosz 14ac29e435 avm2: Handle wrong number of coords when drawing triangles in Graphics
FP throws an error when the number of coordinates is odd for the indexed
version, and when is not divisible by 6 for the non-indexed version.
2024-06-19 23:24:55 +02:00
Kamil Jarosz 86a3086808 avm2: Fix errors thrown when culling has wrong value in Graphics
The errors differ between Graphics.drawTriangles and GraphicsTrianglePath.
The former throws 2004, whereas the latter throws 2008.
2024-06-19 23:24:55 +02:00
Kamil Jarosz 64acc7b3ad avm2: Ignore out of range and non-integer triangle indices in Graphics
This behavior imitates FP's behavior.
2024-06-19 23:24:55 +02:00
Kamil Jarosz 2b9289e1b2 avm2: Implement culling for drawing triangles in Graphics 2024-06-19 23:24:55 +02:00
Kamil Jarosz 4993d70594 avm2: Unify drawing triangles in graphics.rs
There were two implementations for drawing triangles: one for
Graphics.drawTriangles, and the other for GraphicsTrianglePath.
However, they behave almost identically, so this patch uses
draw_triangles_internal for both.
2024-06-19 23:24:55 +02:00
Kamil Jarosz 9e1248d130 avm2: Add make_error_1125 2024-06-19 23:24:55 +02:00
Nathan Adams 4d12e0e5b4 core: Implement LocalConnection 2024-06-19 21:54:25 +02:00
Kamil Jarosz 0f534c837f avm2: Improve drawing paths in Graphics
This patch improves drawing paths in Graphics:
* no error is thrown when there are 0 commands,
* no error is thrown when there are missing data points,
* an error is thrown when the number of coordinates is odd,
* no error is thrown and command processing is stopped
  when an unknown command is encountered,
* the vector with parsed commands is removed, as it's not needed.
2024-06-19 20:58:33 +02:00
Kamil Jarosz fae1500cc6 avm2: Add make_error_2004 2024-06-19 20:58:33 +02:00
Kamil Jarosz 687e049dc1 debug_ui: Add option to draw layout boxes for EditText 2024-06-19 20:12:43 +02:00
TÖRÖK Attila 35f5227e2d core,desktop: Update `wgpu` to `v0.20.1`, bump `egui` 2024-06-18 23:10:43 +02:00
Lord-McSweeney 9c8e4d7dce core: Remove `DataFormat` for `URLLoader` loads since we can just check the string field
Also, don't set the data as variables if there is no data to set.
2024-06-18 20:56:50 +02:00
Lord-McSweeney 7a1ee0e109 core: `URLLoader` should check the data format after loading finishes, not when starting a load 2024-06-18 20:56:50 +02:00
Crowdin Bot a731b82b54 chore: Update translations from Crowdin 2024-06-17 14:57:20 +02:00
Adrian Wielgosik cacfb5a6a4 avm2: Fix and unify converting SWF's 1-based to 0-based slot indexing 2024-06-16 16:11:17 -07:00
Tom Schuster 4463a69c87 avm2: Implement namespace support for flash.xml 2024-06-15 22:26:57 +02:00
Crowdin Bot 8fb214ea71 chore: Update translations from Crowdin 2024-06-14 22:41:19 +02:00
Lord-McSweeney 18c50df838 avm2: Don't get the `Class` class by using `instance_of` in `into_finished_class` 2024-06-13 23:49:52 +02:00
Lord-McSweeney 1705870951 avm2: Class initializers will be called twice when constructing two `ClassObject`s for one `Class` 2024-06-13 23:49:52 +02:00
Lord-McSweeney 7e7032d908 avm2: Remove `constructor`, `native_constructor`, and `call_handler` fields from `ClassObject`
They were already present on `Class`
2024-06-13 23:49:52 +02:00
dependabot[bot] 52404bc3aa build(deps): bump the cargo-minor group with 6 updates
Bumps the cargo-minor group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.4` | `4.5.7` |
| [url](https://github.com/servo/rust-url) | `2.5.0` | `2.5.1` |
| [linkme](https://github.com/dtolnay/linkme) | `0.3.26` | `0.3.27` |
| [regex](https://github.com/rust-lang/regex) | `1.10.4` | `1.10.5` |
| [zip](https://github.com/zip-rs/zip2) | `2.1.2` | `2.1.3` |


Updates `clap` from 4.5.4 to 4.5.7
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.4...v4.5.7)

Updates `url` from 2.5.0 to 2.5.1
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.0...v2.5.1)

Updates `linkme` from 0.3.26 to 0.3.27
- [Release notes](https://github.com/dtolnay/linkme/releases)
- [Commits](https://github.com/dtolnay/linkme/compare/0.3.26...0.3.27)

Updates `regex` from 1.10.4 to 1.10.5
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.4...1.10.5)

Updates `zip` from 2.1.2 to 2.1.3
- [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/v2.1.2...v2.1.3)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: url
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: linkme
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: quick-xml
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: regex
  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-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-13 01:05:26 +02:00
Crowdin Bot 4fa5853f88 chore: Update translations from Crowdin 2024-06-13 00:44:49 +02:00
Nathan Adams c9b111996f web: Make serde (more-)optional in core 2024-06-13 00:22:33 +02:00
Kamil Jarosz e8dbd58306 core: Use DisplayObject.movie() instead of context.swf where applicable
This prevents problems in case of mixed-AVM content.
2024-06-13 00:06:10 +02:00
Kamil Jarosz 39e8a15db5 core: Update focus after handling press, not before
Updating focus before handling press caused onRollOut
to be fired before onPress, but it should be fired after.
2024-06-12 23:49:06 +02:00
TÖRÖK Attila 516c56db15 chore: Suppress a `clippy::doc_lazy_continuation` beta lint false positive 2024-06-12 23:09:39 +02:00
TÖRÖK Attila 0d25b5dba8 chore: Fix `clippy::needless_borrows_for_generic_args` beta lint 2024-06-12 22:42:18 +02:00
TÖRÖK Attila 6b4ee7dfde chore: Fix most `clippy::doc_lazy_continuation` beta lints 2024-06-12 22:42:18 +02:00
Lord-McSweeney 0e062c4b9b avm2: Replace two more uses of `instance_of` with `instance_class` 2024-06-12 19:46:32 +02:00
Lord-McSweeney 97f75cc0b4 avm2: Move interface logic from `ClassObject` to `Class` 2024-06-12 19:46:32 +02:00
Lord-McSweeney 90c370d61b avm2: Always store a Class on vtable 2024-06-12 19:46:32 +02:00
Lord-McSweeney 2c9028d2f9 avm2: Replace most uses of `instance_of` with `instance_class`
Also store a Class -> alias mapping instead of a ClassObject -> alias mapping for AMF.
2024-06-12 19:46:32 +02:00
Crowdin Bot 3b9bb3f5db chore: Update translations from Crowdin 2024-06-10 00:02:16 +02:00
Adrian Wielgosik bc85638920 avm2: Port registerClassAlias logic to Rust 2024-06-09 09:14:20 -07:00
Kamil Jarosz 142fc1d232 core: Prevent copying and cutting text from a password field 2024-06-09 15:38:35 +02:00
Kamil Jarosz c23ec0782a core: Prevent pasting empty string when the clipboard is empty 2024-06-09 15:38:35 +02:00
Kamil Jarosz a2751c3c0f core: Add English translations for copy/paste context menu 2024-06-09 15:38:35 +02:00
Kamil Jarosz 6117c3c68e core: Add copy/paste context menu for EditText
This menu is shown when the EditText is focused and the mouse hovers over it.
It has the following elements, which may be disabled
when e.g. the field is not editable / selectable:
* Cut,
* Copy,
* Paste,
* Delete,
* Select All.
2024-06-09 15:38:35 +02:00
Kamil Jarosz 0910104c3b core: Add EditText::is_text_control_applicable
This method is useful for checking whether the given text control code
may be applied to the current state of the EditText.
2024-06-09 15:38:35 +02:00
Kamil Jarosz 1f3c230691 core: Pass UpdateContext to ContextMenuState::build_builtin_items
This simplifies code, as we do not have to access
the same elements over and over.
2024-06-09 15:38:35 +02:00
Adrian Wielgosik 2955add845 avm2: In Array.sortOn, behave better in presence of nonsense args 2024-06-09 11:11:57 +02:00
Lord-McSweeney 1d1eb6c966 avm2: Fix `NewClass` not popping the base class and better null propagation in optimizer 2024-06-08 14:25:43 -07:00
Lord-McSweeney bb7a315afd avm2: Misc. optimizer improvements 2024-06-08 14:25:43 -07:00
Nathan Adams 70fca6fa0a web: Add create_audio to builder 2024-06-08 08:42:04 +02:00
Nathan Adams 3fa8735e97 web: Don't parse config in Rust, do it in Typescript with some tests 2024-06-08 08:42:04 +02:00
Lord-McSweeney 6e53f98068 avm2: Fix performance regression
A `ScriptObject` was being allocated on every `call_method` call
2024-06-08 00:31:29 +02:00
Kamil Jarosz 2704e1f506 core: Implement setting tabChildren for AVM1 for debug UI 2024-06-08 00:12:53 +02:00
Kamil Jarosz b43f23ce9a core: Move a tabChildren-related comment to the proper place 2024-06-08 00:12:53 +02:00
Kamil Jarosz 191e879172 avm2: Properly implement Stage.tabChildren
Stage.tabChildren does not modify the value of tabChildren of the stage,
but rather sets the tabChildren of the root movie.
2024-06-08 00:12:53 +02:00
Kamil Jarosz da80f6d76e debug_ui: Add "Tab children enabled" 2024-06-08 00:12:53 +02:00
Tom Schuster c1ace7edc7 avm2: Use an empty string as the prefix for xmlns= 2024-06-06 20:14:40 +02:00
Kamil Jarosz c3ad08c810 avm1: Treat MovieClip.createTextField params as integers
The parameters x,y,width,height of MovieClip.createTextField
should be integers.
2024-06-06 17:08:52 +02:00
Kamil Jarosz 5c89dd8374 avm2: Make the root movie non-highlightable 2024-06-05 02:08:13 +02:00
Kamil Jarosz c51f13e4e4 debug_ui: Add "Is Root" to Display tab 2024-06-05 02:08:13 +02:00
Kamil Jarosz 348cb6ea6d core: Remove unnecessary SWF version check in is_focusable
This check is unnecessary as is_focusable is only used in AVM1.
2024-06-05 02:08:13 +02:00
Kamil Jarosz d39c7339d9 avm1: Make the root movie clip non-focusable and non-tabbable
Root movie clip should be neither focusable, nor tabbable.
2024-06-05 02:08:13 +02:00
Lord-McSweeney 488fc4ae9f avm2: `Script` doesn't need to be borrowed 2024-06-04 15:31:14 -07:00
Lord-McSweeney 6acfc3953a avm2: Slightly improve findprop optimizations when property is found on script 2024-06-04 15:31:14 -07:00
Lord-McSweeney b523ad4b32 avm2: Fix a typo 2024-06-04 15:31:14 -07:00
Lord-McSweeney ad2c5c547e avm2: Cleanup optimizer 2024-06-04 15:31:14 -07:00
Lord-McSweeney 150d9d8bca avm2: Implement `flash.text.IME` package 2024-06-04 15:31:14 -07:00
Lord-McSweeney 43549ab1d7 avm2: Add a vtable to Class, support getting vtable of static methods in optimizer 2024-06-04 15:31:14 -07:00
Kamil Jarosz 516e10ae26 avm1: Drop focus on EditText when something else is clicked
In AVM1 text fields are somewhat special when handling focus.
When a text field is clicked, it gains focus,
when something else is clicked, it loses the focus.
However, this logic only applies to text fields, other objects
(buttons, movie clips) neither gain focus nor lose it upon press.
2024-06-04 19:39:20 +02:00
Tom Schuster b6612e8f83 avm2: Support namespaces in XML.setName 2024-06-04 18:50:49 +02:00
Tom Schuster 690a280fa5 avm2: Improve prefix support in ToXMLString 2024-06-04 00:22:42 +02:00
Tom Schuster 8671bdd8ee avm2: Implement XML.inScopeNamespaces 2024-06-04 00:22:42 +02:00
Tom Schuster 0b446d7cc6 avm2: Implement XML.setNamespace 2024-06-04 00:22:42 +02:00
Tom Schuster 2f7dfd8051 avm2: Implement XML.namespaceDeclarations 2024-06-04 00:22:42 +02:00
Tom Schuster f20f57c6f1 avm2: Implement XML.namespace 2024-06-04 00:22:42 +02:00
Tom Schuster 3f99866ca4 avm2: Implement XML.addNamespace 2024-06-04 00:22:42 +02:00
Lord-McSweeney 540cc5fb68 avm1: Stub `bufferLength` and `bufferTime` on `NetStream` 2024-06-03 23:56:22 +02:00
Thomas Lupin b08750a998 avm1: fix loadvars.send parameters 2024-06-03 23:36:33 +02:00
dependabot[bot] b9d246b2a5 build(deps): bump the cargo-minor group with 4 updates
Bumps the cargo-minor group with 4 updates: [proc-macro2](https://github.com/dtolnay/proc-macro2), [toml_edit](https://github.com/toml-rs/toml), [zip](https://github.com/zip-rs/zip2) and [toml](https://github.com/toml-rs/toml).


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

Updates `toml_edit` from 0.22.13 to 0.22.14
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.13...v0.22.14)

Updates `zip` from 2.1.1 to 2.1.2
- [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/v2.1.1...v2.1.2)

Updates `toml` from 0.8.13 to 0.8.14
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.13...toml-v0.8.14)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: toml_edit
  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-patch
  dependency-group: cargo-minor
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 23:21:12 +02:00
Adrian Wielgosik 224edfe06f core: Unify WStr::MAX_LEN range checks 2024-06-02 23:00:23 +02:00
Adrian Wielgosik 6a75def83a avm2: Fix panic on substr(i, len>usize::MAX) 2024-06-02 23:00:23 +02:00
sleepycatcoding 83cc8cf294 avm2: Implement a few avmplus XML edge cases 2024-06-02 01:52:52 +03:00
Tom Schuster 1402a59a20 avm2: :Implement FLV Date to Avm2Value conversion 2024-06-02 00:35:36 +02:00
Tom Schuster cdbc6d289c avm2: Implement the abstract equality comparison for QName 2024-06-01 20:52:17 +02:00
dependabot[bot] febbfe8f42 build(deps): bump the cargo-minor group with 4 updates
Bumps the cargo-minor group with 4 updates: [tokio](https://github.com/tokio-rs/tokio), [regress](https://github.com/ridiculousfish/regress), [fontdb](https://github.com/RazrFalcon/fontdb) and [zip](https://github.com/zip-rs/zip2).


Updates `tokio` from 1.37.0 to 1.38.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.37.0...tokio-1.38.0)

Updates `regress` from 0.9.1 to 0.10.0
- [Release notes](https://github.com/ridiculousfish/regress/releases)
- [Commits](https://github.com/ridiculousfish/regress/compare/v0.9.1...v0.10.0)

Updates `fontdb` from 0.17.0 to 0.18.0
- [Changelog](https://github.com/RazrFalcon/fontdb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/fontdb/compare/v0.17.0...v0.18.0)

Updates `zip` from 2.1.0 to 2.1.1
- [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/v2.1.0...v2.1.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: regress
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: fontdb
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: zip
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-01 17:46:28 +02:00
Nathan Adams 618e061564 core: Expand on audio related error messages 2024-06-01 14:08:54 +02:00
Kamil Jarosz f4a517dbd1 text: Invalidate bitmap cache on scroll
This patch fixes scrolling text fields when filters are applied.
2024-05-31 22:24:34 +02:00
sleepycatcoding 2fd5dfde9c avm2: Implement XMLList.normalize 2024-05-31 22:09:17 +02:00
Tom Schuster d98e3d9b99 avm2: Parse XML namespace declaration and make ToXMLString output them
This does not implement any of the XML API functions that interact with
namespaces.

Fixes #16340
2024-05-30 21:14:06 +02:00
TÖRÖK Attila b282d1325a core: Pass on H.264 packets from FLV streams to the video backend 2024-05-30 20:22:33 +02:00
sleepycatcoding 007a532717 avm2: Implement XMLList.contains 2024-05-30 00:43:45 +03:00
Tom Schuster 1fe1b8d67d avm2: Introduce an E4XNamespace type (NFCI) 2024-05-29 22:37:40 +02:00
Kamil Jarosz c32b27c294 core: Fix stop() when executing attachMovie in DoInitAction
This fixes a bug where the code in the first frame of a movie clip
could have been executed after the second frame
(so that instructions like stop did not work properly).

That is because when the first frame was executed in preload
(e.g. for a sprite attached using attachMovie), the actions were queued,
the second frame was executed in run_frame, and then the actions from
the first frame were executed.

Ensuring that all actions are executed after preload fixes this issue.
2024-05-28 23:57:13 +02:00
Adrian Wielgosik 2532d7e927 avm2: Refactor Executable->BoundMethod, introduce freestanding exec() 2024-05-28 23:32:21 +02:00
Kamil Jarosz 3bb47db5f9 avm1: Move FunctionObject's base to FunctionObjectData
This shrinks AVM1's Object (from 24 to 16 bytes on x64), and
allows future shrinkage of AVM1's Value (e.g. from 24 to 16 bytes
on x64 after putting all strings behind a Gc pointer).
2024-05-28 23:18:11 +02:00
Kamil Jarosz 658e800dfc core: Drop the focus when it's made invisible
When an object has focus and is made invisible,
the focus should be dropped.
2024-05-28 23:01:12 +02:00
Kamil Jarosz 23c1d32990 core: Pass UpdateContext to set_visible 2024-05-28 23:01:12 +02:00
dependabot[bot] a6a683ffa1 build(deps): bump the cargo-minor group with 2 updates
Bumps the cargo-minor group with 2 updates: [serde](https://github.com/serde-rs/serde) and [proc-macro2](https://github.com/dtolnay/proc-macro2).


Updates `serde` from 1.0.202 to 1.0.203
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.202...v1.0.203)

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

---
updated-dependencies:
- dependency-name: serde
  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-05-28 00:48:13 +02:00
sleepycatcoding cd24b91a82 avm2: Implement XMLList to XML proxy methods 2024-05-27 21:47:22 +02:00
sleepycatcoding ab0792904b avm2: Stub XML.add/set/removeNamespace 2024-05-27 21:47:22 +02:00
Nathan Adams 381b0897c9 avm2: Implement ExternalInterface.objectID 2024-05-26 23:00:33 +02:00
Kamil Jarosz 1bf9756b4e text: Allow selecting text by dragging
This patch allows selecting text by pressing and dragging the mouse.
2024-05-26 12:38:16 +02:00
Adrian Wielgosik bafc5d250e tests: Add a depdendent string test, with test-only AS3 2024-05-26 12:14:30 +02:00
Adrian Wielgosik d6dbc5e767 core: Support dependent strings for concatenation 2024-05-26 12:14:30 +02:00
dependabot[bot] f712c9212c build(deps): bump syn from 2.0.65 to 2.0.66 in the cargo-minor group
Bumps the cargo-minor group with 1 update: [syn](https://github.com/dtolnay/syn).


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

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-25 17:35:23 +02:00
Aaron Hill f8e97808e4 core: Store MovieClip avm2_class in MovieClipStatic
This is preparation for allowing a class to be linked
to the root movie clip and instantiated.
2024-05-25 10:14:44 -04:00
Kamil Jarosz 0edb7d6890 core: KeyPress events have precedence over tabbing
When there's a button that handles KeyPress "Tab" event (code 18),
the tabbing should not be performed.
2024-05-25 01:12:43 +02:00
Kamil Jarosz 277390aab4 core: Render EditText's selection when filters are present
This patch ensures that the selection in EditText is rendered even when
filters are present (so that cache as bitmap is enabled).
This is done by invalidating the cached bitmap on selection change.
2024-05-24 23:52:03 +02:00
Kamil Jarosz 8ac7a58d4e debug_ui: Improve EditText tab
This patch adds multiple properties and controls to EditText tab.
This includes for instance:
* border, border color,
* background, background color,
* editable, selectable, word wrap properties,
* autosize, max chars, restrict, etc.
2024-05-24 09:07:21 -04:00
Kamil Jarosz 6c67e7485e core: Invalidate EditText's bitmap when border is disabled
This patch makes sure that the bitmap is invalidated not only when
a border or background was enabled, but also when both were disabled
and the drawing has only been cleared.
2024-05-24 09:07:21 -04:00
sleepycatcoding 671be1a810 avm2: Fix a few XML prototype method signatures 2024-05-21 23:51:35 +02:00
Tom Schuster 3949110f6b avm2: request_from_url_request should fail when the url property is null 2024-05-21 20:45:20 +02:00
Tom Schuster f54e3fdbd0 avm2: Introduce the make_error_2007 helper 2024-05-21 20:45:20 +02:00
sleepycatcoding a5c3474bbc avm2: Implement Namespace enumeration 2024-05-21 20:26:35 +02:00
Nathan Adams b9947a2d1c avm2: Add more Namespace tests and fixed some other cases 2024-05-21 19:57:39 +02:00
Nathan Adams 3692cbbb2e avm2: Implement Namespace constructor and prefix 2024-05-21 19:57:39 +02:00
TÖRÖK Attila 2dec49941a chore: Refer to a specific git hash of jpegxr instead of a branch 2024-05-21 18:38:29 +02:00
dependabot[bot] c0b0b8257f
build(deps): bump the cargo-minor group with 6 updates
----
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: thiserror
  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: crossbeam-channel
  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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 20:56:02 +00:00
Aaron Hill f301b23f6e core: Treat NaN rotation as 0.0 when setting scaleX/scaleY
The `rotation` value is still reported to ActionScript as `NaN`,
but we treat it as 0.0 when computing the new matrix in the
scaleX/scaleY setters.
2024-05-19 09:52:07 -07:00
Lord-McSweeney 78e9426ba9 avm2: Add some comments for clarification 2024-05-18 17:01:49 -07:00
Lord-McSweeney c93873a7a2 avm2: Add a note on the `FindProp(Strict)` to `GetScriptGlobals` optimization 2024-05-18 17:01:49 -07:00
Lord-McSweeney a88d9dc07b avm2: Simple scoping is not required to optimize GetGlobalScope and GetGlobalSlot 2024-05-18 17:01:49 -07:00
Lord-McSweeney 267e3693ca Appease clippy 2024-05-18 17:01:49 -07:00
Lord-McSweeney 3fb549f1b5 avm2: Handle lazy multiname in findprop optimization 2024-05-18 17:01:49 -07:00
Lord-McSweeney eb27151af7 avm2: Don't call global init in optimizer 2024-05-18 17:01:49 -07:00
Lord-McSweeney 12174b5219 avm2: Propagate types from getslot, getglobalscope, and getglobalslot in optimizer 2024-05-18 17:01:49 -07:00
Lord-McSweeney 92de618261 avm2: Fix some very minor bugs with findprop optimization 2024-05-18 17:01:49 -07:00
Lord-McSweeney 796dda1ae0 avm2: Remove `fork_vtable` hack 2024-05-18 17:01:49 -07:00
Lord-McSweeney 767b7b4e44 avm2: Optimize findproperty and findpropstrict to getouterscope, getscopeobject, and getscriptglobals when possible 2024-05-18 17:01:49 -07:00
Lord-McSweeney f50b68abfd avm2: Split `GetLex` into `FindPropStrict` and `GetProperty` 2024-05-18 17:01:49 -07:00
Colin f573f7b141 avm1: Make clip have correct properties when the target of loadClip 2024-05-17 23:07:44 +02:00
dependabot[bot] 5fbf39fd7a build(deps): bump the cargo-minor group across 1 directory with 7 updates
Bumps the cargo-minor group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [async-channel](https://github.com/smol-rs/async-channel) | `2.3.0` | `2.3.1` |
| [serde](https://github.com/serde-rs/serde) | `1.0.201` | `1.0.202` |
| [either](https://github.com/rayon-rs/either) | `1.11.0` | `1.12.0` |
| [syn](https://github.com/dtolnay/syn) | `2.0.63` | `2.0.64` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.22.12` | `0.22.13` |
| [insta](https://github.com/mitsuhiko/insta) | `1.38.0` | `1.39.0` |
| [toml](https://github.com/toml-rs/toml) | `0.8.12` | `0.8.13` |



Updates `async-channel` from 2.3.0 to 2.3.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.3.0...v2.3.1)

Updates `serde` from 1.0.201 to 1.0.202
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.201...v1.0.202)

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

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

Updates `toml_edit` from 0.22.12 to 0.22.13
- [Commits](https://github.com/toml-rs/toml/compare/v0.22.12...v0.22.13)

Updates `insta` from 1.38.0 to 1.39.0
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.38.0...1.39.0)

Updates `toml` from 0.8.12 to 0.8.13
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.12...toml-v0.8.13)

---
updated-dependencies:
- dependency-name: async-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: serde
  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: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: toml_edit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo-minor
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-17 01:41:44 +02:00
Nathan Adams b25fe69bac avm1: Implement StyleSheet.load 2024-05-17 00:37:39 +02:00
Nathan Adams c1e197189d avm1: Implement most of StyleSheet 2024-05-17 00:37:39 +02:00
TÖRÖK Attila 331d1789da render,core,desktop: Port to `wgpu` `v0.20.0`, switch to `egui` `master` 2024-05-17 01:19:01 +03:00
Nathan Adams b8c1263f9e avm1: Expose NativeObjects through SuperObject - fixes g2conline 2024-05-17 00:02:45 +02:00
Nathan Adams dfd9a26a7b avm1: Implement NetConnection, more or less 2024-05-17 00:02:45 +02:00
Kamil Jarosz aeabe3cbb5 core: Implement proper automatic tab ordering
This patch implements proper automatic tab ordering that
behaves exactly the same as in FP.

The automatic order depends only on the position of
the top-left highlight bound corner, referred to as `(x,y)`.
It does not depend on object's size or other corners.

The value of `6y+x` is used to order objects by it.
This means that the next object to be tabbed is the next one
that touches the line `y=-(x-p)/6` (with the smallest `p`).

When two objects have the same value of `6y+x`
(i.e. when the line touches two objects at the same time),
only one of them is included.

This behavior is similar to the naive approach of
"left-to-right, top-to-bottom", but (besides being sometimes
seen as random jumps) takes into account the fact that
the next object to the right may be positioned slightly higher.
This is especially true for objects placed by hand or objects with
different heights (as FP uses the top left corner instead of the center).

This behavior has been discovered experimentally by placing
tabbable objects randomly and bisecting one of their
coordinates to find a difference in behavior.
2024-05-16 21:40:56 +02:00
sleepycatcoding be8cbd64d6 core/render/web: Make FromStr exclusively for snake_case 2024-05-16 01:14:42 +03:00
Nathan Adams 519de0e230 avm1: Implement __resolve 2024-05-15 22:45:56 +02:00
Aaron Hill 932f2d410b debug_ui: Render bitmap in new 'Bitmap' display object tab
This lets us view a bitmap directly from the debug ui.
We cache an egui texture handle on the `BitmapData` itself,
and invalidate it whenever the BitmapData gets changed.
2024-05-15 15:19:52 -04:00
Aaron Hill 4d2b2893ae avm2: Prevent loader mouse pick from targeting direct child
Loaders have a similar behavior to the main stage - if a mouse pick
would target their direct child (the root movieclip in the stage case,
and the loaded MovieClip in the Loader case), the Stage/Loader is
targeted instead.
2024-05-15 13:41:17 -04:00
Aaron Hill 60000d6930 avm2: Skip mouse pick for all mask children
We were previosuly only checking 'clip_depth', but we should
also check 'maskee()'
2024-05-15 12:30:51 -04:00
Nathan Adams b5948a883a avm2: Simplify string comparison in stylesheet a bit 2024-05-14 21:03:37 +02:00
Nathan Adams 4691d0c798 avm2: Call transform from StyleSheet.setStyle() 2024-05-14 21:03:37 +02:00
Nathan Adams 7309e457d5 avm2: Transform css properties from with-dashes to snakeCase 2024-05-14 21:03:37 +02:00
Nathan Adams 24b01b8f89 avm2: Implement StyleSheet.transform() 2024-05-14 21:03:37 +02:00
Nathan Adams 7e1bc84bdf avm2: Implement most of StyleSheet 2024-05-14 21:03:37 +02:00
Kamil Jarosz 8eb8673122 core: Update a comment related to custom tab ordering
Turns out the existing implementation was right.
2024-05-14 18:33:46 +02:00
Kamil Jarosz 5dcb87c727 debug_ui: Add stage focus rect 2024-05-13 20:48:48 +02:00
Kamil Jarosz f713c90cca core: Add possibility to set tab_enabled in AVM1
This makes it possible to set it from the debug UI.
2024-05-13 20:48:48 +02:00
Kamil Jarosz 0c3ab81671 debug_ui: Fix a positioning issue in Stage tab 2024-05-13 20:48:48 +02:00
Kamil Jarosz a5b7933c26 debug_ui: Add a tab for interactive objects 2024-05-13 20:48:48 +02:00