Commit Graph

9336 Commits

Author SHA1 Message Date
relrelb 60ffe07ae7 chore: Use `swf::Point` in many places
Convert nearly all instances of `(Twips, Twips)` (maybe besides in
`shape_utils.rs`) to `swf::Point<Twips>`.
2023-04-27 22:14:03 +03:00
Lord-McSweeney ba5a456d11 avm2: Implement XMLDocument.createElement 2023-04-27 13:16:00 -05:00
iwannabethedev b01e797e99
extension: Add option for setting max. exec. time
Add an option to the 'options' menu for the extension
for setting the maximum execution time for Actionscript
code.
2023-04-27 09:47:56 +00:00
Moulins e5caf0fda8 core: use unified repr for non-static `AvmString`s, interned and not
This shrinks the size of `AvmString` back from 3 to 2 usizes.
2023-04-27 00:17:31 +02:00
Moulins 2868333c05 avm2: require AvmAtom in Namespaces 2023-04-27 00:17:31 +02:00
Moulins 68fc567f7f core: add `AvmAtom` to represent interned strings
Makes `AvmString`s grow from 2 to 3 usizes, but this
will be reverted later.
2023-04-27 00:17:31 +02:00
Moulins 011cdd96ba core: don't keep strong references to interned strings in the interner.
This is done by implementing a simple WeakSet which clears its stale
entries during tracing.
2023-04-27 00:17:31 +02:00
Moulins 889a9bd009 avm2: Intern strings in constant pools
Strings belonging to multinames are interned too, but
the multinames themselves aren't.
2023-04-27 00:17:31 +02:00
Moulins 09c729074c avm1: Intern strings in constant pools 2023-04-27 00:17:31 +02:00
Moulins 27521e145c avm1: Thread GcContext through all globals initialization 2023-04-27 00:17:31 +02:00
Moulins c40fd2b17a core: Add (very) simple AvmString interner
Pass it to AVM1/2 initilization functions *via* the new `GcContext` type.
2023-04-27 00:17:31 +02:00
Moulins 90d5515d47 wstr: fix `wstr_impl_traits` macro not working without `use ruffle_wstr::*` 2023-04-26 23:49:18 +02:00
Moulins cfde53cde2 core: replace `string::decode_swf_str` by a `SwfStrExt` extention trait 2023-04-26 23:49:18 +02:00
Moulins e9a16ff5fe wstr: cleanup and expose the `ptr` module
- move `WStr` declaration to `common`;
- move `MAX_STRING_LEN` to the `WStr` type;
- split `ptr` methods into `*const` and  `*mut` variants;
- add safe methods `WStrMetadata::new32/len32`;
- add `WString::{from, into}_raw_parts`.
2023-04-26 23:49:18 +02:00
Moulins 34f2c45441 core: add `string::decode_swf_str` for SwfStr -> WString conversions 2023-04-26 23:49:18 +02:00
Moulins 604a15f957 wstr: add `WStr::make_ascii_lowercase` 2023-04-26 23:49:18 +02:00
Moulins 83f7bfc0c2 wstr: improve `Cow<WStr>` support
This adds missing `From` implementations, and utf8 conversion methods
returning `Cow<WStr>`.
2023-04-26 23:49:18 +02:00
Moulins ab0f9b9fc2 wstr: Inline more `WString` methods 2023-04-26 23:49:18 +02:00
iwannabethedev eaee14c7de web: Use default configuration in extension. 2023-04-26 23:24:53 +02:00
Toad06 f3a0652aea extension: Close `popup.html` when opening/reloading a window 2023-04-26 22:08:12 +03:00
Nathan Adams b12db0ac3a avm2: Support data, method and content-type in URLLoader by reusing code from Loader 2023-04-26 13:44:46 -05:00
relrelb 81dcc66c01 tests: Expand `as_broadcaster`
Verify that `AsBroadcaster` is actually a usable constructor.
2023-04-26 21:21:57 +03:00
relrelb 1c0c25b521 avm1: Make `AsBroadcaster` a function
Previously, `AsBroadcaster` was defined as a plain object. However,
it seems like in Flash it is defined as an empty function instead.
This means expressions like `new AsBroadcaster()` should return a
newly-created object. This is in opposition to the documentation
that says there is no constructor function for the `AsBroadcaster`
class.

