Commit Graph

6209 Commits

Author SHA1 Message Date
David Wendt d225d03043 avm2: Implement `flash.utils.Proxy` 2021-11-09 17:28:33 -07:00
David Wendt 685d386389 tests: Add a test for every part of `Proxy` that does not involve E4X. 2021-11-09 17:28:33 -07:00
David Wendt 51af0f708f core: Remove commented-out helper methods. 2021-11-09 16:48:29 -07:00
David Wendt c78e5e31fd core: Store `DisplayObjectBase` in `InteractiveObjectBase`.
This also necessitated removing the `impl_display_object` family of macros, as you cannot name a field of a field in a macro expression. I tried. So instead I've reverted to standard default method inheritance, in the same way we did with AVM2 objects.
2021-11-09 16:48:29 -07:00
David Wendt 2ea35dcbb1 avm2: Enforce the `mouseEnabled` flag. 2021-11-09 16:48:29 -07:00
David Wendt b2e0586252 docs: Document the current event-handling flow in `Player`. 2021-11-09 16:48:29 -07:00
David Wendt bb8ca8f136 core: Move `handle_clip_event` to `TInteractiveObject`, and split it into three pieces.
`handle_clip_event` is now a default trait method that calls three methods in order:

 * `filter_clip_event`, to determine which events that either this object or it's children may handle
 * `propagate_to_children`, to check if any children of this object want to handle an event. (This also includes AVM2 button states, which are not technically "children" in the usual sense...)
 * `event_dispatch`, which does the actual "object reacts to an event" bit if no child handles the object.

