Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avm2: Implement tabEnabled, tabIndex, and tabChildren #16050

Merged
merged 15 commits into from
Apr 29, 2024

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Apr 20, 2024

Related to #5443.

This PR:

  • implements InteractiveObject.tabEnabled,
  • implements InteractiveObject.tabIndex,
  • implements DisplayObjectContainer.tabChildren,
  • fixes the focus call handler not being fired for AVM2 buttons,
  • covers the above with tests.

Additionally, some tests were updated with new cases, tab_index was moved to InteractiveObject and made i32. The i32/u32 discrepancy in AVM1's tabIndex is also covered by a test.

cc @adrian17 (regarding the tab_index refactor)

@kjarosh kjarosh force-pushed the tab-ordering-avm2 branch 2 times, most recently from 04e3600 to 891fa8e Compare April 21, 2024 09:13
@kjarosh kjarosh changed the title avm2: Implement tabEnabled and tabIndex for InteractiveObject avm2: Implement tabEnabled, tabIndex, and tabChildren Apr 21, 2024
@kjarosh kjarosh force-pushed the tab-ordering-avm2 branch from 891fa8e to c2d7ae6 Compare April 21, 2024 22:55
@kjarosh kjarosh marked this pull request as ready for review April 21, 2024 23:04
@kjarosh kjarosh force-pushed the tab-ordering-avm2 branch 2 times, most recently from ca71483 to 15ab1fc Compare April 23, 2024 21:44
kjarosh added 15 commits April 29, 2024 21:41
Add a case of a dynamic text field with tab enabled.
Add a case of a non-editable text field.
The i32/u32 discrepancy is only a data presentation issue,
as the value is treated as i32 in every case.
This test verifies the behavior of i32/u32 discrepancy
in tabIndex in AVM1.
The focus handler should also be called for AVM2 buttons when
the focus is being changed.
The field tab_enabled in AVM1 is effectively read-only as
tabEnabled is not a built-in property of objects.
That is not the case in AVM2, where tab_enabled is native.

This patch covers both of these cases by introducing methods:
* tab_enabled,
* set_tab_enabled,
* tab_enabled_avm1,
* tab_enabled_avm2_default.
This is an AVM2 version of avm1/tab_ordering_tabbable
This is an AVM2 version of avm1/tab_ordering_custom_basic
This is an AVM2 version of avm1/tab_ordering_automatic_basic
This test verifies the behavior of tabChildren.
This is an AVM2 version of avm1/tab_ordering_properties
@Dinnerbone Dinnerbone enabled auto-merge (rebase) April 29, 2024 19:53
@Dinnerbone Dinnerbone merged commit 7006b08 into ruffle-rs:master Apr 29, 2024
17 checks passed
@kjarosh kjarosh deleted the tab-ordering-avm2 branch April 29, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants