Commit Graph

1024 Commits

Author SHA1 Message Date
David Wendt 807725d7aa Expose `firstChild` and `lastChild` to ActionScript w/ tests 2020-01-04 19:00:24 -05:00
David Wendt 1d1e493e0e Refactor the child adoption process to ensure the child also adopts it's siblings. 2020-01-04 19:00:23 -05:00
David Wendt 48d68bebc4 Implement `hasChildNodes()` and add test 2020-01-04 19:00:23 -05:00
David Wendt c58e866236 Add test for `cloneNode` 2020-01-04 19:00:22 -05:00
David Wendt 881dcb76ab `cloneNode` without arguments is morally equivalent to `false` 2020-01-04 19:00:21 -05:00
David Wendt 8e33566d07 Add namespacing test 2020-01-04 19:00:21 -05:00
David Wendt 69a1ab1649 Expose namespace prefix and URI lookups to ActionScript.
Also, fix the previous commit's half-assed impl.
2020-01-04 19:00:20 -05:00
David Wendt fe7d2b5173 Extremely WIP impl of `lookup_uri_for_namespace` 2020-01-04 19:00:20 -05:00
David Wendt 55fa6ef09b Add node cloning support 2020-01-04 19:00:19 -05:00
David Wendt 37f6efb753 Expose `appendChild` to ActionScript 2020-01-04 19:00:19 -05:00
David Wendt 08c0f273a6 Add sibling links to nodes. 2020-01-04 19:00:18 -05:00
David Wendt 7e45dee8cf Clippy said so. 2020-01-04 19:00:18 -05:00
David Wendt eec449422b `XMLDocument.roots` is not necessary since you can just get the children of it's node form anyway... 2020-01-04 19:00:18 -05:00
David Wendt f8f569440f Add very basic XML test 2020-01-04 19:00:17 -05:00
David Wendt cfacd397cf Most XML properties return `null`, not `undefined`.
Furthermore, `prefix` does not distinguish between `<test>` and `<:test>` - they both have a `prefix` of `""`.
2020-01-04 19:00:17 -05:00
David Wendt b491dd034e Don't overflow stack when debug-printing an entire document, either. 2020-01-04 19:00:16 -05:00
David Wendt e47a1d1e38 Fix newly constructed XML trees not actually containing the XML they just parsed. 2020-01-04 19:00:16 -05:00
David Wendt 960e4dad90 Don't cause stack overflow when debug-printing XML nodes. 2020-01-04 19:00:16 -05:00
David Wendt bec60acc1e `XML.prototype` should be an `XMLObject` so that instances of `XML` can hold a node 2020-01-04 19:00:15 -05:00
David Wendt d058c83ac0 Document roots should accept children. 2020-01-04 19:00:15 -05:00
David Wendt 571c4bbd52 Cargo fmt compliance 2020-01-04 19:00:15 -05:00
David Wendt 0af248d81f Expose `childNodes` to ActionScript 2020-01-04 19:00:14 -05:00
David Wendt e7768d0802 Add methods to allow storing XML objects on the accompanying tree nodes, so that expando properties on child nodes will work. 2020-01-04 19:00:13 -05:00
David Wendt b06dd5d15e Add a special node to represent the document root in the node tree, and get rid of the explicit document reference type in `XMLObject`. 2020-01-04 19:00:12 -05:00
David Wendt 0fe0e4fe90 Separate `XMLName` into another module 2020-01-04 19:00:11 -05:00
David Wendt 3928c7cc51 Reject empty text nodes 2020-01-04 19:00:11 -05:00
David Wendt 7a9a16e598 Don't repeat yourself. 2020-01-04 19:00:11 -05:00
David Wendt bd1ea56cc3 Implement `XMLNode` properties that don't require child or attribute iteration. 2020-01-04 19:00:10 -05:00
David Wendt e2eb3d0bde Add a test of XMLDocument::from_str.
This test technically works, but the results were slightly surprising. If it turns out Flash works differently from `quick_xml`, we'll change this test to match Flash.
2020-01-04 19:00:10 -05:00
David Wendt 6ae5ae3038 Add Comment parsing support 2020-01-04 19:00:10 -05:00
David Wendt 4f5ac09b73 Expose XML document constructor, including text parsing ability 2020-01-04 19:00:09 -05:00
David Wendt 554f0dc1e5 Add XMLNode class and constructor impl 2020-01-04 19:00:07 -05:00
David Wendt 6a65e984ae Add a new `XMLObject` variant to the AVM1 object ecosystem.
This particular variant is actually a two-in-one deal: `XMLObject`s may either refer to a document or a node.
2020-01-04 18:58:42 -05:00
David Wendt 89c9753520 Add rudimentary custom DOM impl on top of `quick_xml`.
`quick_xml` was chosen due to it's high performance and support for zero-copy use cases. However, we are not using `minidom`, which is the already-extant DOM impl that uses `quick_xml` as it's parsing provider. This is because `minidom` nodes are not amenable to garbage collection.

