Commit Graph

3353 Commits

Author SHA1 Message Date
David Wendt a2d876bc8c core: Remove double-ended support for `ChildIter` as it's unnecessary and wastes time 2020-11-27 13:23:34 -08:00
David Wendt 1f2c194ffd avm2: Remove unnecessary execution list accesses and debugging statements from `DisplayObjectContainer`. 2020-11-27 13:23:34 -08:00
David Wendt bcef9ef415 tests: Add a whole number of tests of depth/render list interaction from the AS3 side 2020-11-27 13:23:34 -08:00
David Wendt ab4dd984e8 core: Refactor display list management into a separate `ChildContainer` struct.
`ChildContainer` is responsible for maintaining child lists for all display objects that can hold children. Currently, this is just `Button` and `MovieClip` since those are the only objects in AVM1 that can have children, but this will be extended to other objects in future commits.

The number of lists managed has also increased from two to three. The execution list is unchanged save for it's migration into the `ChildContainer` struct. The render list has been split in two to support AS3. Specifically, the render list is now a `Vec`. Render children are still rendered in order but they are now referenced by AS3 `id`s rather than depths. The old `BTreeMap` that served as a render list is now the depth list and serves to maintain compatibility with SWF tags and AVM1 code that refers to things on the timeline by depth.
2020-11-27 13:23:34 -08:00
David Wendt a5f09d3c09 avm2: Implement `removeChild`. 2020-11-27 13:23:34 -08:00
David Wendt a5ea9795f6 avm2: Implement `addChild` and `addChildAt`, with tests 2020-11-27 13:23:34 -08:00
David Wendt c7199ff83f core: Add a utility for placing a display object at a particular relative position (rather than a static depth) on the render list.
For example, let's say we had two objects on the clip at depths 5 and 6. AS3 would see them as children IDs 0 and 1. Adding something at ID 1 translates to putting something between depth 5 and 6. To do this, we shift all higher-depth children up one depth to make room for the incoming clip, producing a new order of depths 5, 6, and 7.
2020-11-27 13:23:34 -08:00
David Wendt 52efbd98a8 core: Remove child's sibling pointers when removing the child from the parent's exec list.
This fixes a hang in as-of-yet uncommitted AS3 tests that reused display objects, where repeated removals and additions to the same MovieClip caused the construction of a cyclic render list.
2020-11-27 13:23:34 -08:00
David Wendt cfd6965b2c avm2: Use order in the render list (but NOT depths) rather than the execution list for `get_child_by_id` 2020-11-27 13:23:34 -08:00
David Wendt b263b52bca avm2: Correctly instantiate timeline clips whose AVM2 constructor isn't specified as a `flash.display.MovieClip`. 2020-11-27 13:23:34 -08:00
David Wendt 4817e92992 avm2: `getChildAt` works in reverse execution list order, not by depth 2020-11-27 13:23:34 -08:00
David Wendt f3ae65df93 core: Add flag for display objects which were placed by AS3.
In AS3. objects placed by scripts *cannot* be removed by `RemoveObject` tags. This enforces that in Ruffle.
2020-11-27 13:23:34 -08:00
David Wendt 8c9f8520b3 avm2: Implement `DisplayObjectContainer.numChildren` 2020-11-27 13:23:34 -08:00
David Wendt f748576927 avm2: Implement `getChildByName` 2020-11-27 13:23:34 -08:00
David Wendt 827567bb58 avm2: `toString` of stage objects should work the same way as other objects 2020-11-27 13:23:34 -08:00
David Wendt dc629af177 avm2: `getChildById` indexes by zero, but it gives me the child at depth one. 2020-11-27 13:23:34 -08:00
David Wendt d04f131cfe avm2: Implement `DisplayObjectContainer.getChildAt`.
This test doesn't work yet because it needs `avm2-domainscope` to get merged in.
2020-11-27 13:23:34 -08:00
dependabot-preview[bot] f843399aff build(deps-dev): bump @wdio/cli from 6.10.0 to 6.10.2 in /web
Bumps [@wdio/cli](https://github.com/webdriverio/webdriverio) from 6.10.0 to 6.10.2.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v6.10.0...v6.10.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-27 13:14:37 -08:00
Mike Welsh 7898776e0c tests: Add polyfill tests for missing movie 2020-11-26 18:19:57 -08:00
Mike Welsh 5d99dce16c tests: Add polyfill test for object+embed with only clsid 2020-11-26 18:19:57 -08:00
Mike Welsh b128c876ea tests: Alter embed-inside-object polyfill tests to expect ruffle-embed 2020-11-26 18:19:57 -08:00
Mike Welsh e66fc6f6a1 web: Avoid double polyfilling embed-inside-object 2020-11-26 18:19:57 -08:00
Nathan Adams f053562408 chore: Fix publish of js docs 2020-11-26 17:07:58 -08:00
relrelb 1d648a1d55 core: Use encoding_rs in load_vars_loader
This adds support for BOM.
2020-11-26 15:41:50 -08:00
Nathan Adams eca4ba0313 desktop: Potentially fixed panic when windows can't make a path absolute 2020-11-26 14:04:18 -08:00
dependabot-preview[bot] ed50b9ae33 build(deps-dev): bump webpack from 5.7.0 to 5.8.0 in /web
Bumps [webpack](https://github.com/webpack/webpack) from 5.7.0 to 5.8.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.7.0...v5.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-26 11:21:33 -08:00
Nathan Adams ed46170cdb chore: Update cargo dependencies 2020-11-26 11:20:59 -08:00
Nathan Adams d8728bbf25 avm1: Made firstChild and lastChild ignore non-node children 2020-11-26 11:18:00 -08:00
Nathan Adams c8bb54977b core: Fix panic loading 'invalid-ish' html in text fields - fixes #1193 2020-11-26 11:17:00 -08:00
Nathan Adams a4baa4897e chore: Fix nightly builds 2020-11-26 11:14:58 -08:00
dependabot-preview[bot] 88ff89d6b1 build(deps-dev): bump webpack from 5.6.0 to 5.7.0 in /web
Bumps [webpack](https://github.com/webpack/webpack) from 5.6.0 to 5.7.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.6.0...v5.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-26 00:16:03 -08:00
Mike Welsh aff34a4233 core: Seed RNG with timestamp 2020-11-26 00:07:59 -08:00
IWumboYouWumbo 9501ff06b0
web: Refinements to meta user interface (attempt 2)
- Fonts are no longer inherited, Arial is used instead
- Play button is smaller and shares same styling as unmute button
- Context menu text is always aligned to the left
- Panic screen text displays in white instead of black (it's much easier to read this way)
- CSS is cleaner and less redundant
I'm iffy on the changes to the play button aesthetic (it ranges from translucent -> opaque instead of opaque -> brighter opaque) so opinions are welcome.
- Fixed context menu hover issue, added drop shadow
- More redundancy fixes
2020-11-25 20:49:38 -08:00
Nathan Adams c13d5e349b web: Move autoplay/unmuteOverlay from Config to BaseLoadOptions - and made config default the load options 2020-11-25 11:33:51 -08:00
Nathan Adams 797dd83766 web: Merge streamSwfUrl and streamSwfData into load 2020-11-25 11:33:51 -08:00
dependabot-preview[bot] 48f8e6579a build(deps-dev): bump prettier from 2.1.2 to 2.2.0 in /web
Bumps [prettier](https://github.com/prettier/prettier) from 2.1.2 to 2.2.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.1.2...2.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-24 20:55:38 -08:00
dependabot-preview[bot] a7239eba79 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.7.0 to 4.8.2.
- [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.8.2/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-24 19:36:14 -08:00
dependabot-preview[bot] 252186756d build(deps-dev): bump @typescript-eslint/parser in /web
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.7.0 to 4.8.2.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.8.2/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-24 19:36:01 -08:00
Mike Welsh 53212f192c chore: Appease clippy, squelch unnecessary_wraps lint 2020-11-24 18:59:42 -08:00
willbrindle 54ac1ea300 docs: Update demo README instructions to be correct 2020-11-24 17:50:30 -08:00
willbrindle c3e64f1b12 demo: Allow specifying file in demo via query params 2020-11-24 17:50:30 -08:00
Nathan Adams a02a81f80f web: Fixed extension & local not detecting eachother correctly 2020-11-24 16:36:33 -08:00
Nathan Adams bcfe59c351 web: Rename Config.public_paths to Config.publicPaths 2020-11-24 16:36:33 -08:00
Nathan Adams 707788218d web: Rename Config.public_path to Config.publicPath 2020-11-24 16:36:33 -08:00
Nathan Adams 103f0d69e8 web: Default autoplay to 'auto' 2020-11-24 16:36:33 -08:00
Nathan Adams 600d267bf3 web: We no longer need git dependency in webpack builds - fixes #1517 2020-11-24 16:36:33 -08:00
Nathan Adams cc81122fd8 web: Make sure player config takes priority over global config 2020-11-24 16:36:33 -08:00
Nathan Adams 799c0955b3 web: Add options for autoplay
This is a rewritten version of PR #1161 by Toad06
2020-11-24 16:36:33 -08:00
Nathan Adams a03b2fdea6 web: Add mute overlay
Original code by Toad06 as part of PR #1161
2020-11-24 16:36:33 -08:00
Mike Welsh e655cf0c08 web: Add Ruffle::audio_context getter 2020-11-24 16:36:33 -08:00