Commit Graph

2726 Commits

Author SHA1 Message Date
Mike Welsh e8ec02418b avm2: Fix Array.splice
Fix `Array.splice` in cases where elements are added but not
deleted, and when the starting index is larger than the length
of the array.
2021-04-30 13:48:27 -07:00
Mike Welsh 2a46c72bb2 avm1: Fix Array.splice
Clamp the index parameters to the length of the array. This fixes
`[].splice(1, 0, 'obj');` to add the object at the proper
position (0, because the start index 1 is larger than the length).
2021-04-30 13:48:27 -07:00
dependabot-preview[bot] b57e1a14f0 build(deps): bump syn from 1.0.70 to 1.0.71
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.70 to 1.0.71.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.70...1.0.71)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-28 10:02:43 -07:00
David Wendt 041003f256 avm2: Slot lookups don't need the whole trait list, just the first one we find. 2021-04-28 00:01:47 -07:00
David Wendt fd08a6ebf6 avm2: Instantiate slot traits on `get_slot`, `set_slot` etc.
Previously, we only instantiated slot traits when named as a property, which is only half the picture.
2021-04-28 00:01:47 -07:00
David Wendt e35d1edbf0 avm2: Allow pulling traits by slot id 2021-04-28 00:01:47 -07:00
David Wendt 07db1786f1 tests: Add a test for AVM2 nested closures (which thus tests `newactivation`) 2021-04-28 00:01:47 -07:00
David Wendt 9318028b52 avm2: `newactivation` should return an object which implements the traits listed in the associated method `body`'s trait list 2021-04-28 00:01:47 -07:00
David Wendt 6c5098d3c7 avm2: Fix order in which `setslot` takes it's parameters 2021-04-28 00:01:47 -07:00
Adrian Wielgosik 5a6117722d core: Also hide playback controls on single-frame SWFs 2021-04-27 16:42:02 -07:00
Adrian Wielgosik a1737b5922 avm1: Respect menu.builtInItems, but on root clip only 2021-04-27 16:42:02 -07:00
Adrian Wielgosik c3a16cb992 avm2: Support Stage.showDefaultContextMenu 2021-04-27 16:42:02 -07:00
Adrian Wielgosik ce4d66e0f4 avm1: support Stage.showMenu 2021-04-27 16:42:02 -07:00
Adrian Wielgosik 41a126885c web: Minimal context menu buttons for movie control 2021-04-27 16:42:02 -07:00
TÖRÖK Attila 61fddf530e core/display_object: Correctly draw videos that have different bounds than the size of their actual frame data 2021-04-27 11:49:16 -07:00
Mike Welsh 1f8434aee6 tests: Add test for Stage.scaleMode/align 2021-04-26 01:15:42 -07:00
Mike Welsh a57f227bda core: Implement Stage resize events 2021-04-26 01:15:42 -07:00
Mike Welsh 251fd55567 core: Adjust stage size by DPI factor in NoScale scale mode 2021-04-26 01:15:42 -07:00
Mike Welsh 98befe678e avm2: Add flash.display.StageScaleMode and Stage.scaleMode 2021-04-26 01:15:42 -07:00
Mike Welsh 80bcf68634 avm1: Add StageScaleMode and StageAlign properties to Stage 2021-04-26 01:15:42 -07:00
Mike Welsh b4717130e3 core: Add StageScaleMode and StageAlign properties to Stage 2021-04-26 01:15:42 -07:00
David Wendt a877fe8c67 tests: Add a new test for properties unique to the `Stage` 2021-04-26 01:15:42 -07:00
David Wendt 52c3b0f1bc avm2: `Stage.color` yields background color alpha (always 0xFF) in the high bits of the u32 2021-04-26 01:15:42 -07:00
David Wendt 41fe51e9db avm2: Impl `flash.display.StageQuality` enum 2021-04-26 01:15:42 -07:00
David Wendt 93d7f0b450 avm2: Stub `Stage.quality` 2021-04-26 01:15:42 -07:00
David Wendt 327a425fde avm2: Stub `Stage.allowsFullScreen` and `Stage.allowsFullScreenInteractive` 2021-04-26 01:15:42 -07:00
David Wendt cb167e0814 avm2: Impl `Stage.stageWidth`/`Stage.stageHeight`, sorta 2021-04-26 01:15:42 -07:00
David Wendt 1ee5bbf7ba avm2: Impl `Stage.frameRate` 2021-04-26 01:15:42 -07:00
David Wendt 5d8f70d695 avm2: Implement `Stage.focus` 2021-04-26 01:15:42 -07:00
David Wendt 524f5fe57f avm2: Impl `Stage.color`'s setter 2021-04-26 01:15:42 -07:00
David Wendt 6c6bd74af9 avm2: Impl `Stage.displayState`'s getter 2021-04-26 01:15:42 -07:00
David Wendt ae080fd65f avm2: Impl `flash.display.StageDisplayState` 2021-04-26 01:15:42 -07:00
David Wendt b858f74139 avm2: Impl `Stage.contentsScaleFactor` 2021-04-26 01:15:42 -07:00
David Wendt 247f7e3de4 avm2: Impl `Stage.color` 2021-04-26 01:15:42 -07:00
David Wendt d7a0d15fd8 avm2: Expose `Stage.browserZoomFactor` 2021-04-26 01:15:42 -07:00
David Wendt 0c6584ca03 core: Store the viewport's scale factor on the stage 2021-04-26 01:15:42 -07:00
David Wendt 98788ef194 avm2: Impl `flash.display.StageAlign` 2021-04-26 01:15:42 -07:00
David Wendt 2a30887660 avm2: Support the half-broken `loaderInfo` on the `Stage` 2021-04-26 01:15:42 -07:00
David Wendt ef4db9ba16 avm2: Add overrides for every property that cannot be set on the `Stage`.
Yes, this includes properties that aren't implemented yet. They'll return a different error, but they'll still error out regardless, so I'm fine with this.
2021-04-26 01:15:42 -07:00
David Wendt bc9affb09d tests: Add tests for stage access and basic display object properties 2021-04-26 01:15:42 -07:00
David Wendt 716d492006 avm2: The stage's name should be `null`, not an empty string; and setting it should except. 2021-04-26 01:15:42 -07:00
David Wendt 01f74f6eb1 avm2: Add a convenience method for marking a builtin override trait. 2021-04-26 01:15:42 -07:00
David Wendt 8452e23382 avm2: Allow access to the `Stage`, both directly and indirectly 2021-04-26 01:15:42 -07:00
David Wendt ba66c62947 core: Ensure `Stage` always has an AVM2 representation 2021-04-26 01:15:42 -07:00
David Wendt 81de112774 avm2: Add `Stage` class stub 2021-04-26 01:15:42 -07:00
David Wendt 7f4a99ca60 core: Add a `root_clip` method for `Stage` and make everything grabbing depth 0 off the stage use it 2021-04-26 01:15:42 -07:00
David Wendt 36e486b1d0 core: We don't need `CollectWrapper` anymore 2021-04-26 01:15:42 -07:00
David Wendt f6fe0a84a2 core: Move the viewport and stage dimensions into the `Stage`. 2021-04-26 01:15:42 -07:00
David Wendt c09bd0520c core: Run all of the steps of a frame update on the `Stage` 2021-04-26 01:15:42 -07:00
David Wendt b021d04345 core: Correct order of viewport bounds in render context 2021-04-26 01:15:42 -07:00