Commit Graph

7177 Commits

Author SHA1 Message Date
Lord-McSweeney d9ce8ef9ca avm2: Only look at valid Exceptions in verifier 2024-07-16 23:03:30 +03:00
Lord-McSweeney c0565d81e6 core: Log an error when a URLLoader load fails 2024-07-16 12:24:40 +02:00
Kamil Jarosz b8fe2b5cba avm2: Fix EventDispatcher.dispatchEvent return value
This fixes a regression introduced in 250bf64.
2024-07-16 10:53:42 +03:00
Aaron Hill 6e93927f63 web: Check for locked 'Player' mutex and reschedule with setTimeout
We use 'wasm-bindgen-futures' as our futures executor on web, which
in turn uses 'queueMicroTask'. This can result in the browser executing
one of our futures while we're still inside our `requestAnimationFrame`
callback (in particular, while we still have the `Player` mutex locked).

We now detect this condition by attempting the lock the Player mutex
inside of our `spawn_local` future. If this fails, we `await`
a `setTimeout`-based promise, which ensures that our code runs in
a new top-level `setTimeout` javascript 'task' (outside of our
`requestAnimationFrame` callback).
2024-07-15 22:46:22 +02:00
Adrian Wielgosik c9fedb2cf6 avm2: Add a fast path in coerce_s 2024-07-15 22:30:46 +02:00
Adrian Wielgosik 131b2c21f4 avm2: Use small string cache when stringifying ints < 10 2024-07-15 22:30:46 +02:00
Kamil Jarosz 1c3128c8e1 avm2: Use click index for double click detection 2024-07-15 21:51:18 +02:00
Kamil Jarosz 0b64bc681a core: Add click index to ClipEvent::Release 2024-07-15 21:51:18 +02:00
Kamil Jarosz 4ec36d5b3a avm2: Dispatch mouseWheel event on mouse wheel 2024-07-15 21:36:37 +02:00
Kamil Jarosz 922e281395 core: Implement keyboard navigation
This patch implements keyboard navigation, i.e. changing focus using
arrows when an object is highlighted.
2024-07-15 21:19:21 +02:00
Kamil Jarosz fdf28ccc6e core: Refactor tab ordering code 2024-07-15 21:19:21 +02:00
dependabot[bot] 51e868d8ac build(deps): bump the cargo-minor group with 3 updates
Bumps the cargo-minor group with 3 updates: [clap](https://github.com/clap-rs/clap), [thiserror](https://github.com/dtolnay/thiserror) and [syn](https://github.com/dtolnay/syn).


Updates `clap` from 4.5.8 to 4.5.9
- [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.8...v4.5.9)

Updates `thiserror` from 1.0.61 to 1.0.62
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.61...1.0.62)

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

---
updated-dependencies:
- dependency-name: clap
  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
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 13:26:34 +02:00
Lord-McSweeney bed5a2fd86 avm2: Add several AIR classes and version-gate `ImageDecodingPolicy` to SWF13+
`NativeProcess`, `NativeProcessStartupInfo`, and `File` classes
2024-07-14 23:25:57 +02:00
Lord-McSweeney 2a38a2caf2 avm2: Fix the globals ordering a little 2024-07-14 23:25:57 +02:00
Lord-McSweeney ceebf2bf64 avm2: Add `flash.net::NetGroup` class 2024-07-14 17:28:27 +03:00
Adrian Wielgosik 48db0e23c4 core: Fix panic on unsetting self-referential masker 2024-07-12 22:35:07 +02:00
Adrian Wielgosik 261ba7374e avm2: Correct setting builtins' types on classes 2024-07-12 21:56:37 +02:00
Kamil Jarosz bd98f72b96 core: Return from handle_event() whether the event has been handled 2024-07-12 15:41:08 +02:00
Kamil Jarosz 7621553a34 avm2: Properly detect whether the event has been handled in event_dispatch_to_avm2 2024-07-12 15:41:08 +02:00
Kamil Jarosz 250bf64a92 avm2: Return whether the event has been handled from dispatch_event
Before that, dispatch_event returned whether the event has been
canceled, but the value has never been used.
It's possible to check whether the event has been canceled
by invoking is_cancelled() on the event.
2024-07-12 15:41:08 +02:00
Kamil Jarosz 57e90d947b avm2: Fire right & middle click events 2024-07-12 15:41:08 +02:00
Kamil Jarosz c7f1f33843 avm2: Add more specific mouse event constructors 2024-07-12 15:41:08 +02:00
Kamil Jarosz 010310dd1b avm2: Add an option to simulate event dispatch 2024-07-12 15:41:08 +02:00
Kamil Jarosz ebfff6aea1 core: Fire clip events on right & middle clicks 2024-07-12 15:41:08 +02:00
Kamil Jarosz 62254d7532 core: Add clip events related to right and middle clicks 2024-07-12 15:41:08 +02:00
Kamil Jarosz 392101611e core: Add support for pressing multiple mouse buttons 2024-07-12 15:41:08 +02:00
Kamil Jarosz 368a95cf3b core: Add button parameter to is_mouse_down() 2024-07-12 15:41:08 +02:00
Kamil Jarosz 7a52360965 avm2: Parameterize mouse button in mouse_event() 2024-07-12 15:41:08 +02:00
Kamil Jarosz d625c0a779 avm2: Add API versions to MouseEvent constants 2024-07-12 15:41:08 +02:00
Kamil Jarosz 01ad20f8a3 core: Hide focus highlight on invalid and empty bounds 2024-07-12 14:44:49 +02:00
Kamil Jarosz 9a88496763 core: Reset focus on player focus loss
FP resets focus when the window (or the element on web) loses its focus.
2024-07-12 14:20:35 +02:00
Kamil Jarosz 6b0bbb85b1 avm2: Implement TextField.condenseWhite 2024-07-12 14:01:24 +02:00
Kamil Jarosz 12edbc8b75 avm1: Implement TextField.condenseWhite 2024-07-12 14:01:24 +02:00
Kamil Jarosz 83179129e3 core: Implement condensing whitespace in HTML 2024-07-12 14:01:24 +02:00
Kamil Jarosz 96468a4445 core: Use CR as the newline character in HTML
Tests show that CR is the newline character internally used in FP
both on Linux and on Windows.
2024-07-12 14:01:24 +02:00
Lord-McSweeney d7a46b1eb2 avm2: Add `flash.text.engine::TextLineMirrorRegion` class 2024-07-12 13:10:15 +02:00
Lord-McSweeney af6a66b8cf avm2: Partially implement `flash.trace::Trace` 2024-07-12 13:10:15 +02:00
Lord-McSweeney ea0bbce184 avm2: Use return type of `ConstructProp` in optimizer 2024-07-12 09:50:58 +03:00
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