avm1: Implement FileReferenceList#23889
Merged
SuchAFuriousDeath merged 3 commits intoJun 15, 2026
Merged
Conversation
cb12135 to
d699c0e
Compare
5 tasks
Contributor
|
Presumably supersedes #7637? |
Collaborator
Author
It does indeed. |
d699c0e to
7f4c431
Compare
7f4c431 to
4ae0a28
Compare
moulins
reviewed
Jun 7, 2026
kjarosh
reviewed
Jun 7, 2026
kjarosh
reviewed
Jun 7, 2026
kjarosh
reviewed
Jun 7, 2026
4ae0a28 to
d65b5a2
Compare
d65b5a2 to
a292c11
Compare
b9b6022 to
e25e125
Compare
moulins
approved these changes
Jun 11, 2026
Lord-McSweeney
left a comment
Collaborator
There was a problem hiding this comment.
Could you change core::avm1::globals::file_reference::constructor to use FileReferenceObject::new instead of manually constructing the FileReferenceObject?
e25e125 to
ba97251
Compare
Collaborator
Author
Done 🫡 |
d643388 to
3b023af
Compare
kjarosh
reviewed
Jun 13, 2026
3b023af to
30e110e
Compare
Lord-McSweeney
approved these changes
Jun 15, 2026
30e110e to
056bb00
Compare
Preparation for `FileReferenceList` support. Two pieces of glue around the file dialog that are about to grow a second caller are pulled out: - `parse_file_filters` handles the `FileFilter[]` argument to `FileReference.browse` / `FileReferenceList.browse`. The inline parser in `FileReference.browse` is replaced by it. The helper reads filter fields via `has_own_property` + `Object.get` so that prototype-only fields are ignored and virtual `addProperty` getters are invoked (matching Flash). Invalid filter arrays now bail with `false` from `browse()` consistently, including when the argument is a non-Object value. - `broadcast_avm1_file_event` in `loader.rs` wraps the `as_broadcaster::broadcast_internal` call used to dispatch `onSelect` / `onCancel`. `select_file_dialog_avm1` is updated to use it.
`flash.net.FileReferenceList` now supports `browse(filters)`, which opens a multi-file picker via `UiBackend::display_file_open_dialog_multiple` and populates `fileList` (read-only) with `FileReference` instances on success, then dispatches `onSelect` / `onCancel` through the AsBroadcaster. Selection results are wired through `loader::select_multi_file_dialog_avm1`, which mirrors `select_file_dialog_avm1` and reuses the existing `run_file_dialog` and `broadcast_avm1_file_event` helpers.
Three tests covering `FileReferenceList.browse`: - `browse_cancel` — bare `browse()` hits the test backend's cancel path; assert `onCancel` fires and `fileList` stays `undefined`. - `browse_select` — `debug-select-success` magic filter triggers a 3-file fake selection; assert `onSelect` fires with `fileList` populated. - `browse_invalid_filters` — covers every early-bail path in `parse_file_filters`, plus edge cases for prototype-only filter fields, `addProperty` getters, and `toString` throwing during string coercion of `description` / `extension`.
056bb00 to
42c0a3e
Compare
This was referenced Jun 15, 2026
|
@SuchAFuriousDeath the browse event still not working so I cannot select multiple files for upload. about download, it works but the progress event is not fired so the progressbar never reaches 100% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Significantly progresses #308.
Supersedes #7637.
Testing
Tests are included.
Checklist