Commit Graph

1473 Commits

Author SHA1 Message Date
Mike Welsh 8da9487c0a avm1: Match Flash's property enumeration order (fix #153) 2020-03-28 16:22:02 -07:00
Mike Welsh 2cdf780e6f avm1: Handle case sensitivity in DisplayObject children
Alter `get_child_by_name` and alter `get_level_by_path` to respect
case sensitivity.
2020-03-28 16:22:02 -07:00
Mike Welsh 81a0bb370b tests: Add test for SWF<=6 case insensitivty 2020-03-28 16:22:02 -07:00
Mike Welsh ea245895b0 avm1: Use PropertyMap for stage object magic properties 2020-03-28 16:22:02 -07:00
Mike Welsh 7d848f4f34 avm1: Add avm parameter to TObject methods
This is necessary to get the current SWF version for properly
handing case sensitivity.
2020-03-28 16:22:02 -07:00
Mike Welsh 1ef698f2ea core: Add PropertyMap for handling AVM1 object properties
`PropertyMap` wraps over `IndexMap` to handle object properties in
AVM1. All insert/remove/get methods require and `swf_version`
parameter, and the `PropertyMap` will take care of handling case
senstivity and maintaing iteration order based on the SWF version.
2020-03-28 16:22:02 -07:00
Mike Welsh d42a402522 avm1: Add display object methods to TextField 2020-03-26 14:19:18 -07:00
Mike Welsh c1abbdacdd chore: Fix naming convention 2020-03-26 02:55:25 -07:00
Mike Welsh e237536293 web: Blacklist "Adobe Flash Player" title attribute (fix #468)
The "Click to activate Flash" box from Chrome stomps on the title
attribute of a Flash embed when you mouse over it. This causes
an annoying "Adobe Flash Player" tooltip to appear even after
Ruffle replaces the embeds.

Now we check for this specific title and remove it.
2020-03-26 02:37:25 -07:00
Mike Welsh 6aaf950b7a chore: Bump winit, glutin, glium 2020-03-26 01:05:12 -07:00
Mike Welsh 7865ec1021 avm1: Implement Button object
First implementation of Button object. Hook up to the button
display object and run onRelease etc. methods as appropriate.

Pull out common display object methods into globals::display_object.
2020-03-26 00:21:21 -07:00
Mike Welsh c2e9d5d757 web: Install plugin spoof immediately on script load
Scripts like SWFObject check for the Flash plugin immediately when
they load, so we can't defer installing the spoof. Fixes #448.
2020-03-25 20:14:31 -07:00
Mike Welsh 353eeec6c3 web: Return matching Flash Player version for MIME type description
The plugin detection spoofer would add " "Shockwave Flash 32.0 r0
(compatible; Ruffle 0.1)" to the Flash MIME type description in
the plugins array. However, this breaks SWFObject's version
detection, which does a simple String split.

Now we return the same value as the official player:
"Shockwave Flash 32.0 r0"
2020-03-25 20:14:31 -07:00
Mike Welsh 4df1128c19
core: Implement Object.registerClass (merge #344)
Implement Object.registerClass
2020-03-25 18:55:49 -07:00
Mike Welsh 774aa59210 web: Default public_path to currentScript URL
Also automatically add trailing slash on public_path if necessary.
2020-03-25 00:54:21 -07:00
Mike Welsh 5591cec0f7 web: Fix #412, incorrect bitmap rendering when cached 2020-03-24 23:08:15 -07:00
Mike Welsh fa063a6f53 web: Enable dynamic-content polyfill by default
Co-authored-by: Justin-CB <55590227+Justin-CB@users.noreply.github.com>
2020-03-24 22:13:10 -07:00
Mike Welsh e332e5c24c web: Simplify polyfill code
Addresses #464. Use `document.getElementsByTagName` to find all
object and embed tags in the document. For dynamic content,
we keep these live collections around, and re-check them whenever
a MutationObserver fires.

Co-authored-by: Justin-CB <55590227+Justin-CB@users.noreply.github.com>
2020-03-24 22:13:10 -07:00
dependabot-preview[bot] 80bfaa5f11 build(deps-dev): bump webpack from 4.42.0 to 4.42.1 in /web/selfhosted
Bumps [webpack](https://github.com/webpack/webpack) from 4.42.0 to 4.42.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.42.0...v4.42.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-24 19:29:20 +00:00
Mike Welsh 4561b591bf web: Handle percentage dimensions in polyfill (fix #433)
When Ruffle replaces a Flash embed, the width/height of the embed
are copied over to CSS of the Ruffle element. "px" was being
appended even if the dimensions were a % value, which CSS rejected.

Try to be a little smarter about parsing out the HTML dimension
attributes (HTML is more lenient). Append "px" only if the value
isn't a percentage.

Fixes #433.
2020-03-21 01:23:23 -07:00
Mike Welsh 9e6fe41a91 web: Ignore errors on `Element.setAttribute` in polyfill
Ruffle would not polyfill a Flash embed if it had bogus attributes
in the embed tag. Now these errors are silently ignored.

Fixes the other part of #457.
2020-03-20 20:47:58 -07:00
Mike Welsh 099c497a91 web: Activate polyfill if embed src ends in .swf
Fixes part of #457. Even if the MIME type/class IDs are missing
on the embed/object tags, browsers will still attempt to play
the file as Flash if it ends in a .swf extension.
2020-03-20 20:47:58 -07:00
dependabot-preview[bot] ef5ee3a889 build(deps): bump syn from 1.0.16 to 1.0.17
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.16 to 1.0.17.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.16...1.0.17)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-21 01:37:48 +00:00
Mike Welsh e9cb05aeb4 avm1: Correct order of modulo operands
Addresses part of #458.
2020-03-20 16:00:28 -07:00
hthh a16885d84b avm1: Fix string-to-number octal and whitespace handling
This conversion allows negative octal values, but not negative
hex values, and ignores only leading ASCII whitespace. A test
for this behavior is included.
2020-03-20 04:27:41 -07:00
Nathan Adams b4624fddce avm1: GetVariable and SetVariable look through the scope chain. Fixes #414
GetVariable and SetVariable attempt to resolve paths on each scope
in the scope chain.
2020-03-19 19:58:16 -07:00
dependabot-preview[bot] 265197b475 build(deps): bump structopt from 0.3.11 to 0.3.12
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.11 to 0.3.12.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.11...v0.3.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-18 20:35:34 +00:00
dependabot-preview[bot] f104ed2939 build(deps): bump serde from 1.0.104 to 1.0.105
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.104 to 1.0.105.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.104...v1.0.105)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-18 19:40:22 +00:00
Mike Welsh 454cd29ed6 chore: EditText::font takes self by value 2020-03-17 19:42:57 -07:00
Mike Welsh 068f4c3bee core: Edit text uses device fonts when outline flag isn't set
Specifically fall back to the device font when the UseOutlines
flag is not set in DefineEditText (SWF19 p.172). Fixes #451.

Note that since we only use a single font for "device" rendering,
this may sometimes be a different font than is specified in the
Flash IDE.
2020-03-17 19:13:20 -07:00
dependabot-preview[bot] 1ba60ebd67 build(deps): bump image from 0.23.1 to 0.23.2
Bumps [image](https://github.com/image-rs/image) from 0.23.1 to 0.23.2.
- [Release notes](https://github.com/image-rs/image/releases)
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image/compare/v0.23.1...v0.23.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-17 17:32:09 +00:00
dependabot-preview[bot] da3398c832 build(deps): bump bitstream-io from 0.8.4 to 0.8.5
Bumps [bitstream-io](https://github.com/tuffy/bitstream-io) from 0.8.4 to 0.8.5.
- [Release notes](https://github.com/tuffy/bitstream-io/releases)
- [Commits](https://github.com/tuffy/bitstream-io/commits/v0.8.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-17 17:08:59 +00:00
dependabot-preview[bot] 29624ec391 build(deps): bump flate2 from 1.0.13 to 1.0.14
Bumps [flate2](https://github.com/alexcrichton/flate2-rs) from 1.0.13 to 1.0.14.
- [Release notes](https://github.com/alexcrichton/flate2-rs/releases)
- [Commits](https://github.com/alexcrichton/flate2-rs/compare/1.0.13...1.0.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-17 17:08:13 +00:00
dependabot-preview[bot] 2bfa2502a9 build(deps): bump num_enum from 0.4.2 to 0.4.3
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.4.2 to 0.4.3.
- [Release notes](https://github.com/illicitonion/num_enum/releases)
- [Commits](https://github.com/illicitonion/num_enum/compare/0.4.2...0.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-17 17:07:35 +00:00
Mike Welsh c2ce9892b1 core: Clamp RGBA when un-multiplying alpha
Fixes some bad pixels sometimes appearing in decoded JPEGs (such
as in #437 and in Dad 'n' Me).
2020-03-16 16:11:59 -07:00
Mike Welsh 26914d7b62 web: Fix off-center gradient rendering
Regression caused by 223edb9. Write twips value to SVG matrix.
Addresses some incorrect rendering in #437.
2020-03-16 02:44:32 -07:00
Mike Welsh b3b81c5e20 chore: Explicitly install wasm-pack on CI 2020-03-16 02:15:55 -07:00
Mike Welsh 17a7b02f14 chore: Bump npm packages 2020-03-16 02:15:55 -07:00
Mike Welsh a0bc9d3ec9 chore: Set to abort on panic
This shaves ~20% size off the desktop build.
2020-03-16 01:16:15 -07:00
dependabot[bot] 893f0fe9e2
Merge pull request #446 from ruffle-rs/dependabot/npm_and_yarn/web/demo/acorn-6.4.1 2020-03-16 07:14:02 +00:00
Mike Welsh ca72070506 chore: Bump ci to 1.42 2020-03-15 23:50:10 -07:00
dependabot[bot] 623849483c
build(deps): bump acorn from 6.4.0 to 6.4.1 in /web/demo
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-16 06:09:43 +00:00
dependabot-preview[bot] 2c1495eebd build(deps): [security] bump acorn in /web/selfhosted
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. **This update includes a security fix.**
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-16 06:09:05 +00:00
dependabot-preview[bot] 0f7f36681d build(deps): bump quick-xml from 0.17.2 to 0.18.1
Bumps [quick-xml](https://github.com/tafia/quick-xml) from 0.17.2 to 0.18.1.
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](https://github.com/tafia/quick-xml/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-16 05:34:45 +00:00
Mike Welsh 24a557807d chore: Fix more clippy lints 2020-03-12 21:40:48 -07:00
Mike Welsh 13b039fa34 chore: Fix clippy iter-nth-zero warnings
New lint added in latest clippy versions.
2020-03-12 21:16:30 -07:00
Mike Welsh 038e8966da
web: Merge #435, spruce up demo page
Spruced up Web Demo page
2020-03-12 16:20:38 -07:00
Sean-Thomas 609b6671b3 Spruced up Web Demo Page
Edited styling for web demo page to look more like the https://ruffle.rs homepage.
2020-03-09 19:33:03 -04:00
dependabot-preview[bot] b85c4e2ed8 build(deps): bump image from 0.23.0 to 0.23.1
Bumps [image](https://github.com/image-rs/image) from 0.23.0 to 0.23.1.
- [Release notes](https://github.com/image-rs/image/releases)
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image/compare/v0.23.0...v0.23.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-09 18:56:56 +00:00
Mike Welsh 098bf33068 chore: Bump quote to 1.0.3 2020-03-08 18:58:39 -07:00