Commit Graph

10842 Commits

Author SHA1 Message Date
Mike Welsh cc6320a2dc core: Add `DisplayObject::scaling_grid` 2023-11-09 21:38:53 +01:00
Richy McGregor 10ebc60a7d core: Always redraw text in relayout 2023-11-09 21:20:10 +01:00
Richy McGregor 924e5ef632 core: Store EditText requested height and width (close #13026)
remove now unused EditTextStatic bounds
2023-11-09 21:20:10 +01:00
Richy McGregor 4c819b5fca core: Make set_width & set_height call relayout
this requires an UpdateContext to be passed into both methods
2023-11-09 21:20:10 +01:00
Richy McGregor dad0bbaac8 tests: Add tests for AutoSize text 2023-11-09 21:20:10 +01:00
Richy McGregor fcc0d14188 core: Derive Debug for AutoSizeMode 2023-11-09 21:20:10 +01:00
Richy McGregor dd083dd502 chore: Fix typos 2023-11-09 21:20:10 +01:00
Nathan Adams 6061186c0f core: Fix formatting texts when they start with any amount of <br>s 2023-11-09 20:52:16 +01:00
Lord-McSweeney 249454885b render: In `ShapeTessellator`, set `mask_index_count` to `None` in `flush_draw` before aborting 2023-11-09 20:22:25 +01:00
Nathan Adams fe2ff4f242 chore: Update flash-lso 2023-11-09 20:01:52 +01:00
Aaron Hill bab2a80d64 Fix vtable property amf serialization 2023-11-09 19:43:55 +01:00
Aaron Hill 10d6157755 avm2: Work on AMF3 custom object serialization 2023-11-09 19:43:55 +01:00
Aaron Hill 2982c12ed4 Use VM_INTERNAL api version in helper methods
This is a better default than using the lowest possible version,
as it allows things like AMF deserialization to see all properties
on the target object.

This only affects explicit Ruffle-side property setting - interpreted
code will continue to use the namespace version determined by the
SWF version.
2023-11-09 19:22:27 +01:00
Aaron Hill fa05c66e2a avm2: Implement namespace versioning
This allows us to hide things like `MovieClip.isPlaying` from older
SWFs, which may define an `isPlaying` method without marking it
as an override.

This has the largest impact on public namespaces. There is no longer
just one public namespace - we now have a public namespace per API
version. Most callsites should use `Avm2.find_public_namespace()`,
which determines the public namespace based on the root SWF API version.
This ensures that explicit property access in Ruffle (e.g. calling
"toString") are able to see things defined in the user SWF.

This requires several changes other:

* A new `ApiVersion` enum is introduced, storing all of the api versions
  defined in avmplus
* NamespaceData::Namespace now holds an `ApiVersion`. When we read a
  namespace from a user-defined ABC file, we use the `ApiVersion` from
  the root movie clip. This matches Flash Player's behavior - when a
  child SWF is loaded through `Loader`, its API version gets overwritten
  with the parent's API version, which affects definition visibility and
  'override' requirements in the child SWF. Note that 'behavior changes'
  in methods like `gotoAndPlay` are unaffected.
* The `PartialEq` impl for `Namespace` has been removed - each call site must now choose
  to compare namespaces either by an exact version match, or by
  'compatible' versions (a `<=` check) with `Namespace::matches_ns`
* `PropertyMap` now uses `Namespace::matches_ns` to check for a
  compatible version when looking up a definition.
* When compiling our playerglobal, we pass in the `-apiversioning` flag,
  which causes asc.jar to convert `[API]` metadata into a special
  Unicode 'version mark' suffix in namespace URLs. We parse this
  when loading namespaces to determine the API version to use for
  playerglobal definitions (unmarked definitions use the lowest possible
  version).

Unfortunately, this makes ffdec unable to decompile our
playerglobal.swc
I've going to file an upstream issue
2023-11-09 15:27:33 +01:00
Lord-McSweeney 4d99459849 avm2: Add another FIXME to `create_text_line` 2023-11-09 13:38:48 +01:00
Lord-McSweeney af878c69b2 avm2: Always return same TextLine passed to `recreateTextLine` in `recreateTextLine` 2023-11-09 13:38:48 +01:00
Lord-McSweeney 9be62bf561 chore: fmt 2023-11-09 13:38:48 +01:00
Lord-McSweeney 8301ac16cf avm2: Stub TextJustifier.lineJustification; add constructor handling code 2023-11-09 13:38:48 +01:00
Lord-McSweeney 1f62c29738 avm2: Proper handling of null text of content element 2023-11-09 13:38:48 +01:00
Lord-McSweeney 952955099d avm2: Add a FIXME notice on TextBlock.recreateTextLine 2023-11-09 13:38:48 +01:00
Lord-McSweeney ef847cdbc4 avm2: Implement ContentElement.rawText 2023-11-09 13:38:48 +01:00
Lord-McSweeney dfdd8287fb avm2: Add a FIXME notice about DO Container methods being called on a TextLine 2023-11-09 13:38:48 +01:00
Lord-McSweeney f5a16ad46f chore: appease clippy 2023-11-09 13:38:48 +01:00
Lord-McSweeney 141b50d999 avm2: Implement TextLine.previousLine 2023-11-09 13:38:48 +01:00
Lord-McSweeney 2afb96c41b avm2: Stub InteractiveObject.accessibilityImplementation 2023-11-09 13:38:48 +01:00
Lord-McSweeney 2f524463d8 avm2: Stub TextBlock.recreateTextLine 2023-11-09 13:38:48 +01:00
Lord-McSweeney 986295394b avm2: TLF improvements (GroupElement support); TextLines' height depends on their content 2023-11-09 13:38:48 +01:00
Lord-McSweeney a8294ff39a avm2: Add some TODO notices 2023-11-09 13:38:48 +01:00
Lord-McSweeney d48d2b7d4e avm2: GroupElement stubs 2023-11-09 13:38:48 +01:00
Lord-McSweeney 597e4e8b9b avm2: Basic TLF rendering support 2023-11-09 13:38:48 +01:00
Nathan Adams 94009e4b1a web: Add credentialAllowList config option 2023-11-09 13:04:12 +01:00
Nathan Adams fa7e7cc8c1 tests: Add tests for NetConnection with Flash Remoting, and fix implementation to match 2023-11-09 12:39:22 +01:00
Nathan Adams e6b5ac9a2b tests: Allow tests to request http://example.org/foo/bar by loading ./example.org/foo/bar 2023-11-09 12:39:22 +01:00
Nathan Adams b06926f04d tests: Print fetched byte response 2023-11-09 12:39:22 +01:00
Nathan Adams e6c46d22f2 avm2: Implement NetConnection.send and NetConnection.addHeader 2023-11-09 12:39:22 +01:00
Nathan Adams 508a4139ad avm2: Implement Responder by making a ResponderObject to hold the callbacks 2023-11-09 12:39:22 +01:00
Nathan Adams 6d901a7463 avm2: Implement many NetConnection properties 2023-11-09 12:39:22 +01:00
Nathan Adams 08c707caa6 avm2: Implement NetConnection.close() 2023-11-09 12:39:22 +01:00
Nathan Adams 641a90b0d4 avm2: Implement connecting a NetConnection to flash remoting url 2023-11-09 12:39:22 +01:00
Nathan Adams c691b32886 core: Introduce a NetConnection struct, backing AVM1/AVM2 NetConnection objects 2023-11-09 12:39:22 +01:00
Kornelius Rohrschneider 514611451f web: Set default Polyfill allowScriptAccess value to samedomain
The default allowScriptAccess value for polyfilled elements has been set
to samedomain. This means that it's true if the SWF file has the same
domain as the player website and false otherwise.
To do this, a new isPolyfillElement parameter is given to the
RufflePlayer::load method.
2023-11-08 17:09:54 +01:00
Kornelius Rohrschneider 1b2baf3364 web: Fix Ruffle extension player not using the configuration for files
The Ruffle extension player has previously not used the extension
configuration settings when loading local SWF files.
This has been fixed.
2023-11-08 17:09:54 +01:00
Kornelius Rohrschneider 8c8367a09c web: Fix Ruffle configuration not working properly for Polyfill elements
Previously, the Ruffle configuration options weren't working properly
for polyfilled elements.

A polyfilled element can have specific configuration options which
overwrite the more general Ruffle configuration settings.
But the code handling those specific configuration options has
previously set some of them to default values if they haven't been
provided, therefore overwriting the more general configuration settings.
This has been fixed. A getPolyfillOptions function has been created and
returns a URLLoadOptions object, containing only the options that have
been set for the respective element. Helper functions have been adapted
to not return any default values anymore.
getPolyfillOptions is now used in all places where polyfilled options
need to be retrieved (therefore reducing duplicated code).

Documentation has been added to clarify that these options must not
contain any default values, since those would overwrite other
configuration settings with a lower priority.
The extension and demo code has been changed to clarify that no default
values are contained in the element configuration options.

The RuffleEmbed::attributeChangedCallback method has previously loaded
an SWF file only with the parameters and base options. This has been
fixed as well since it now also uses getPolyfillOptions.

When using RuffleObject::connectedCallback to load an SWF file, setting
an element config option to "" hasn't worked for most config options
before either. This has been fixed as well by using the new
getPolyfillOptions function.

The default WindowMode value of the default Ruffle web config has been
set to Window (as it is in the desktop version and according to the
documentation). It has previously been set to Opaque (which causes the
same functionality).
2023-11-08 17:09:54 +01:00
Nathan Adams 1ed1dba88e tests: Document log_fetch option 2023-11-08 16:50:24 +01:00
sleepycatcoding f334963b47 avm2: Handle single element XMLLists in XML.insertChildBefore/After 2023-11-07 23:23:53 +01:00
sleepycatcoding cea636da30 avm2: Include CData nodes in XMLList.text output 2023-11-07 23:23:53 +01:00
sleepycatcoding d5df3e27a2 avm2: Fix pretty printing of CData nodes 2023-11-07 23:23:53 +01:00
sleepycatcoding fb34aaea40 avm2: Call toXMLString directly in EscXElem op
The previous method, which used `coerce_to_string`, calls `toString` on the object,
which has special handling for simple content, which is not used here.
2023-11-07 23:23:53 +01:00
Tom Schuster e99eaafcd0 avm2: Fix two bugs in XML/XMLList set_property_local 2023-11-07 18:12:59 +01:00
Nathan Adams bc1121c4ac chore: Add 'content location' as a required field to issue reports 2023-11-07 13:02:36 +01:00