Specifically: we want to be able to construct a new `Object` variant that holds part of an XML node. However, `minidom::Element` directly owns it's children, meaning that we can't hold references to it from within `Object` while also keeping those objects to the `'gc` lifetime. Hence, we provide a GC-exclusive DOM implementation.

I ruled out solutions such as holding an entire XML tree in an `Rc` and having AVM objects that shadow them. This works for `SwfSlice` because indexing an array is cheap; but traversing a tree can get very expensive. XML is used in many places in Flash Player, so it's important that we treat it like a first-class citizen.
2020-01-04 18:48:17 -05:00
Mike Welsh 4ce67535b0 tests: Add test for Color 2020-01-03 20:31:32 -08:00
Mike Welsh 36b3e5b34f avm1: Implement Color class 2020-01-03 20:31:32 -08:00
Mike Welsh 4bf29f677f avm1: Implement Sound.duration
Add AudioBackend::get_sound_duration.
2020-01-03 17:11:00 -08:00
Mike Welsh b9d24d9a49 avm1: First pass at implementing Sound.stop 2020-01-03 17:11:00 -08:00
Mike Welsh d0142f1d67 audio: Add AudioBackend::stop_sound 2020-01-03 17:11:00 -08:00
Mike Welsh 63dd92259b avm1: First pass of Sound object 2020-01-03 17:11:00 -08:00
dependabot-preview[bot] c966f9bf59 build(deps): bump winit from 0.20.0-alpha5 to 0.20.0-alpha6
Bumps [winit](https://github.com/rust-windowing/winit) from 0.20.0-alpha5 to 0.20.0-alpha6.
- [Release notes](https://github.com/rust-windowing/winit/releases)
- [Changelog](https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-windowing/winit/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-04 00:02:22 +00:00
dependabot-preview[bot] a01e5b7854 build(deps): bump syn from 1.0.12 to 1.0.13
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.12 to 1.0.13.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.12...1.0.13)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-03 19:15:37 +00:00
dependabot-preview[bot] b4a47e17da build(deps): bump generational-arena from 0.2.6 to 0.2.7
Bumps [generational-arena](https://github.com/fitzgen/generational-arena) from 0.2.6 to 0.2.7.
- [Release notes](https://github.com/fitzgen/generational-arena/releases)
- [Changelog](https://github.com/fitzgen/generational-arena/blob/master/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/generational-arena/compare/0.2.6...0.2.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-03 19:14:43 +00:00
dependabot-preview[bot] 353dc5c229 build(deps-dev): bump webpack from 4.41.4 to 4.41.5 in /web/selfhosted
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.4 to 4.41.5.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.4...v4.41.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-03 08:25:48 +00:00
dependabot-preview[bot] 1048170235 build(deps): bump syn from 1.0.11 to 1.0.12
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.11...1.0.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-03 08:24:29 +00:00
dependabot-preview[bot] 861a4484a5 build(deps): bump structopt from 0.3.6 to 0.3.7
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.6 to 0.3.7.
- [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.6...v0.3.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-29 23:10:17 +00:00
dependabot-preview[bot] 71ba4cb86e build(deps): bump lyon from 0.15.1 to 0.15.3
Bumps [lyon](https://github.com/nical/lyon) from 0.15.1 to 0.15.3.
- [Release notes](https://github.com/nical/lyon/releases)
- [Changelog](https://github.com/nical/lyon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nical/lyon/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-29 22:56:08 +00:00
Mike Welsh 7feddfcb03 desktop: Bump to lyon 0.15.2 (fix #196)
The new tessellator in lyon seems to fix many of the cases where
art would not tessellate correctly.
2019-12-27 17:21:48 -08:00
Mike Welsh 87158647d1 core: Implement keyPress button events 2019-12-24 03:06:03 -08:00
Mike Welsh 30983c5bab web: Use pointer events on web 2019-12-23 13:16:58 -08:00