These roughly correspond to phases of existing event-handling objects pre-`InteractiveObject`.
2021-11-09 16:48:29 -07:00
David Wendt 95f105aadd core: `Stage`, `EditText`, and `Avm2Button` should also be interactive objects. 2021-11-09 16:48:29 -07:00
David Wendt e71c749db5 avm2: Implement accessors for new `InteractiveObject` flags. 2021-11-09 16:48:29 -07:00
David Wendt 618c32f859 core: Add `InteractiveObject` trait for objects that can receive input events 2021-11-09 16:48:29 -07:00
relrelb 89718475df avm2: Introduce `TextFormatObject` 2021-11-09 16:21:35 -07:00
relrelb 9308513ae8 chore: Appease clippy 2021-11-06 10:44:01 +02:00
David Wendt 6c7d10e4d4 avm2: Requests for instance traits instead resolve to an associated public-namespace method 2021-11-02 16:54:38 -06:00
David Wendt 9d3e249cf9 tests: Add test for interface namespaces (accessed via coercion semantic sugar) 2021-11-02 16:54:38 -06:00
dependabot[bot] 867ad14302 build(deps-dev): bump @typescript-eslint/eslint-plugin in /web
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.32.0 to 4.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.33.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 09:10:08 +02:00
dependabot[bot] 1f73314e44 build(deps-dev): update ts-node requirement in /web
Updates the requirements on [ts-node](https://github.com/TypeStrong/ts-node) to permit the latest version.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.2.1...v10.4.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 09:09:53 +02:00
dependabot[bot] 6927ed8064 build(deps-dev): update style-loader requirement in /web
Updates the requirements on [style-loader](https://github.com/webpack-contrib/style-loader) to permit the latest version.
- [Release notes](https://github.com/webpack-contrib/style-loader/releases)
- [Changelog](https://github.com/webpack-contrib/style-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/style-loader/compare/v3.3.0...v3.3.1)

---
updated-dependencies:
- dependency-name: style-loader
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 09:09:39 +02:00
dependabot[bot] b902d42529 build(deps-dev): bump @wdio/mocha-framework in /web
Bumps [@wdio/mocha-framework](https://github.com/webdriverio/webdriverio) from 7.13.2 to 7.16.3.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.13.2...v7.16.3)

---
updated-dependencies:
- dependency-name: "@wdio/mocha-framework"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 07:58:12 +02:00
dependabot[bot] 50d6e34933 build(deps-dev): bump eslint-plugin-jsdoc from 36.1.1 to 37.0.3 in /web
Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 36.1.1 to 37.0.3.
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v36.1.1...v37.0.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 07:02:19 +02:00
dependabot[bot] 0ef702d415 build(deps): bump syn from 1.0.80 to 1.0.81
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.80...1.0.81)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 07:02:06 +02:00
dependabot[bot] 9d8c7ab91c build(deps-dev): bump @types/firefox-webext-browser in /web
Bumps [@types/firefox-webext-browser](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/firefox-webext-browser) from 82.0.1 to 94.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/firefox-webext-browser)

---
updated-dependencies:
- dependency-name: "@types/firefox-webext-browser"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 07:01:02 +02:00
dependabot[bot] 0e947bb368 build(deps-dev): update css-loader requirement in /web
Updates the requirements on [css-loader](https://github.com/webpack-contrib/css-loader) to permit the latest version.
- [Release notes](https://github.com/webpack-contrib/css-loader/releases)
- [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/css-loader/compare/v6.3.0...v6.5.0)

---
updated-dependencies:
- dependency-name: css-loader
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 07:00:47 +02:00
dependabot[bot] 0948753e89 build(deps-dev): update typedoc requirement in /web
Updates the requirements on [typedoc](https://github.com/TypeStrong/TypeDoc) to permit the latest version.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.4...v0.22.7)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 07:00:28 +02:00
dependabot[bot] 195b0118c2 build(deps-dev): update webpack-dev-server requirement in /web
Updates the requirements on [webpack-dev-server](https://github.com/webpack/webpack-dev-server) to permit the latest version.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v4.3.0...v4.4.0)

---
updated-dependencies:
- dependency-name: webpack-dev-server
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 06:59:47 +02:00
dependabot[bot] b3839f2199 build(deps-dev): bump @wdio/local-runner from 7.13.2 to 7.16.3 in /web
Bumps [@wdio/local-runner](https://github.com/webdriverio/webdriverio) from 7.13.2 to 7.16.3.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.13.2...v7.16.3)

---
updated-dependencies:
- dependency-name: "@wdio/local-runner"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 06:59:18 +02:00
Mike Welsh 92977e0430 tests: Add hitTest test for unclosed drawing path 2021-10-31 19:01:55 -07:00
Mike Welsh c6e6de4a47 core: Unclosed fills in Drawing API should auto-close 2021-10-31 19:01:55 -07:00
Mike Welsh 64cc6fc80f tests: Add test for duplicateMovieClip w/ drawing API 2021-10-31 19:01:55 -07:00
Mike Welsh 8cf0f9b7b1 avm1: duplicateMovieClip copies drawings (fix #5487)
duplicateMovieClip also clones the drawing API state of the clip,
including in-progress drawing and style info.

Fixes #5487.
2021-10-31 19:01:55 -07:00
Mike Welsh 0e4b0f7c62 avm1: Allow duplicateMovieClip on dynamically created clips
Previously duplicating a clip created with `createEmptyMovieClip`
would fail.
2021-10-31 19:01:55 -07:00
David Wendt b0b1c79143 avm2: Split the `slot_id` and `disp_id` accessors. 2021-10-31 00:52:58 -07:00
David Wendt 0cc55df5ca avm2: Remove `FINAL` flag and associated machinery as we now validate traits at class construction time. 2021-10-31 00:52:58 -07:00
David Wendt a1be42abfb avm2: Exempt system classes from class validation. 2021-10-31 00:52:58 -07:00
David Wendt dd4717e08e avm2: Move `final`/`override` check enforcement to class construction time.
This is an O(n^2) algorithm, which sucks, but at least it only runs once per class rather than per *object allocation*.
2021-10-31 00:52:58 -07:00
David Wendt 8d40e41ee1 avm2: Make `Executable` zero-alloc 2021-10-31 00:52:58 -07:00
David Wendt cea3997396 avm2: Remove `superclass_object` and related parameters from `TObject.call` and other downstream functions.
Turns out there's a *lot* of downstream functions.
2021-10-31 00:52:58 -07:00
David Wendt 272b1784b8 avm2: Don't skip method binding in `callproperty` if the method requires `arguments`, as it may access `callee`. 2021-10-31 00:52:58 -07:00
David Wendt 1b5869e15a avm2: Preserve ability to `callmethod` on slot IDs that have not yet been bound, by binding them at that time. 2021-10-31 00:52:58 -07:00
David Wendt d0d19bcf38 avm2: Stop instantiating methods at object construction time. 2021-10-31 00:52:58 -07:00
David Wendt bfbd2271b0 avm2: Allow uninstantiated methods to be created on-the-fly. 2021-10-31 00:52:58 -07:00
David Wendt 3562c50dee avm2: `call_property` on classes should also call unbound methods 2021-10-31 00:52:58 -07:00
David Wendt 477add3dd0 avm2: Add `ClassObject` methods for pulling unbound methods or bound method objects from the class or instance. 2021-10-31 00:52:58 -07:00
David Wendt 9c031070b3 avm2: `ClassObject` should include class traits in `TObject` methods that reference the current object's traits. 2021-10-31 00:52:58 -07:00
David Wendt 74fb965301 avm2: Call methods directly if we can find a class with an instance trait matching it's name. 2021-10-31 00:52:58 -07:00
David Wendt 039777c41e avm2: `Object.hasOwnProperty`, `propertyIsEnumerable`, and `setPropertyIsEnumerable` only work with public-NS properties. 2021-10-30 11:44:29 -06:00
relrelb 9aed0e7db4 core: Reset `TextFormat.color` alpha
Since `TextFormat.color` should preserve the alpha value, and the AVM1
getter/setter no longer reset it, we need to reset it in other places:

* `TextField.textColor` setter.
* `EditText` SWF tag handling.
* HTML parsing.

And to set it explicitly to 255 in `LayoutBox::as_renderable_text`.
2021-10-30 10:03:36 -07:00
relrelb 34d1fa5226 avm1: Introduce `TextFormatObject`
`TextFormat` objects differ from regular objects in that
`TextField.setTextFormat` and `TextField.setNewTextFormat` accept
only the former, and ignore the latter.

Also, `TextFormat.prototype` has native accessors that coerce the
values on get/set.
2021-10-30 10:03:36 -07:00
Mike Welsh a1130b973f tests: Add test for GotoFrame2 after bogus tellTarget 2021-10-28 10:18:18 -07:00
Mike Welsh bc801b2b32 avm1: GotoFrame2 after bogus SetTarget affects _root
For example, `tellTarget("bogus!!!") { var n = 2; gotoAndPlay(n); }`
should cause the _root clip to go to frame 2.

Fixes the character freezing in Steppenwolf 3-1 mentioned in #4585.
2021-10-28 10:18:18 -07:00
Mike Welsh 6ac49b3d0d tests: Add test for tellTarget with removed base clip 2021-10-28 10:18:18 -07:00