Fixes #10673.
2023-04-26 21:21:57 +03:00
Lord-McSweeney 4a50f9f31e avm2: Add make_error_2008() function and use it 2023-04-26 18:49:35 +03:00
Daniel Jacobs 24dfb82d12 web: Address save manager styling review comments 2023-04-26 14:36:49 +02:00
Daniel Jacobs 902911745b web: Use different heights for save manager 2023-04-26 14:36:49 +02:00
Daniel Jacobs 5e31ce992e web: Fix save manager styling 2023-04-26 14:36:49 +02:00
Toad06 526fe98ffb extension: Display favicon 2023-04-26 13:46:12 +02:00
Nathan Adams cc731a78ee avm2: Respect data, method and contentType in Loader.load() 2023-04-26 12:46:23 +02:00
Lord-McSweeney 3bf78d43f9 fmt 2023-04-26 11:20:24 +03:00
Lord-McSweeney f947351f40 Fix #10817
Create a child element instead of setting innerHTML.
2023-04-26 11:20:24 +03:00
Lord-McSweeney f412f62127 avm2/tests: use try_get_object in JSON/Add test for undefined receiver 2023-04-26 00:17:44 +02:00
Lord-McSweeney 319886587d avm2: Use ParametersExt in JSON 2023-04-26 00:17:44 +02:00
Lord-McSweeney 58212ec280 avm2: Throw AVM errors for JSON operations (and add tests) 2023-04-26 00:17:44 +02:00
iwannabethedev 02b8434648 web: Expand 'max_execution_duration' type in extension.
The option 'max_execution_duration' previously only supported
the type '{secs: number, nanos: number}'. Now it also supports
using floating point numbers (and integers).

Default values have been changed to use floating point numbers.
2023-04-25 23:59:51 +02:00
relrelb 5b31be2c51 web: Use `.take()` instead of setting to `None` 2023-04-25 19:09:05 +02:00
Aaron Hill 6eba8d07ee avm2: Implement MorphShape class and use it for MorphShape displayobject 2023-04-25 18:43:43 +02:00
Toad06 45795c9d24 desktop/web: Add a mouse enter event 2023-04-25 18:01:49 +02:00
Toad06 1ca1435dc7 core: Detect when the mouse moves out of the stage 2023-04-25 18:01:49 +02:00
Toad06 ad4dc943fa avm1: Fix some issues with buttons 2023-04-25 17:50:25 +02:00
Aaron Hill 4432c45eb3 avm2: Mark 'callee' property as non-enumerable on 'arguments' array
Some SWFs iterate over the 'arguments' array, and the 'callee' property
should not get enumerated.
2023-04-25 17:29:20 +02:00
Daniel Jacobs d31828d24d web: Fix #10798 2023-04-25 17:15:41 +02:00
Aaron Hill 3bb8c8fb4f wgpu: Update wgpu to 0.16.0 and naga to 0.12.0 2023-04-25 09:24:53 -05:00
nosamu bce494b86c extension: Rearrange options to emphasize the most commonly used 2023-04-25 09:00:12 +03:00
nosamu 1e3701279c web: Add preferred renderer config 2023-04-25 09:00:12 +03:00
nosamu 569e822044 extension: Reduce code duplication 2023-04-25 08:48:59 +03:00
nosamu 9b87b31657 web: Don't inherit page CSS 2023-04-25 08:31:17 +03:00
relrelb 7af0a17d83 web: Update JSDoc lint rules
* Extend from `plugin:jsdoc/recommended-typescript-error`, which is
more suitable for TypeScript and errors by default.
* Remove default and disabled but passing rules.
* Configure `jsdoc/tag-lines` to match JSDoc style of current codebase.
2023-04-25 08:19:54 +03:00
relrelb 940a8c6658 extension: Make `Options` extend `BaseLoadOptions`
Omit config values from `DEFAULT_OPTIONS`, which are already
part of `DEFAULT_CONFIG` in `ruffle-core`. Also use spread syntax
to avoid naming each config that should pass to `ruffle-core`.
2023-04-24 22:33:59 +03:00
relrelb 957170201a web: Avoid `web_sys::Element::set_attribute`
Use type-specific setters instead.
2023-04-24 22:06:47 +03:00