diff --git a/tests/tests/swfs/avm2/focus_events_mouse_focusable/ButtonDisplayState.as b/tests/tests/swfs/avm2/focus_events_mouse_focusable/ButtonDisplayState.as new file mode 100644 index 0000000000000..1790890ee074a --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mouse_focusable/ButtonDisplayState.as @@ -0,0 +1,20 @@ +package { +import flash.display.Shape; + +internal class ButtonDisplayState extends Shape { + private var bgColor:uint; + private var size:uint; + + public function ButtonDisplayState(bgColor:uint, size:uint) { + this.bgColor = bgColor; + this.size = size; + draw(); + } + + private function draw():void { + graphics.beginFill(bgColor); + graphics.drawRect(0, 0, size, size); + graphics.endFill(); + } +} +} diff --git a/tests/tests/swfs/avm2/focus_events_mouse_focusable/Test.as b/tests/tests/swfs/avm2/focus_events_mouse_focusable/Test.as new file mode 100644 index 0000000000000..c1cbb17332b1e --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mouse_focusable/Test.as @@ -0,0 +1,177 @@ +package { + +import flash.display.DisplayObject; +import flash.display.InteractiveObject; +import flash.display.MovieClip; +import flash.display.SimpleButton; +import flash.display.Sprite; +import flash.events.Event; +import flash.events.FocusEvent; +import flash.events.MouseEvent; +import flash.text.TextField; + +[SWF(width="1000", height="500")] +public class Test extends MovieClip { + private var currentColor:int = 0; + private var colors:Array = [ + 0xFF0000, + 0x00FF00, + 0x0000FF, + 0x00FFFF, + 0xFF00FF, + 0xFFFF00 + ]; + + private var objectId:int = 0; + private var objects:Array = []; + + public function Test() { + super(); + + objects.push(newSprite(false, false, false)); // 0 + objects.push(newSprite(false, true, false)); + objects.push(newSprite(false, false, true)); + objects.push(newSprite(false, true, true)); + objects.push(newSprite(true, false, false)); + objects.push(newSprite(true, true, false)); + objects.push(newSprite(true, false, true)); + objects.push(newSprite(true, true, true)); + objects.push(newTextField(false, false, false)); + objects.push(newTextField(false, false, true)); + objects.push(newTextField(false, true, false)); // 10 + objects.push(newTextField(false, true, true)); + objects.push(newTextField(true, false, false)); + objects.push(newTextField(true, false, true)); + objects.push(newTextField(true, true, false)); + objects.push(newTextField(true, true, true)); + objects.push(newButton(false, false, false)); + objects.push(newButton(false, true, false)); + objects.push(newButton(false, false, true)); + objects.push(newButton(false, true, true)); + objects.push(newButton(true, false, false)); // 20 + objects.push(newButton(true, true, false)); + objects.push(newButton(true, false, true)); + objects.push(newButton(true, true, true)); + objects.push(newMovieClip(false, false, false, false)); + objects.push(newMovieClip(false, false, false, true)); + objects.push(newMovieClip(false, false, true, false)); + objects.push(newMovieClip(false, false, true, true)); + objects.push(newMovieClip(false, true, false, false)); + objects.push(newMovieClip(false, true, false, true)); + objects.push(newMovieClip(false, true, true, false)); // 30 + objects.push(newMovieClip(false, true, true, true)); + objects.push(newMovieClip(true, false, false, false)); + objects.push(newMovieClip(true, false, false, true)); + objects.push(newMovieClip(true, false, true, false)); + objects.push(newMovieClip(true, false, true, true)); + objects.push(newMovieClip(true, true, false, false)); + objects.push(newMovieClip(true, true, false, true)); + objects.push(newMovieClip(true, true, true, false)); + objects.push(newMovieClip(true, true, true, true)); + + var x = 0; + var y = 100; + for each (var object:InteractiveObject in objects) { + object.x = x; + object.y = y; + + x += 100; + if (x >= 1000) { + x = 0; + y += 100; + } + + addChild(object); + } + + function eventListener(obj:InteractiveObject):Function { + return function (evt:Event):void { + var str; + if (evt is MouseEvent) { + str = evt.formatToString( + "MouseEvent", "type", "cancelable", "eventPhase", + "relatedObject", "ctrlKey", "altKey", "shiftKey"); + } else { + str = evt.toString(); + } + if (evt is FocusEvent && FocusEvent(evt).relatedObject) { + str += ", relatedObjectName=" + FocusEvent(evt).relatedObject.name; + } + trace(obj.name + ", " + evt.target.name + ": " + str + ", focus: " + objectToString(stage.focus)); + } + } + + for each (var obj:InteractiveObject in objects) { + obj.addEventListener("focusIn", eventListener(obj)); + obj.addEventListener("focusOut", eventListener(obj)); + obj.addEventListener("mouseFocusChange", eventListener(obj)); + obj.addEventListener("keyFocusChange", eventListener(obj)); + obj.addEventListener("click", eventListener(obj)); + } + } + + private function objectToString(obj: DisplayObject): String { + return "" + obj + ((obj != null) ? " (" + obj.name + ")" : ""); + } + + private function newSprite(tabEnabled:Boolean, buttonMode:Boolean, handCursor:Boolean):Sprite { + var s:Sprite = new Sprite(); + var color:int = nextColor(); + s.graphics.beginFill(color); + s.graphics.drawRect(0, 0, 100, 100); + s.graphics.endFill(); + s.buttonMode = buttonMode; + s.useHandCursor = handCursor; + s.tabEnabled = tabEnabled; + s.name = "sprite" + (objectId++); + return s; + } + + private function newMovieClip(tabEnabled:Boolean, enabled:Boolean, buttonMode:Boolean, handCursor:Boolean):MovieClip { + var mc:MovieClip = new MovieClip(); + var color:int = nextColor(); + mc.enabled = enabled; + mc.buttonMode = buttonMode; + mc.useHandCursor = handCursor; + mc.graphics.beginFill(color); + mc.graphics.drawRect(0, 0, 100, 100); + mc.graphics.endFill(); + mc.tabEnabled = tabEnabled; + mc.name = "clip" + (objectId++); + return mc; + } + + private function newTextField(tabEnabled:Boolean, input:Boolean, selectable:Boolean):TextField { + var tf:TextField = new TextField(); + tf.type = input ? "input" : "dynamic"; + tf.border = true; + tf.width = 100; + tf.height = 100; + tf.selectable = selectable; + var color:int = nextColor(); + tf.borderColor = color; + tf.tabEnabled = tabEnabled; + tf.name = "text" + (objectId++); + return tf; + } + + private function newButton(tabEnabled:Boolean, enabled:Boolean, handCursor:Boolean):SimpleButton { + var b:SimpleButton = new SimpleButton(); + var color:int = nextColor(); + var state:ButtonDisplayState = new ButtonDisplayState(color, 100); + b.downState = state; + b.overState = state; + b.upState = state; + b.hitTestState = state; + b.enabled = enabled; + b.useHandCursor = handCursor; + b.tabEnabled = tabEnabled; + b.name = "button" + (objectId++); + return b; + } + + private function nextColor():int { + return colors[currentColor++ % 6]; + } +} +} diff --git a/tests/tests/swfs/avm2/focus_events_mouse_focusable/input.json b/tests/tests/swfs/avm2/focus_events_mouse_focusable/input.json new file mode 100644 index 0000000000000..0068b54103965 --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mouse_focusable/input.json @@ -0,0 +1,126 @@ +[ + { "type": "MouseMove", "pos": [10, 110] }, + { "type": "MouseDown", "pos": [10, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [10, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [110, 110] }, + { "type": "MouseDown", "pos": [110, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [110, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [210, 110] }, + { "type": "MouseDown", "pos": [210, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [210, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [310, 110] }, + { "type": "MouseDown", "pos": [310, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [310, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [410, 110] }, + { "type": "MouseDown", "pos": [410, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [410, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [510, 110] }, + { "type": "MouseDown", "pos": [510, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [510, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [610, 110] }, + { "type": "MouseDown", "pos": [610, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [610, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [710, 110] }, + { "type": "MouseDown", "pos": [710, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [710, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [810, 110] }, + { "type": "MouseDown", "pos": [810, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [810, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [910, 110] }, + { "type": "MouseDown", "pos": [910, 110], "btn": "Left" }, + { "type": "MouseUp", "pos": [910, 110], "btn": "Left" }, + { "type": "MouseMove", "pos": [10, 210] }, + { "type": "MouseDown", "pos": [10, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [10, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [110, 210] }, + { "type": "MouseDown", "pos": [110, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [110, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [210, 210] }, + { "type": "MouseDown", "pos": [210, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [210, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [310, 210] }, + { "type": "MouseDown", "pos": [310, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [310, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [410, 210] }, + { "type": "MouseDown", "pos": [410, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [410, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [510, 210] }, + { "type": "MouseDown", "pos": [510, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [510, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [610, 210] }, + { "type": "MouseDown", "pos": [610, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [610, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [710, 210] }, + { "type": "MouseDown", "pos": [710, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [710, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [810, 210] }, + { "type": "MouseDown", "pos": [810, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [810, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [910, 210] }, + { "type": "MouseDown", "pos": [910, 210], "btn": "Left" }, + { "type": "MouseUp", "pos": [910, 210], "btn": "Left" }, + { "type": "MouseMove", "pos": [10, 310] }, + { "type": "MouseDown", "pos": [10, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [10, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [110, 310] }, + { "type": "MouseDown", "pos": [110, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [110, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [210, 310] }, + { "type": "MouseDown", "pos": [210, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [210, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [310, 310] }, + { "type": "MouseDown", "pos": [310, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [310, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [410, 310] }, + { "type": "MouseDown", "pos": [410, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [410, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [510, 310] }, + { "type": "MouseDown", "pos": [510, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [510, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [610, 310] }, + { "type": "MouseDown", "pos": [610, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [610, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [710, 310] }, + { "type": "MouseDown", "pos": [710, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [710, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [810, 310] }, + { "type": "MouseDown", "pos": [810, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [810, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [910, 310] }, + { "type": "MouseDown", "pos": [910, 310], "btn": "Left" }, + { "type": "MouseUp", "pos": [910, 310], "btn": "Left" }, + { "type": "MouseMove", "pos": [10, 410] }, + { "type": "MouseDown", "pos": [10, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [10, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [110, 410] }, + { "type": "MouseDown", "pos": [110, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [110, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [210, 410] }, + { "type": "MouseDown", "pos": [210, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [210, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [310, 410] }, + { "type": "MouseDown", "pos": [310, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [310, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [410, 410] }, + { "type": "MouseDown", "pos": [410, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [410, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [510, 410] }, + { "type": "MouseDown", "pos": [510, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [510, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [610, 410] }, + { "type": "MouseDown", "pos": [610, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [610, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [710, 410] }, + { "type": "MouseDown", "pos": [710, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [710, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [810, 410] }, + { "type": "MouseDown", "pos": [810, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [810, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [910, 410] }, + { "type": "MouseDown", "pos": [910, 410], "btn": "Left" }, + { "type": "MouseUp", "pos": [910, 410], "btn": "Left" }, + { "type": "MouseMove", "pos": [10, 10] }, + { "type": "MouseDown", "pos": [10, 10], "btn": "Left" }, + { "type": "MouseUp", "pos": [10, 10], "btn": "Left" }, + { "type": "Wait" } +] diff --git a/tests/tests/swfs/avm2/focus_events_mouse_focusable/input.json.py b/tests/tests/swfs/avm2/focus_events_mouse_focusable/input.json.py new file mode 100755 index 0000000000000..fb4f6cde61e01 --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mouse_focusable/input.json.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +print('[') + +for i in range(40): + x = i * 100 + y = 100 + while x >= 1000: + x -= 1000 + y += 100 + pos = [x + 10, y + 10] + print(f' {{ "type": "MouseMove", "pos": {pos} }},') + print(f' {{ "type": "MouseDown", "pos": {pos}, "btn": "Left" }},') + print(f' {{ "type": "MouseUp", "pos": {pos}, "btn": "Left" }},') + +pos = [10, 10] +print(f' {{ "type": "MouseMove", "pos": {pos} }},') +print(f' {{ "type": "MouseDown", "pos": {pos}, "btn": "Left" }},') +print(f' {{ "type": "MouseUp", "pos": {pos}, "btn": "Left" }},') + +print(f' {{ "type": "Wait" }}') +print(']') diff --git a/tests/tests/swfs/avm2/focus_events_mouse_focusable/output.txt b/tests/tests/swfs/avm2/focus_events_mouse_focusable/output.txt new file mode 100644 index 0000000000000..44b23c4d1e09f --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mouse_focusable/output.txt @@ -0,0 +1,112 @@ +sprite0, sprite0: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +sprite1, sprite1: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +sprite2, sprite2: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +sprite3, sprite3: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +sprite4, sprite4: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: [object Sprite] (sprite4) +sprite4, sprite4: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite4) +sprite4, sprite4: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite5, focus: [object Sprite] (sprite4) +sprite4, sprite4: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite5, focus: [object Sprite] (sprite5) +sprite5, sprite5: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite4, focus: [object Sprite] (sprite5) +sprite5, sprite5: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite5) +sprite5, sprite5: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite6, focus: [object Sprite] (sprite5) +sprite5, sprite5: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite6, focus: [object Sprite] (sprite6) +sprite6, sprite6: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite5, focus: [object Sprite] (sprite6) +sprite6, sprite6: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite6) +sprite6, sprite6: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite7, focus: [object Sprite] (sprite6) +sprite6, sprite6: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite7, focus: [object Sprite] (sprite7) +sprite7, sprite7: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite6, focus: [object Sprite] (sprite7) +sprite7, sprite7: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object Sprite] (sprite7) +sprite7, sprite7: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text8, focus: [object Sprite] (sprite7) +sprite7, sprite7: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text8, focus: [object TextField] (text8) +text8, text8: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object Sprite] shiftKey=false keyCode=0], relatedObjectName=sprite7, focus: [object TextField] (text8) +text8, text8: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object TextField] (text8) +text8, text8: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text9, focus: [object TextField] (text8) +text8, text8: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text9, focus: [object TextField] (text9) +text9, text9: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text8, focus: [object TextField] (text9) +text9, text9: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object TextField] (text9) +text9, text9: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text10, focus: [object TextField] (text9) +text9, text9: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text10, focus: [object TextField] (text10) +text10, text10: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text9, focus: [object TextField] (text10) +text10, text10: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object TextField] (text10) +text10, text10: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text11, focus: [object TextField] (text10) +text10, text10: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text11, focus: [object TextField] (text11) +text11, text11: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text10, focus: [object TextField] (text11) +text11, text11: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object TextField] (text11) +text11, text11: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text12, focus: [object TextField] (text11) +text11, text11: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text12, focus: [object TextField] (text12) +text12, text12: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text11, focus: [object TextField] (text12) +text12, text12: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object TextField] (text12) +text12, text12: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text13, focus: [object TextField] (text12) +text12, text12: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text13, focus: [object TextField] (text13) +text13, text13: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text12, focus: [object TextField] (text13) +text13, text13: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object TextField] (text13) +text13, text13: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text14, focus: [object TextField] (text13) +text13, text13: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text14, focus: [object TextField] (text14) +text14, text14: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text13, focus: [object TextField] (text14) +text14, text14: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object TextField] (text14) +text14, text14: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text15, focus: [object TextField] (text14) +text14, text14: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text15, focus: [object TextField] (text15) +text15, text15: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object TextField] shiftKey=false keyCode=0], relatedObjectName=text14, focus: [object TextField] (text15) +text15, text15: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object TextField] (text15) +text15, text15: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button16, focus: [object TextField] (text15) +text15, text15: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: null +button16, button16: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +button17, button17: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +button18, button18: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +button19, button19: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +button20, button20: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: [object SimpleButton] (button20) +button20, button20: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object SimpleButton] (button20) +button20, button20: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button21, focus: [object SimpleButton] (button20) +button20, button20: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button21, focus: [object SimpleButton] (button21) +button21, button21: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button20, focus: [object SimpleButton] (button21) +button21, button21: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object SimpleButton] (button21) +button21, button21: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button22, focus: [object SimpleButton] (button21) +button21, button21: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button22, focus: [object SimpleButton] (button22) +button22, button22: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button21, focus: [object SimpleButton] (button22) +button22, button22: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object SimpleButton] (button22) +button22, button22: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button23, focus: [object SimpleButton] (button22) +button22, button22: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button23, focus: [object SimpleButton] (button23) +button23, button23: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object SimpleButton] shiftKey=false keyCode=0], relatedObjectName=button22, focus: [object SimpleButton] (button23) +button23, button23: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object SimpleButton] (button23) +button23, button23: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip24, focus: [object SimpleButton] (button23) +button23, button23: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: null +clip24, clip24: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +clip25, clip25: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +clip26, clip26: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +clip27, clip27: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +clip28, clip28: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +clip29, clip29: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +clip30, clip30: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +clip31, clip31: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: null +clip32, clip32: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: [object MovieClip] (clip32) +clip32, clip32: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object MovieClip] (clip32) +clip32, clip32: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip33, focus: [object MovieClip] (clip32) +clip32, clip32: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip33, focus: [object MovieClip] (clip33) +clip33, clip33: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip32, focus: [object MovieClip] (clip33) +clip33, clip33: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object MovieClip] (clip33) +clip33, clip33: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip34, focus: [object MovieClip] (clip33) +clip33, clip33: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip34, focus: [object MovieClip] (clip34) +clip34, clip34: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip33, focus: [object MovieClip] (clip34) +clip34, clip34: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object MovieClip] (clip34) +clip34, clip34: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip35, focus: [object MovieClip] (clip34) +clip34, clip34: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip35, focus: [object MovieClip] (clip35) +clip35, clip35: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip34, focus: [object MovieClip] (clip35) +clip35, clip35: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object MovieClip] (clip35) +clip35, clip35: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip36, focus: [object MovieClip] (clip35) +clip35, clip35: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip36, focus: [object MovieClip] (clip36) +clip36, clip36: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip35, focus: [object MovieClip] (clip36) +clip36, clip36: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object MovieClip] (clip36) +clip36, clip36: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip37, focus: [object MovieClip] (clip36) +clip36, clip36: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip37, focus: [object MovieClip] (clip37) +clip37, clip37: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip36, focus: [object MovieClip] (clip37) +clip37, clip37: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object MovieClip] (clip37) +clip37, clip37: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip38, focus: [object MovieClip] (clip37) +clip37, clip37: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip38, focus: [object MovieClip] (clip38) +clip38, clip38: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip37, focus: [object MovieClip] (clip38) +clip38, clip38: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object MovieClip] (clip38) +clip38, clip38: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip39, focus: [object MovieClip] (clip38) +clip38, clip38: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip39, focus: [object MovieClip] (clip39) +clip39, clip39: [FocusEvent type="focusIn" bubbles=true cancelable=false eventPhase=2 relatedObject=[object MovieClip] shiftKey=false keyCode=0], relatedObjectName=clip38, focus: [object MovieClip] (clip39) +clip39, clip39: [MouseEvent type="click" cancelable=false eventPhase=2 relatedObject=null ctrlKey=false altKey=false shiftKey=false], focus: [object MovieClip] (clip39) +clip39, clip39: [FocusEvent type="mouseFocusChange" bubbles=true cancelable=true eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: [object MovieClip] (clip39) +clip39, clip39: [FocusEvent type="focusOut" bubbles=true cancelable=false eventPhase=2 relatedObject=null shiftKey=false keyCode=0], focus: null diff --git a/tests/tests/swfs/avm2/focus_events_mouse_focusable/test.swf b/tests/tests/swfs/avm2/focus_events_mouse_focusable/test.swf new file mode 100644 index 0000000000000..5ec31dd2c70b0 Binary files /dev/null and b/tests/tests/swfs/avm2/focus_events_mouse_focusable/test.swf differ diff --git a/tests/tests/swfs/avm2/focus_events_mouse_focusable/test.toml b/tests/tests/swfs/avm2/focus_events_mouse_focusable/test.toml new file mode 100644 index 0000000000000..cf6123969a1d6 --- /dev/null +++ b/tests/tests/swfs/avm2/focus_events_mouse_focusable/test.toml @@ -0,0 +1 @@ +num_ticks = 1