Commit Graph

2112 Commits

Author SHA1 Message Date
CUB3D eff06d3d4d core: Add stub listener methods for SharedObject 2020-06-24 01:43:25 +01:00
CUB3D d3ae6a3a40 core: Fix data property of SharedObject 2020-06-24 01:43:25 +01:00
CUB3D c630e93c87 desktop: Add a disk based implementation of StorageBackend 2020-06-24 01:43:25 +01:00
CUB3D 48693e4a7a core: Add inital storage backend implementation
Currently SharedObjects are encoded and decoded from JSON via the
StorageBackend, also provided is a basic in-memory implementation
2020-06-24 01:43:23 +01:00
CUB3D 539b4b0f63 core: Add stub for SharedObject 2020-06-24 01:42:19 +01:00
dependabot-preview[bot] 6732560726 build(deps-dev): bump sign-addon from 2.0.5 to 2.0.6 in /web
Bumps [sign-addon](https://github.com/mozilla/sign-addon) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/mozilla/sign-addon/releases)
- [Commits](https://github.com/mozilla/sign-addon/compare/2.0.5...2.0.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-23 12:01:24 -07:00
dependabot-preview[bot] 5377a83a17 build(deps): bump serde from 1.0.113 to 1.0.114
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.113 to 1.0.114.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.113...v1.0.114)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-23 11:46:12 -07:00
dependabot-preview[bot] c18640bb72 build(deps-dev): bump eslint from 7.3.0 to 7.3.1 in /web
Bumps [eslint](https://github.com/eslint/eslint) from 7.3.0 to 7.3.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.3.0...v7.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 20:25:21 -07:00
David Wendt 12495de91e Generate `LI`s when newlines are encountered with bullets on. 2020-06-22 19:45:39 -04:00
David Wendt ed5f3cdd0e Don't attempt to use non-embedded fonts. Instead, replace all of them with Noto (like EditText used to do). 2020-06-22 19:02:32 -04:00
David Wendt 40ea58c1c0 Since we cannot parse `<br>` properly yet, replace them and `<sbr>` with newlines before parsing so that we don't get spurious parse errors. 2020-06-22 18:00:51 -04:00
dependabot-preview[bot] a46e4de025 build(deps-dev): bump @wdio/local-runner from 6.1.19 to 6.1.20 in /web
Bumps [@wdio/local-runner](https://github.com/webdriverio/webdriverio) from 6.1.19 to 6.1.20.
- [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.1.19...v6.1.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 17:24:52 +00:00
dependabot-preview[bot] f4660287c3 build(deps-dev): bump @wdio/cli from 6.1.19 to 6.1.20 in /web
Bumps [@wdio/cli](https://github.com/webdriverio/webdriverio) from 6.1.19 to 6.1.20.
- [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.1.19...v6.1.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 17:19:59 +00:00
dependabot-preview[bot] 531e3b1db4 build(deps-dev): bump eslint from 7.2.0 to 7.3.0 in /web
Bumps [eslint](https://github.com/eslint/eslint) from 7.2.0 to 7.3.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.2.0...v7.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 10:19:37 -07:00
dependabot-preview[bot] 934d95f44b build(deps): bump thiserror from 1.0.16 to 1.0.20
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.16 to 1.0.20.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.16...1.0.20)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 10:18:24 -07:00
dependabot-preview[bot] 0a166af8ac build(deps): bump syn from 1.0.32 to 1.0.33
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.32 to 1.0.33.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.32...1.0.33)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-22 10:15:50 -07:00
Nathan Adams cea2c9520d chore: Ignore new 'unnested_or_patterns' clippy lint as we the suggested behaviour doesn't exist outside of nightly 2020-06-21 04:18:44 -07:00
David Wendt 7a9796a2f9 Restore BR parsing.
Note that this won't actually work since we're behind an XML parser that chokes on implicitly self-closing HTML tags.
2020-06-20 20:15:00 -04:00
David Wendt c1ad37a0f6 Implement text span raising, sans list items.
During the raising process, we maintain a list of pointers to the lowest-most `textformat`, `p`, `font`, `a`, `b`, `i`, and `u` in the document that we are appending to. When we get a new one of any of those elements, we clear the rest off the stack. This forces us to add HTML in the same order Flash does.

LIs are not yet supported because they require us to process text line-by-line which doesn't mesh with this model.

There's also a test but the XML DOM generates HTML strings with the wrong attribute order, so the test fails spuriously.
2020-06-20 20:14:57 -04:00
David Wendt e036d6594b Add some entity support to HTML parsing. 2020-06-20 20:08:22 -04:00
David Wendt 88fcb98913 Allow disabling entity processing when parsing XML.
This necessitated a change to edittext_bullet, which turns out is accidentally an entity test, too. It now no longer uses entities so that it won't spuriously fail due to an entity related problem.
2020-06-20 20:06:21 -04:00
David Wendt 65f4d2cf1e Add regression tests for `underline`.
We're within 4px in every case.
2020-06-20 19:56:01 -04:00
David Wendt f097a6584e Implement underlines. 2020-06-20 19:56:01 -04:00
David Wendt d63b3f23e9 Add support for inserting arbitrary drawings into the layout. 2020-06-20 19:56:00 -04:00
David Wendt a2d69a69a3 Add a test for bullets.
As usual with most newline related things, we're 3px off no matter how many or how few lines we have.
2020-06-20 19:56:00 -04:00
David Wendt 1c371c3a95 Render bullets.
Bullets are implemented by rendering U+2022 as if it were normal text, but always placed 18px from the left of the line. This appears to be sort of what Flash does.
2020-06-20 19:55:59 -04:00
David Wendt a3dfa8c21f Bulleted lists get 35px of additional left-margin and do not respect alignment at all. 2020-06-20 19:55:59 -04:00
David Wendt fa2da492a7 Allow ActionScript to control text field borders. 2020-06-20 19:55:58 -04:00
David Wendt 2aa7d9770f Draw a border around text if requested. 2020-06-20 19:55:58 -04:00
David Wendt 8628261dc8 Add a bunch of necessary fixes to default text formatting and HTML format extraction.
This also replaces the `edittext_html_defaults` test with a more robust test that checks the default format and global format of SWF-based, text, and HTML test vectors.
2020-06-20 19:55:57 -04:00
David Wendt 4f3d4c82fb For some reason, Flash does not respect `<br>` at all, so we won't, either.
It *does*, however, respect `<sbr>` (which does the exact same thing), as well as `\n` (which makes absolutely no sense in HTML, normally that would get stripped out).
2020-06-20 19:55:57 -04:00
David Wendt efc6236cb5 Treat the end of each paragraph as a newline. 2020-06-20 19:55:56 -04:00
David Wendt d5fc2709fc Don't use a slice to hold an index.
Fixes clippy on beta and nightly Rust.
2020-06-20 19:55:56 -04:00
David Wendt 58a039a6aa Nulls in font names are ignored. 2020-06-20 19:55:56 -04:00
David Wendt d8a38d06bb Collect font height, letter spacing and the kerning flag into a single `EvalParameters` structure. 2020-06-20 19:55:55 -04:00
David Wendt 1f6d6018dc Use a char pattern here for clippy's sake 2020-06-20 19:55:55 -04:00
David Wendt 1966ec5cb1 Implement `sbr` tags.
No, I don't know what they are either, but at least one movie exists which treats them like `br`, so we'll treat them like that, too.
2020-06-20 19:55:54 -04:00
David Wendt 9e56f10fd0 Approx the align and margins text by up to 3 pixels.
These tests currently have visual bugs in all cases, and measurement bugs in the justification case that require me to approx them.
2020-06-20 19:55:54 -04:00
David Wendt f746ac5539 Implement `justify`, mostly.
This implementation has a few bugs which appear to have something to do with alignment. It's not only justify, but justify is the only test that's flagged as failing.

If you look at the margins test, you'll see what I mean: right-aligned and justified text doesn't quite make it to the right edge of the box even though it should. I'm not sure why.

This also restricts text rounding further: `measure` now only rounds when wrapping text, since Flash Player appears to account for fractional pixels in all other cases.
2020-06-20 19:55:54 -04:00
David Wendt 670c4723e3 Add support for the `kerning` flag, which turns on and off the kerning information on fonts. 2020-06-20 19:55:53 -04:00
David Wendt 3c9a43ea72 Add a regression test for newlines.
This test includes tests for HTML newlines, which causes the XML parser in Ruffle to throw errors. Hence why it's currently ignored.
2020-06-20 19:55:53 -04:00
David Wendt 180ef3b423 Recognize `<br>` as a line break.
This code is currently unreachable as `<br>` will actually trigger an AVM1 error due to our overly-strict XML parser.
2020-06-20 19:55:52 -04:00
David Wendt 045a81e79e Implement `html` and `htmlText`... sort of.
There are several problems, first off:

1. I'm not entirely sure what I'm supposed to be changing on the text field when someone writes `html`.
2. We're using the XML parser for HTML (both `htmlText` and SWF tag parsing) which causes problems. Notably, `<br>` issues an AVM1 error (!!!) because the XML parser doesn't like unclosed tags.
3. Reading `htmlText` should not return the same HTML tree (at least, not until we implement stylesheets). It should instead regenerate an HTML tree from text spans.
2020-06-20 19:55:52 -04:00
David Wendt 2452124631 Break individual words at the start of lines that are too big to fit on the line. 2020-06-20 19:55:51 -04:00
David Wendt 6c44418b10 Add a test for tab_stops.
This test is currently inaccurate by up to 5 pixels, this is due to some behavior with really, really wide tabstops and word breaks that I don't entirely get yet.
2020-06-20 19:55:51 -04:00
David Wendt 2ad216cab4 Don't continue comparing tab stops after we find one that fits. 2020-06-20 19:55:50 -04:00
David Wendt b6c12b1e23 Use current font height times 2.7 as the natural tab stop, as that seems to match Flash... for now. 2020-06-20 19:55:50 -04:00
David Wendt 0e45dc12e9 Recompile the letter spacing test 'cause I spotted an errant `s` in the FLA 2020-06-20 19:55:49 -04:00
David Wendt 2caaa6875d Add support for explicit tabs and newlines. 2020-06-20 19:55:49 -04:00
David Wendt 153ab675e9 When aligning a line, actually consider all the boxes within the line. 2020-06-20 19:55:49 -04:00