Aaron Hill
8ff720dd9d
avm1: Allow new `unused_macro_rules` lint on `declare_properties`
...
This was recently added in https://github.com/rust-lang/rust/pull/96150
Some of the `__version` rules are currently unused, but I assume
that we still want to keep them for potential future use.
2022-05-13 09:31:46 -07:00
TÖRÖK Attila
c40c0d7ef9
webgl: Use clamp(x, 0.0, 1.0) instead of saturate(x)
...
The latter seems to not exist
2022-05-13 09:31:21 -07:00
Mike Welsh
edad1569fb
webgl: Clamp alpha in shaders ( fix #6954 )
2022-05-12 14:50:25 -07:00
Mike Welsh
121c2577b4
wgpu: Clamp alpha in shaders ( fix #6954 )
2022-05-12 14:50:25 -07:00
relrelb
cab49ae6e1
swf: Introduce `Color::WHITE`
...
And use it where possible, to improve code readablity.
2022-05-12 12:12:06 -07:00
relrelb
0b0f8a1a7a
swf: Introduce `Color::BLACK`
...
And use it where possible, to improve code readablity.
2022-05-12 12:12:06 -07:00
Aaron Hill
938d80146c
avm2: Implement `TextField.background` getter/setter
...
There's already a `has_background` field on the underlying object
data, so we can just map this property to it.
2022-05-11 15:42:19 -07:00
Aaron Hill
e39cfa8027
Define `String.fromCharCode` as both a public and AS3 method
...
This is relied on by SteamBirds
(https://www.kongregate.com/games/weasello/steambirds )
2022-05-11 15:42:19 -07:00
relrelb
84b865018d
swf: Mark some `SwfStr` functions as const
2022-05-10 09:34:57 +03:00
Mike Welsh
f550abd18d
web: Fix some warnings
...
Fix warnings caused by desktop-only code.
2022-05-09 22:28:43 -07:00
Mike Welsh
6547fcdf99
avm1: Remove `avm1::globals::display_object` module
...
This module is now mostly empty, so move the items up to `globals`.
`getDepth` was the only shared method, so declare this property
inline in each display object type. `Video` was also incorrectly
declaring `getDepth`.
2022-05-09 17:39:49 -07:00
Mike Welsh
a97ae38008
avm1: Remove `toString` from display objects
...
`MovieClip` and others do not have a `toString`; instead, stage
objects are special cased to return their path when coerced to
string.
2022-05-09 17:39:49 -07:00
Mike Welsh
35d2f69396
avm1: Improve `StageObject::get_local_stored`
...
* Avoid an extraneous check to `ScriptObject::has_own_property`.
* Avoid magic property branches if property name does not start
with `_`.
2022-05-09 17:39:49 -07:00
Mike Welsh
a940a0d357
tests: Add test for #768
2022-05-09 17:39:49 -07:00
Mike Welsh
2683686014
avm1: `_root`, `_parent`, `_global` are magic properties ( fix #768 )
...
Remove `_root`, `_parent` and `_global` from `MovieClip.prototype`.
Instead, these are "magic" properties similar to `_x` and `_y`.
Add `StageObject::resolve_path_property` to handle these, alongside
the `_levelN` property.
Fixes #768 .
2022-05-09 17:39:49 -07:00
Mike Welsh
9d5e461278
core: Add WStr::eq_with_case
2022-05-09 17:39:49 -07:00
relrelb
4f05d1852d
web: Prefer using `Element` over `HTMLElement`
...
`Element` is a slightly more general type, which is more common than
`HTMLElement`, and it satisfies our needs in most cases.
2022-05-09 15:00:14 -07:00
relrelb
781d091d42
swf: Return concrete data types in `Reader` methods
...
Where possible, return the specific data type instead of the generic
`Tag` type. Most reader methods do this already, so this brings the
rest in-line.
2022-05-09 14:59:38 -07:00
dependabot[bot]
7352aca3bc
build(deps): bump jpeg-decoder from 0.2.5 to 0.2.6
...
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder ) from 0.2.5 to 0.2.6.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases )
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md )
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.2.5...v0.2.6 )
---
updated-dependencies:
- dependency-name: jpeg-decoder
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 13:46:12 -07:00
dependabot[bot]
a853b897ca
build(deps): bump clap from 3.1.15 to 3.1.17
...
Bumps [clap](https://github.com/clap-rs/clap ) from 3.1.15 to 3.1.17.
- [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/v3.1.15...v3.1.17 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 13:45:19 -07:00
dependabot[bot]
5c43dba766
build(deps): bump serde_json from 1.0.80 to 1.0.81
...
Bumps [serde_json](https://github.com/serde-rs/json ) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/serde-rs/json/releases )
- [Commits](https://github.com/serde-rs/json/compare/v1.0.80...v1.0.81 )
---
updated-dependencies:
- dependency-name: serde_json
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 13:42:53 -07:00
dependabot[bot]
46328d5582
build(deps): bump num-traits from 0.2.14 to 0.2.15
...
Bumps [num-traits](https://github.com/rust-num/num-traits ) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/rust-num/num-traits/releases )
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md )
- [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.14...num-traits-0.2.15 )
---
updated-dependencies:
- dependency-name: num-traits
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 13:33:04 -07:00
dependabot[bot]
a2043d94e1
build(deps): bump log from 0.4.16 to 0.4.17
...
Bumps [log](https://github.com/rust-lang/log ) from 0.4.16 to 0.4.17.
- [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/commits/0.4.17 )
---
updated-dependencies:
- dependency-name: log
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-05-09 13:32:40 -07:00
Daniel Jacobs
254a4a9175
demo: Fix styling on mobile devices
2022-05-09 10:07:16 -07:00
relrelb
bce4075c69
core: Remove `url_from_relative_path`
...
The remaining caller was `SwfMovie::from_path`, which is now changed
to be simpler, and a little stricter (panics if `Url::from_file_path`
fails, though it shouldn't happen with canonicalized paths).
2022-05-09 10:06:52 -07:00
nosamu
f39537f984
docs: Correct issue number in code comment
2022-05-08 14:27:15 +03:00
relrelb
b46134dc43
avm1: Tiny cleanup in `Activation::set_target`
...
Use `Option::filter`.
2022-05-07 22:46:35 -07:00
Mike Welsh
f20f53f555
avm1: Grab SWF version from executing clip
...
Remove the `swf_version` parameter from `Activation` constructors,
because this was incorrectly using the global or root SWF version
most times.
Instead, grab the SWF version for the activation directly from the
base clip.
2022-05-07 10:25:10 -07:00
Mike Welsh
1e9c464d94
avm1: Add version to MovieClip properties
2022-05-07 10:25:10 -07:00
Mike Welsh
cc8a88a570
tests: Add tests for ASSetPropFlags version gating
2022-05-07 10:25:10 -07:00
Mike Welsh
4fa4c6ca84
avm1: Implement property version checking
...
Check SWF version of AVM1 properties and return undefined if they
are gated to a later version.
2022-05-07 10:25:10 -07:00
Mike Welsh
e6cadf7de4
avm1: Use u16 for Property::attributes
2022-05-07 10:25:10 -07:00
relrelb
bcd35d6ad7
tests: Expand and cleanup `xml_namespaces`
...
Merge the `xml_node_namespaceuri` and `xml_node_weirdnamespace` tests
into `xml_namespaces`, cleanup, and expand it along the way.
2022-05-07 10:24:45 -07:00
relrelb
401f423ffa
xml: Remove `XmlAttributesObject`
...
Use a bare `ScriptObject` instead. This matches Flash's behavior in
many aspects:
* Attribute values can now store arbitrary AVM1 values, rather than
just strings. These are coerced to string lazily on demand (e.g.
when coercing the whole XML node to a string).
* Attributes iteration order is the same as their definition order,
not sorted by their name.
Also fix some bugs in `XmlNode::lookup_namespace_uri` (renamed from
`lookup_uri_for_namespace`):
* Iterate attributes by their definition order, so the first matching
one is returned.
* The empty prefix matches every attribute that starts with "xmlns"
(with/without a colon).
And inline `XmlNode::lookup_namespace_for_uri` into `get_prefix_for_namespace`,
and fix some bugs in there as well:
* Iterate attributes by their definition order, so the first matching
one is returned.
* Match any attribute that start with "xmlns" (with/without a colon).
2022-05-07 10:24:45 -07:00
Mike Welsh
5730c8db94
core: Clamp color values in DefineBitsJPEG3 ( fix #6893 )
...
The colors in a DefineBitsJPEG3 tag should be premultiplied alpha,
but in some SWFs they are incorrectly not premultiplied. Flash
Player clamps the color values to the alpha in this case to allow
these images to work more as expected.
Fixes #6893 .
2022-05-07 09:46:44 -07:00
relrelb
87ce0f56b7
core: Remove `NavigatorBackend::resolve_relative_url`
...
The resolved URL only used by `NavigatorBackend::fetch`. So simply
inline `NavigatorBackend::resolve_relative_url` into `NavigatorBackend::fetch`,
per implementation.
2022-05-07 09:06:53 -07:00
relrelb
ea665d91f2
core: Introduce and use `Response::url`
2022-05-07 09:06:53 -07:00
relrelb
2517d8de4b
core: Introduce struct `Response`
...
Currently it's a trivial wrapper around `Vec<u8>`, but more fields
will be added in the future (e.g. response URL, HTTP status code).
2022-05-07 09:06:53 -07:00
Mike Welsh
85e98cc1cc
ci: Don't test web build on Windows
...
For unknown reasons, tests on the Windows web build continue to be
flaky on GitHub CI. Disable them for now. Tests continue to be run
on Ubuntu.
2022-05-06 14:20:47 -07:00
Mike Welsh
82ed6fcba7
core: Cleanup PlaceObject comments
2022-05-06 11:33:52 -07:00
Mike Welsh
0833bd0d18
core: Clip events can only be set on initial placement
2022-05-06 11:33:52 -07:00
Mike Welsh
8bf0114fdf
core: DisplayObject clip depth can only be set on initial placement
2022-05-06 11:33:52 -07:00
Mike Welsh
32252b2ed4
core: DisplayObject name can only be set on initial placement
2022-05-06 11:33:52 -07:00
Mike Welsh
aa66c31d6c
core: Add comment about rewind behavior of is_visible
2022-05-06 11:33:52 -07:00
Mike Welsh
b46c07830e
core: Stub DisplayObject::background_color
2022-05-06 11:33:52 -07:00
Mike Welsh
f8698d1cc9
core: Stub DisplayObject::blend_mode
2022-05-06 11:33:52 -07:00
Mike Welsh
402e072707
swf: Implement Default for BlendMode
2022-05-06 11:33:52 -07:00
Mike Welsh
2cebd47ad2
core: Stub DisplayObject:is_bitmap_cached
2022-05-06 11:33:52 -07:00
Daniel Jacobs
57659a1f44
demo: Add an area to say the file name
2022-05-06 10:43:20 -07:00
Daniel Jacobs
f94a76a248
demo: Style the local file selector and sample file select
2022-05-06 10:43:20 -07:00