From ed54545e3915e2ad842f010d2dae14cd1984aef6 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Sun, 21 Apr 2024 12:49:05 +0200 Subject: [PATCH 1/3] avm2: Implement InteractiveObject.focusRect --- .../flash/display/interactive_object.rs | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/core/src/avm2/globals/flash/display/interactive_object.rs b/core/src/avm2/globals/flash/display/interactive_object.rs index 23cd6740d850..0b00810a8f37 100644 --- a/core/src/avm2/globals/flash/display/interactive_object.rs +++ b/core/src/avm2/globals/flash/display/interactive_object.rs @@ -7,7 +7,6 @@ use crate::avm2::parameters::ParametersExt; use crate::avm2::value::Value; use crate::avm2::Error; use crate::display_object::{TDisplayObject, TInteractiveObject}; -use crate::{avm2_stub_getter, avm2_stub_setter}; /// Implements `flash.display.InteractiveObject`'s native instance constructor. pub fn native_instance_init<'gc>( @@ -179,24 +178,33 @@ pub fn set_tab_index<'gc>( } pub fn get_focus_rect<'gc>( - activation: &mut Activation<'_, 'gc>, - _this: Object<'gc>, + _activation: &mut Activation<'_, 'gc>, + this: Object<'gc>, _args: &[Value<'gc>], ) -> Result, Error<'gc>> { - avm2_stub_getter!(activation, "flash.display.InteractiveObject", "focusRect"); - Ok(Value::Null) + if let Some(obj) = this.as_display_object().and_then(|o| o.as_interactive()) { + Ok(obj.focus_rect().map(Value::Bool).unwrap_or(Value::Null)) + } else { + Ok(Value::Null) + } } pub fn set_focus_rect<'gc>( activation: &mut Activation<'_, 'gc>, - _this: Object<'gc>, + this: Object<'gc>, args: &[Value<'gc>], ) -> Result, Error<'gc>> { - // NOTE: all values other than true or null are converted to false. (false/null do differ) - - // let's only warn on true, as games sometimes just set focusRect to false for some reason. - if matches!(args.get(0), Some(Value::Bool(true))) { - avm2_stub_setter!(activation, "flash.display.InteractiveObject", "focusRect"); + if let Some(obj) = this + .as_display_object() + .and_then(|this| this.as_interactive()) + { + let value = match args.get(0) { + Some(Value::Bool(true)) => Some(true), + Some(Value::Null) => None, + // everything else sets focusRect to false + _ => Some(false), + }; + obj.set_focus_rect(activation.context.gc(), value); } Ok(Value::Null) From 052cd5ca2be1b79753f98fb782eb3d42ccdaebe9 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Sun, 21 Apr 2024 12:49:39 +0200 Subject: [PATCH 2/3] tests: Add avm2/focusrect_property test This test verifies the behavior of InteractiveObject.focusRect property in AVM2. --- .../swfs/avm2/focusrect_property/Test.as | 76 ++++++++++++ .../swfs/avm2/focusrect_property/output.txt | 110 ++++++++++++++++++ .../swfs/avm2/focusrect_property/test.swf | Bin 0 -> 1459 bytes .../swfs/avm2/focusrect_property/test.toml | 1 + 4 files changed, 187 insertions(+) create mode 100644 tests/tests/swfs/avm2/focusrect_property/Test.as create mode 100644 tests/tests/swfs/avm2/focusrect_property/output.txt create mode 100644 tests/tests/swfs/avm2/focusrect_property/test.swf create mode 100644 tests/tests/swfs/avm2/focusrect_property/test.toml diff --git a/tests/tests/swfs/avm2/focusrect_property/Test.as b/tests/tests/swfs/avm2/focusrect_property/Test.as new file mode 100644 index 000000000000..0a4f75814e81 --- /dev/null +++ b/tests/tests/swfs/avm2/focusrect_property/Test.as @@ -0,0 +1,76 @@ +package { + +import flash.display.DisplayObject; +import flash.display.InteractiveObject; +import flash.display.InteractiveObject; +import flash.display.Sprite; +import flash.events.KeyboardEvent; +import flash.text.TextField; +import flash.display.Sprite; +import flash.display.SimpleButton; +import flash.display.MovieClip; +import flash.events.Event; +import flash.events.FocusEvent; + +public class Test extends MovieClip { + public function Test() { + super(); + + var text1:TextField = new TextField(); + var text2:TextField = new TextField(); + text2.type = "input"; + var button:SimpleButton = new SimpleButton(); + var mc1:MovieClip = new MovieClip(); + var mc2:MovieClip = new MovieClip(); + mc2.buttonMode = true; + var sprite:Sprite = new Sprite(); + + trace("===== stage ====="); + this.testProperty(this.stage); + trace("===== text1 ====="); + this.testProperty(text1); + trace("===== text2 ====="); + this.testProperty(text2); + trace("===== button ====="); + this.testProperty(button); + trace("===== mc1 ====="); + this.testProperty(mc1); + trace("===== mc2 ====="); + this.testProperty(mc2); + trace("===== sprite ====="); + this.testProperty(sprite); + } + + function logError(f:*):void { + try { + f(); + } catch (error:Error) { + trace(' Error: ' + error); + } + } + + function testProperty(obj:InteractiveObject):void { + trace(" default value: " + obj.focusRect); + this.testPropertyValue(obj, true); + this.testPropertyValue(obj, false); + this.testPropertyValue(obj, null); + this.testPropertyValue(obj, undefined); + this.testPropertyValue(obj, 0); + this.testPropertyValue(obj, 1); + this.testPropertyValue(obj, -1); + this.testPropertyValue(obj, 0.2); + this.testPropertyValue(obj, 'test'); + this.testPropertyValue(obj, 1.0/0.0); + this.testPropertyValue(obj, 0.0/0.0); + this.testPropertyValue(obj, new Object()); + } + + function testPropertyValue(obj:InteractiveObject, value:*):void { + this.logError(function() { + obj.focusRect = value; + }); + trace(" after set to " + value + ": " + obj.focusRect); + + } +} +} diff --git a/tests/tests/swfs/avm2/focusrect_property/output.txt b/tests/tests/swfs/avm2/focusrect_property/output.txt new file mode 100644 index 000000000000..42f676f24958 --- /dev/null +++ b/tests/tests/swfs/avm2/focusrect_property/output.txt @@ -0,0 +1,110 @@ +===== stage ===== + default value: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to true: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to false: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to null: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to undefined: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to 0: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to 1: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to -1: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to 0.2: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to test: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to Infinity: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to NaN: null + Error: Error: Error #2071: The Stage class does not implement this property or method. + after set to [object Object]: null +===== text1 ===== + default value: null + after set to true: true + after set to false: false + after set to null: null + after set to undefined: null + after set to 0: false + after set to 1: false + after set to -1: false + after set to 0.2: false + after set to test: false + after set to Infinity: false + after set to NaN: false + after set to [object Object]: false +===== text2 ===== + default value: null + after set to true: true + after set to false: false + after set to null: null + after set to undefined: null + after set to 0: false + after set to 1: false + after set to -1: false + after set to 0.2: false + after set to test: false + after set to Infinity: false + after set to NaN: false + after set to [object Object]: false +===== button ===== + default value: null + after set to true: true + after set to false: false + after set to null: null + after set to undefined: null + after set to 0: false + after set to 1: false + after set to -1: false + after set to 0.2: false + after set to test: false + after set to Infinity: false + after set to NaN: false + after set to [object Object]: false +===== mc1 ===== + default value: null + after set to true: true + after set to false: false + after set to null: null + after set to undefined: null + after set to 0: false + after set to 1: false + after set to -1: false + after set to 0.2: false + after set to test: false + after set to Infinity: false + after set to NaN: false + after set to [object Object]: false +===== mc2 ===== + default value: null + after set to true: true + after set to false: false + after set to null: null + after set to undefined: null + after set to 0: false + after set to 1: false + after set to -1: false + after set to 0.2: false + after set to test: false + after set to Infinity: false + after set to NaN: false + after set to [object Object]: false +===== sprite ===== + default value: null + after set to true: true + after set to false: false + after set to null: null + after set to undefined: null + after set to 0: false + after set to 1: false + after set to -1: false + after set to 0.2: false + after set to test: false + after set to Infinity: false + after set to NaN: false + after set to [object Object]: false diff --git a/tests/tests/swfs/avm2/focusrect_property/test.swf b/tests/tests/swfs/avm2/focusrect_property/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..f06302ace8200c585250462938fc83da973c4b2b GIT binary patch literal 1459 zcmV;k1x)%wS5qm;2mkiq?wVT?+#5rojU@pl-ZC8uuYAD7D7{*Kjj^DtYU-lnvbPp9|x z_ELNEDcjjfXBHL~(t0+X&CUU1&OK;SV}Gvcj!zf3L5a9Er_rJfyQwilqiVP5^7Qnn zYrXc~wAFSjZdtFTiA8oule+0lDg#FKTHdss9fKB(R?BMC3}%&<&;xt7LGD_ORyeSJVAqMV!EI&g7&Q`GW=w4{ zt$U7RI}#|DLS?(_tkP8jM&7!G?Mq?q_%cGrea6;$e6I(t|RPUJ^V%+2S-`P&O!GEQ_S zghbzvFpLv#B%VbwQODRcT2@NPr`88Q};Te>sLD{mH{gh6#~=H2-oE4v>K49KLZA zu3K>3UdA^H@VkN&Qb<8q94sOMqfilv821&CjKL2pI8nk#5G561914q`z6PkEhP(g4 ze~W(9(~q%);>TFV1IJhq6318-hmLWVG<=Lh@~9v4?jt{5!Rr_u;y?U>)98&qc$Dlh z1V2#`*F|(FzV(MH(z=8WrJCdqpM|nNQkAC+*&nSa>k2wlYKniUq9zB*DxUE#d!E@< z4ng!OU_%@m^Ew>S02$`U74L{6R{92V>u`>BcoOCO8z7nLn7v%# z-}E|D6?q4@hh NmsL16{{nQChKS?k!e9UZ literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/focusrect_property/test.toml b/tests/tests/swfs/avm2/focusrect_property/test.toml new file mode 100644 index 000000000000..cf6123969a1d --- /dev/null +++ b/tests/tests/swfs/avm2/focusrect_property/test.toml @@ -0,0 +1 @@ +num_ticks = 1 From 8b90db077c64dc33f2b466599f92f63280145f94 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Sun, 21 Apr 2024 14:34:18 +0200 Subject: [PATCH 3/3] tests: Add avm2/focusrect test This test verifies when the highlight is rendered depending on the value of `focusRect` and `stageFocusRect` in AVM2. --- tests/tests/swfs/avm2/focusrect/Test.as | 89 ++++++++++++++++++ tests/tests/swfs/avm2/focusrect/input.json | 34 +++++++ .../avm2/focusrect/output.01a.expected.png | Bin 0 -> 183 bytes .../avm2/focusrect/output.01b.expected.png | Bin 0 -> 189 bytes .../avm2/focusrect/output.02a.expected.png | Bin 0 -> 172 bytes .../avm2/focusrect/output.02b.expected.png | Bin 0 -> 172 bytes .../avm2/focusrect/output.03a.expected.png | Bin 0 -> 172 bytes .../avm2/focusrect/output.03b.expected.png | Bin 0 -> 189 bytes .../avm2/focusrect/output.04a.expected.png | Bin 0 -> 183 bytes .../avm2/focusrect/output.04b.expected.png | Bin 0 -> 172 bytes .../avm2/focusrect/output.05a.expected.png | Bin 0 -> 183 bytes .../avm2/focusrect/output.05b.expected.png | Bin 0 -> 189 bytes .../avm2/focusrect/output.06a.expected.png | Bin 0 -> 172 bytes .../avm2/focusrect/output.06b.expected.png | Bin 0 -> 172 bytes tests/tests/swfs/avm2/focusrect/output.txt | 18 ++++ tests/tests/swfs/avm2/focusrect/test.swf | Bin 0 -> 1630 bytes tests/tests/swfs/avm2/focusrect/test.toml | 17 ++++ 17 files changed, 158 insertions(+) create mode 100644 tests/tests/swfs/avm2/focusrect/Test.as create mode 100644 tests/tests/swfs/avm2/focusrect/input.json create mode 100644 tests/tests/swfs/avm2/focusrect/output.01a.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.01b.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.02a.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.02b.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.03a.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.03b.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.04a.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.04b.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.05a.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.05b.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.06a.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.06b.expected.png create mode 100644 tests/tests/swfs/avm2/focusrect/output.txt create mode 100644 tests/tests/swfs/avm2/focusrect/test.swf create mode 100644 tests/tests/swfs/avm2/focusrect/test.toml diff --git a/tests/tests/swfs/avm2/focusrect/Test.as b/tests/tests/swfs/avm2/focusrect/Test.as new file mode 100644 index 000000000000..d53125b45ca1 --- /dev/null +++ b/tests/tests/swfs/avm2/focusrect/Test.as @@ -0,0 +1,89 @@ +package { + +import flash.display.DisplayObject; +import flash.display.InteractiveObject; +import flash.display.InteractiveObject; +import flash.display.Sprite; +import flash.events.KeyboardEvent; +import flash.text.TextField; +import flash.display.Sprite; +import flash.display.SimpleButton; +import flash.display.MovieClip; +import flash.events.Event; +import flash.events.FocusEvent; + +[SWF(width="50", height="50", backgroundColor="#000000")] +public class Test extends MovieClip { + var clip1:Sprite; + var clip2:Sprite; + var testStage:int = 0; + var logFocus:Boolean = false; + + public function Test() { + super(); + + this.clip1 = new Sprite(); + this.clip1.x = 10; + this.clip1.y = 10; + this.clip1.graphics.beginFill(0xFF66CC); + this.clip1.graphics.drawRect(0, 0, 20, 20); + + this.clip2 = new Sprite(); + this.clip2.x = 20; + this.clip2.y = 20; + this.clip2.graphics.beginFill(0xFF66CC); + this.clip2.graphics.drawRect(0, 0, 20, 20); + + this.clip1.name = "clip1"; + this.clip1.tabEnabled = true; + this.clip1.tabIndex = 1; + this.clip2.name = "clip2"; + this.clip2.tabEnabled = true; + this.clip2.tabIndex = 2; + + this.stage.addChild(this.clip1); + this.stage.addChild(this.clip2); + + var test:Test = this; + this.clip1.addEventListener("focusIn", function (evt:FocusEvent):void { + if (test.logFocus && evt.relatedObject != null && evt.target != null) { + trace("Focus changed: " + evt.relatedObject.name + " -> " + evt.target.name); + } + }); + this.clip2.addEventListener("focusIn", function (evt:FocusEvent):void { + if (test.logFocus && evt.relatedObject != null && evt.target != null) { + trace("Focus changed: " + evt.relatedObject.name + " -> " + evt.target.name); + } + }); + this.stage.addEventListener("keyDown", function(evt:KeyboardEvent) { + if (evt.keyCode == 27) { + test.nextTestStage(); + } + }); + } + + function nextTestStage() { + this.testStage += 1; + trace("Setting test stage to " + this.testStage); + if (testStage == 1) { + this.stage.stageFocusRect = true; + } else if (testStage == 2) { + this.stage.stageFocusRect = false; + } else if (testStage == 3) { + this.stage.stageFocusRect = true; + this.clip1.focusRect = false; + } else if (testStage == 4) { + this.stage.stageFocusRect = false; + this.clip1.focusRect = true; + } else if (testStage == 5) { + this.stage.stageFocusRect = true; + this.clip1.focusRect = null; + } else if (testStage == 6) { + this.stage.stageFocusRect = false; + this.clip1.focusRect = null; + } + this.stage.focus = this.clip2; + this.logFocus = true; + } +} +} diff --git a/tests/tests/swfs/avm2/focusrect/input.json b/tests/tests/swfs/avm2/focusrect/input.json new file mode 100644 index 000000000000..035b21fb7aeb --- /dev/null +++ b/tests/tests/swfs/avm2/focusrect/input.json @@ -0,0 +1,34 @@ +[ + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" }, + { "type": "KeyDown", "key_code": 9 }, + { "type": "Wait" } +] diff --git a/tests/tests/swfs/avm2/focusrect/output.01a.expected.png b/tests/tests/swfs/avm2/focusrect/output.01a.expected.png new file mode 100644 index 0000000000000000000000000000000000000000..75bc8d12d71b27a3ff42994347703a9373629b4b GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nETI!_nJkc@k8Zyw}rP~c&`aLq!< z_@$54Wb20vaUF+P@7qtFFx`yR$<3vgbJGzOMlkp}X=`cX+nRsrt2(Y#rR~4>woF76 zB=OUr&U#5+uCmSfMOz&l9D445+#a#^>+Wk=waMG(-OyqJ10w~=e>WY0(hd&K8t*(_ W&6CZ(mm?bJ5(ZCKKbLh*2~7Yd(Lo{r literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/focusrect/output.01b.expected.png b/tests/tests/swfs/avm2/focusrect/output.01b.expected.png new file mode 100644 index 0000000000000000000000000000000000000000..52f6bc5f9aec4eb40044a753846532f45f01afae GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nET7Ec$)kc@k8Zyw}qFc4rl&>bq2TQ!Bme>v)FU_Zf7{DjTWD!6%m@ZQb2cvz zE|%VX{fWFopzhUO&okCv3*PGB;86GB=h=B1H%s4k0doHFY8w79+QPpts&qq;E=;SP Z_>Xh^rgIlt8w1_L;OXk;vd$@?2>|%9K&t=% literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/focusrect/output.02a.expected.png b/tests/tests/swfs/avm2/focusrect/output.02a.expected.png new file mode 100644 index 0000000000000000000000000000000000000000..c7b4c63f54e0677456ea97a8b82e20c1ef995b83 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nETVow*xkc@k8Z(ihVFyLW5;39K! zrp&3CyMkjCk2VRss}(D&5SXBExtjgC?Y6i%=bySdfI;2sH@k!9 zimVcDxWvQ=0+BD@T;D&5SXBExtjgC?Y6i%=bySdfI;2sH@k!9 zimVcDxWvQ=0+BD@T;D&5SXBExtjgC?Y6i%=bySdfI;2sH@k!9 zimVcDxWvQ=0+BD@T;bq2TQ!Bme>v)FU_Zf7{DjTWD!6%m@ZQb2cvz zE|%VX{fWFopzhUO&okCv3*PGB;86GB=h=B1H%s4k0doHFY8w79+QPpts&qq;E=;SP Z_>Xh^rgIlt8w1_L;OXk;vd$@?2>|%9K&t=% literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/focusrect/output.04a.expected.png b/tests/tests/swfs/avm2/focusrect/output.04a.expected.png new file mode 100644 index 0000000000000000000000000000000000000000..75bc8d12d71b27a3ff42994347703a9373629b4b GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nETI!_nJkc@k8Zyw}rP~c&`aLq!< z_@$54Wb20vaUF+P@7qtFFx`yR$<3vgbJGzOMlkp}X=`cX+nRsrt2(Y#rR~4>woF76 zB=OUr&U#5+uCmSfMOz&l9D445+#a#^>+Wk=waMG(-OyqJ10w~=e>WY0(hd&K8t*(_ W&6CZ(mm?bJ5(ZCKKbLh*2~7Yd(Lo{r literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/focusrect/output.04b.expected.png b/tests/tests/swfs/avm2/focusrect/output.04b.expected.png new file mode 100644 index 0000000000000000000000000000000000000000..c7b4c63f54e0677456ea97a8b82e20c1ef995b83 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nETVow*xkc@k8Z(ihVFyLW5;39K! zrp&3CyMkjCk2VRss}(D&5SXBExtjgC?Y6i%=bySdfI;2sH@k!9 zimVcDxWvQ=0+BD@T;woF76 zB=OUr&U#5+uCmSfMOz&l9D445+#a#^>+Wk=waMG(-OyqJ10w~=e>WY0(hd&K8t*(_ W&6CZ(mm?bJ5(ZCKKbLh*2~7Yd(Lo{r literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/focusrect/output.05b.expected.png b/tests/tests/swfs/avm2/focusrect/output.05b.expected.png new file mode 100644 index 0000000000000000000000000000000000000000..52f6bc5f9aec4eb40044a753846532f45f01afae GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nET7Ec$)kc@k8Zyw}qFc4rl&>bq2TQ!Bme>v)FU_Zf7{DjTWD!6%m@ZQb2cvz zE|%VX{fWFopzhUO&okCv3*PGB;86GB=h=B1H%s4k0doHFY8w79+QPpts&qq;E=;SP Z_>Xh^rgIlt8w1_L;OXk;vd$@?2>|%9K&t=% literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/focusrect/output.06a.expected.png b/tests/tests/swfs/avm2/focusrect/output.06a.expected.png new file mode 100644 index 0000000000000000000000000000000000000000..c7b4c63f54e0677456ea97a8b82e20c1ef995b83 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2nETVow*xkc@k8Z(ihVFyLW5;39K! zrp&3CyMkjCk2VRss}(D&5SXBExtjgC?Y6i%=bySdfI;2sH@k!9 zimVcDxWvQ=0+BD@T;D&5SXBExtjgC?Y6i%=bySdfI;2sH@k!9 zimVcDxWvQ=0+BD@T; clip1 +Focus changed: clip1 -> clip2 +Setting test stage to 2 +Focus changed: clip2 -> clip1 +Focus changed: clip1 -> clip2 +Setting test stage to 3 +Focus changed: clip2 -> clip1 +Focus changed: clip1 -> clip2 +Setting test stage to 4 +Focus changed: clip2 -> clip1 +Focus changed: clip1 -> clip2 +Setting test stage to 5 +Focus changed: clip2 -> clip1 +Focus changed: clip1 -> clip2 +Setting test stage to 6 +Focus changed: clip2 -> clip1 +Focus changed: clip1 -> clip2 diff --git a/tests/tests/swfs/avm2/focusrect/test.swf b/tests/tests/swfs/avm2/focusrect/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..f2f38efbe56a422d5a9b0bd2d213497d49652a2d GIT binary patch literal 1630 zcmV-k2BG;wS5qkv3IG6j0gY8(ZyU!E-@PTd{3HI6Oi>mkTPKSaBUdC(6lq(uEK3$m zN466uW>TjG2w}Ejv~f0J&W%h^jW9J)rQ5-)q|^W={)ujzWP<3dy^^+h$u1{E%TBQ zANq;7{%PAX2R-h-e^1jfydiVph0dw1%S>h9m7@sjxSV;;j|RPW6CoC}yQi$n_qcuh zWm9rqnq&pc6UDk}d23TGYvsx~Ut!%XiLL*j6%z||cMl~}r;DGyEPQs*Y`%W^s*XlU z7=fv)p8AgLqC*9Yzl;)CLvRODZ~nRsV}j7{|NJfb2Bg14zu*H8{VDwiijY90nnFcH z{`U9(fDJtlNE6{_Uc3aYeDFZ%MK%a{@C;i{x8Zb72XU8MkhcD^{VU$_LLPIw+zWax z>+qy>P&+-?46fJIfXz;LKrQU4^5sC4+perm8pw2~&5Ir9q;$~SE|oRyZmE50TApby z$ayL1=Adt}i`pm7naK|=v!9-}H~X&X@!YhrJ`Nfucj&;pn>Ke>rk###k3+tmdB(?% zOVjui$?_QEXJX`QPsBsu%!9dg180t@&wS_+m3tuF=o@}<=;%Cd^K(z^Wz&NRi9hET zZHKwK^a%-jP795TiBIJb>_E|5_#9t^yDsbZ%+4Uv=3Ucnn3fgRT{e6L9gtq-sK?q* zY}U589tQEq*7C9Da}cysj?T2kGsyX=N#+YFl|$u5yw4l^-13u zkjj0HRJAfOZI4vT75dn5EY56Ft!@R%+Rjeoat1=-A4o|kO1&YP|)&WA(Ca$LHm$!qz20UbCReo#eq=RT=a?xliwLCGk= zcsOw#XK^-}O=V}ZbJ=UzbS9Izp~SI50>KasN20Nrc%CXjs)Q(^l!PgXP!fy8FeURe zu|Uansw~n(mJ&>p%T&2Z$qFSZC99O&qGXLKIZAF*vQ9~!l8-34LzMz0B}z0(wkWwr z$qr5KQu2@{_Gt1EP43g=0et8R!r_SWHJPkv24sXb;Q%SaDWIV6Hm+3Rz6H36vP2IZ$da; z$B01X6k!~Rl9Bcl%tVRBUVM)U(*70jw_4c1hH`f2Y%Yw@#yf+kfBfy077*GT`~&*s zR&X;4un~H@IrH|N5isc6Mi6iK72s4ZIjg{V_os5+`+uA}z)2Lyb4BD?1I`EUjA(8t z9feGG1$`riHvBzs3j~!|{C5htWJcQSJO9wW$4e-~vHErV1p5o4BjhiRT8U=~)Jyu= zk&(8q7@Jr{?jdWncUzx}{aiyvaiTItc457}2P4gYJQ^8G zIsBF_`G?SgB531Y)}=i?1H1eLnAX{H>Kl+7!mLR1Q!wYjd=BQ1g_)$&ARdjq{b!I} zp4~|O0&LF(9FXvfag_fF!0Q0l0RB|KK?%Q{M1Kab3h)xZp9?sYPJ#Gp65Slb{+FOb z+3cqO^U*p}{MRrBAq6J<(MXJRilf#o+wT)X_2-iPnn+a literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/focusrect/test.toml b/tests/tests/swfs/avm2/focusrect/test.toml new file mode 100644 index 000000000000..b9a2dbced1e6 --- /dev/null +++ b/tests/tests/swfs/avm2/focusrect/test.toml @@ -0,0 +1,17 @@ +num_ticks = 12 + +image_comparisons."output.01a".trigger = 1 +image_comparisons."output.01b".trigger = 2 +image_comparisons."output.02a".trigger = 3 +image_comparisons."output.02b".trigger = 4 +image_comparisons."output.03a".trigger = 5 +image_comparisons."output.03b".trigger = 6 +image_comparisons."output.04a".trigger = 7 +image_comparisons."output.04b".trigger = 8 +image_comparisons."output.05a".trigger = 9 +image_comparisons."output.05b".trigger = 10 +image_comparisons."output.06a".trigger = 11 +image_comparisons."output.06b".trigger = 12 + +[player_options] +with_renderer = { optional = false, sample_count = 1 }