ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.36k stars 792 forks source link

Weird rendering and malfunction with Spark DropDownList #16802

Open falpi opened 2 months ago

falpi commented 2 months ago

Describe the bug

The rendering of the s:DropDownList component does not work correctly and the first attempt to open the dropdownlist generates a javascript exception and the application freezes. The error is as follows:

ERROR core\src\avm2\events.rs:428 Error dispatching event EventObject(EventObject { type: "enterFrame", class: flash.events::Event, ptr: 0x21b25f8 }) to handler FunctionObject(FunctionObject { ptr: 0x9a0888, name: Ok("mx.managers::LayoutManager/doPhasedInstantiationCallback()") }) : TypeError: Error #2007: Parameter value must be non-null.

Expected behavior

Correct component rendering

Content Location

The error can be reproduced by the following Adobe Flex application:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" 
               xmlns:com="com.google.code.flexiframe.*" >

    <s:DropDownList top="100" left="100" width="200"  requireSelection="true" labelField="@label">
        <s:dataProvider>
            <s:XMLListCollection>
                <fx:XMLList>
                    <Item id="0"   label="zero" />
                    <Item id="1"   label="one" />
                    <Item id="3"   label="two" />
                    <Item id="7"   label="three" />
                    <Item id="30"  label="four" />
                </fx:XMLList>
            </s:XMLListCollection>
        </s:dataProvider>
    </s:DropDownList>

</s:Application>

A binary version is attached in a zip file: application.zip

Affected platform

Self-hosted version

Operating system

Windows 10

Browser

Firefox 126.0.1

Additional information

No response

Lord-McSweeney commented 2 months ago

This needs Transform.concatenatedColorTransform to fix the exception, and proper TLF rendering to fix the vertically offset text.