Commit Graph

5850 Commits

Author SHA1 Message Date
relrelb 855bc721a8 html: Restore handling of "br" tags
This fully reverts commit 2119ce9.
Seems like Flash does handle "br" tags, but ignores them under some
unknown circumstances (e.g. setting `htmlText` in AVM1).
For now handle "br" tags unconditionally.
2021-11-15 23:28:51 +02:00
dependabot[bot] 60c2a14363 build(deps): bump isahc from 1.5.1 to 1.6.0
Bumps [isahc](https://github.com/sagebind/isahc) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/sagebind/isahc/releases)
- [Commits](https://github.com/sagebind/isahc/compare/1.5.1...1.6.0)

---
updated-dependencies:
- dependency-name: isahc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-15 23:27:05 +02:00
Daniel Jacobs d86bf69a04 i18n: Add spanish tranlation for swf download option 2021-11-15 23:12:27 +02:00
Daniel Jacobs d3a5561e8f web: Give toggleable option to download swfs in extension/selfhosted 2021-11-15 23:12:27 +02:00
relrelb 2083d77100 tests: Expand `sound`
Add cases of `Sound.setVolume()` and `Sound.setPan()` with no arguments.
Also correct `Sound` to `sound` in traces.
2021-11-14 20:25:45 +02:00
relrelb 2e5a8922ae tests: Uncomment `Sound.getDuration` tests
`NullAudioBackend` returns real durations by now.
2021-11-14 20:25:45 +02:00
relrelb 73f5982cad avm1: Fix `Sound.setVolume()` and `Sound.setPan()` with no arguments
Instead of coercing `undefined` into `f64` (which results `NaN` in SWF7+),
treat the missing value argument as `0`.
2021-11-14 20:25:45 +02:00
relrelb df514f319a html: Restore handling of "sbr" tags
This partially reverts commit 2119ce9821,
only restoring "sbr" tags handling because Flash seems to ignore only
"br" tags.
2021-11-13 12:11:48 +02:00
relrelb 2119ce9821 html: Remove handling of "br" and "sbr" tags
Seems like Flash just ignores them.
2021-11-13 10:21:41 +02:00
relrelb 12e8d3a82f html: Fix typo 2021-11-13 10:21:41 +02:00
David Wendt 19f9c11854 tests: Add test for `Function`'s type. 2021-11-11 17:12:49 -07:00
David Wendt c0874f445d avm2: Functions are functions. 2021-11-11 17:12:49 -07:00
David Wendt 7dd9776d40 avm2: Implement `uint`, `Number`, and `Boolean`'s constructors, too. 2021-11-11 16:34:11 -07:00
David Wendt e89d85c3f6 tests: Add tests for the four remaining primitive constructors 2021-11-11 16:34:11 -07:00
David Wendt 7cc7f0fe7f avm2: Impl `int`'s instance initializer. 2021-11-11 16:34:11 -07:00
David Wendt be3e126ebb avm2: Stub the `Sprite` constructor as just creating a `MovieClip`. 2021-11-11 16:33:33 -07:00
Tal Hayon 7ed38850fd core: implement displayState for Stage in avm1/2 2021-11-11 16:20:05 -07:00
relrelb 7b95441874 core: Re-use `EditText::html_text` in `EditText::propagate_text_binding` 2021-11-11 08:05:33 +02:00
relrelb cf05137c1f core: `EditText::html_text` cannot fail 2021-11-11 08:05:33 +02:00
relrelb 848b721165 xml: Remove `XmlNode::walk` 2021-11-11 08:05:33 +02:00
relrelb c4729d733c core: Avoid one usage of `FormatSpans::replace_text`
Use `FormatSpans::from_text` instead.
2021-11-11 08:05:33 +02:00
relrelb 3cab464026 core: Use `quick-xml` directly when creating `FormatSpans` 2021-11-11 08:05:33 +02:00
relrelb 8c64951b15 core: Remove unused `EditText::document` 2021-11-11 08:05:33 +02:00
relrelb a900aae63e core: Make `EditText::set_html_text` accept a `&str` 2021-11-11 08:05:33 +02:00
relrelb 0787662079 core: Make `EditText::set_text` accept a `&str` 2021-11-11 08:05:33 +02:00
David Wendt c4b680fef9 tests: Add test for `EventDispatcher.toString` 2021-11-10 18:16:26 -07:00
David Wendt 67e7526517 avm2: `EventDispatcher` contains an undocumented `toString` method. 2021-11-10 18:16:26 -07:00
David Wendt 360ae1f044 avm2: Private classes in different scripts are allowed to share the same name without conflicting. 2021-11-10 17:43:02 -07:00
David Wendt 60eb88b326 avm2: Note currently incorrect behavior intended to be fixed in a future PR. 2021-11-09 17:28:33 -07:00
David Wendt 4cfa3253d5 avm2: Impl `Proxy`'s enumeration-related methods. 2021-11-09 17:28:33 -07:00
David Wendt 4289f89350 avm2: Split out enumerant values into a separate method as well. 2021-11-09 17:28:33 -07:00
David Wendt 297526269c avm2: Allow objects to assign arbitrary enumerant indexes, by having objects drive the enumeration process rather than just counting from one 2021-11-09 17:28:33 -07:00
David Wendt 5b58301795 tests: Fix all remaining test bugs caused by discrepancies between how Ruffle and Flash Player handle dynamic `Namespace`s.
For some reason, in Flash Player, `RTQName`s that use a dynamic namespace do *not* pick the same namespace that you would ordinarily get if declaring or referencing that namespace statically. My suspicion is that this has something to do with E4X namespaces, which are flagged as a separate space from ES4 namespaces.
2021-11-09 17:28:33 -07:00
David Wendt 1170385c3b avm2: Implement `Proxy.hasproperty` 2021-11-09 17:28:33 -07:00
David Wendt 427b2bf17a avm2: Implement `Proxy.deleteproperty` 2021-11-09 17:28:33 -07:00
David Wendt 503dc08594 avm2: Refactor `Object.delete_property` to work similar to get/set 2021-11-09 17:28:33 -07:00
David Wendt e67ca1afe0 avm2: Implement `Proxy.callproperty` 2021-11-09 17:28:33 -07:00
David Wendt 301fd1020f avm2: Implement `Proxy.setproperty` 2021-11-09 17:28:33 -07:00
David Wendt 8f47f494e7 avm2: Implement `Proxy`'s `getproperty` behavior. 2021-11-09 17:28:33 -07:00
David Wendt f05e92c974 avm2: Fix `RTQNameL`'s parameters being popped backwards 2021-11-09 17:28:33 -07:00
David Wendt 452a87da84 tests: In the `getproperty` test, test each multiname type directly to rule out any funny business.
For some reason, Flash Player treats `getlex`ing `flash.utils.flash_proxy` as a separate namespace from `pushnamespace`ing it. Don't ask why.
2021-11-09 17:28:33 -07:00
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