Commit Graph

12553 Commits

Author SHA1 Message Date
Kamil Jarosz 5d42a78c47 desktop: Ignore input when the context menu is open
This matches FP's behavior: both keyboard and mouse input should be ignored.
2024-07-14 18:29:57 +02:00
Nathan Adams 10c52ce706 ci: Run browser tests in chrome/firefox/edge on CI 2024-07-14 18:04:14 +02:00
Nathan Adams 35fb095aa2 web: Add --browserstack for testing in the cloud 2024-07-14 18:04:14 +02:00
Nathan Adams e749a6436e web: Remove broken cors test, it hasn't run for years + technically fails if the whole thing is skipped, apparently 2024-07-14 18:04:14 +02:00
Nathan Adams 160460ef51 web: Replace switchToParentFrame with switchToFrame(null) for ios compatibility 2024-07-14 18:04:14 +02:00
Nathan Adams d037e5fa2a web: Add Edge testing, disable autoplay as edge autoplays and that messes up test order of operations slightly 2024-07-14 18:04:14 +02:00
Nathan Adams ed66cf036c web: Add firefox testing, + a fix for ExternalConnection on Firefox when called from the test harness
Turns out that an object isn't 'instanceof Object' in Firefox, if it was made from another window/process/tab/whatever. In this case, that meant that Ruffle always thought it was null because wasm-bindgen relies on 'instanceof Object'
2024-07-14 18:04:14 +02:00
Nathan Adams 504ac87e8d web: Start splitting up wdio config to enable different browsers or environments 2024-07-14 18:04:14 +02:00
Nathan Adams 0eaffcc785 web: Clean up wdio config; remove unused stuff, add typing 2024-07-14 18:04:14 +02:00
Lord-McSweeney ceebf2bf64 avm2: Add `flash.net::NetGroup` class 2024-07-14 17:28:27 +03:00
Adrian Wielgosik 48db0e23c4 core: Fix panic on unsetting self-referential masker 2024-07-12 22:35:07 +02:00
Adrian Wielgosik 261ba7374e avm2: Correct setting builtins' types on classes 2024-07-12 21:56:37 +02:00
Kamil Jarosz 92a16b5095 tests: Remove an obsolete comment from edittext_html_swf8 2024-07-12 16:30:21 +02:00
Kamil Jarosz 6685c987ac web: Do not show context menu when right click event is consumed 2024-07-12 15:41:08 +02:00
Kamil Jarosz 0c9f461227 desktop: Dispatch mouse up event on context menu close 2024-07-12 15:41:08 +02:00
Kamil Jarosz 732a31170e desktop: Do not show context menu when right click event is consumed 2024-07-12 15:41:08 +02:00
Kamil Jarosz 77d89bbf42 tests: Add avm2/mouse_click_events test 2024-07-12 15:41:08 +02:00
Kamil Jarosz cb958fd2c3 tests: Add possibility to assert on whether the event has been handled 2024-07-12 15:41:08 +02:00
Kamil Jarosz bd98f72b96 core: Return from handle_event() whether the event has been handled 2024-07-12 15:41:08 +02:00
Kamil Jarosz 7621553a34 avm2: Properly detect whether the event has been handled in event_dispatch_to_avm2 2024-07-12 15:41:08 +02:00
Kamil Jarosz 250bf64a92 avm2: Return whether the event has been handled from dispatch_event
Before that, dispatch_event returned whether the event has been
canceled, but the value has never been used.
It's possible to check whether the event has been canceled
by invoking is_cancelled() on the event.
2024-07-12 15:41:08 +02:00
Kamil Jarosz 57e90d947b avm2: Fire right & middle click events 2024-07-12 15:41:08 +02:00
Kamil Jarosz c7f1f33843 avm2: Add more specific mouse event constructors 2024-07-12 15:41:08 +02:00
Kamil Jarosz 010310dd1b avm2: Add an option to simulate event dispatch 2024-07-12 15:41:08 +02:00
Kamil Jarosz ebfff6aea1 core: Fire clip events on right & middle clicks 2024-07-12 15:41:08 +02:00
Kamil Jarosz 62254d7532 core: Add clip events related to right and middle clicks 2024-07-12 15:41:08 +02:00
Kamil Jarosz 392101611e core: Add support for pressing multiple mouse buttons 2024-07-12 15:41:08 +02:00
Kamil Jarosz 368a95cf3b core: Add button parameter to is_mouse_down() 2024-07-12 15:41:08 +02:00
Kamil Jarosz 7a52360965 avm2: Parameterize mouse button in mouse_event() 2024-07-12 15:41:08 +02:00
Kamil Jarosz d625c0a779 avm2: Add API versions to MouseEvent constants 2024-07-12 15:41:08 +02:00
Kamil Jarosz 4e3b59b360 tests: Add focus_highlight_empty_clip test 2024-07-12 14:44:49 +02:00
Kamil Jarosz 01ad20f8a3 core: Hide focus highlight on invalid and empty bounds 2024-07-12 14:44:49 +02:00
Kamil Jarosz 5d30c9368e tests: Add focusrect_focuslost test
This test verifies the behavior of the current focus and focusrect
when the player loses focus.
2024-07-12 14:20:35 +02:00
Kamil Jarosz 6a9f88d060 tests: Add FocusLost, FocusGained automated events 2024-07-12 14:20:35 +02:00
Kamil Jarosz 5441749e3e web: Use browser focus events for focus management
This patch changes how the player focus is managed.

Before this patch, `instance.has_focus` was unrelated
to the current focus managed by the browser.
When the user clicked anywhere on the window, it was set to `false`,
and when the user clicked on the player, it was set to `true`.
This had two major issues.
1. When the user clicked on the player, `has_focus` was set to `false`,
   and then again to `true`. That was problematic when listening
   to focus change events.
2. Not using browser's focus makes it harder to integrate with Ruffle,
   i.e. tab out of Ruffle.

This patch uses browser's focus management to detect focus
and listen to focus events:
1. on `focusin` – FocusGained event is fired,
2. on `focusout` – FocusLost event is fired, and
3. on `pointerdown` – focus is manually set to the canvas.
The canvas has `tabindex` set to -1 in order to be focusable.
2024-07-12 14:20:35 +02:00
Kamil Jarosz 599352093c desktop: Pass focus events to the player 2024-07-12 14:20:35 +02:00
Kamil Jarosz 9a88496763 core: Reset focus on player focus loss
FP resets focus when the window (or the element on web) loses its focus.
2024-07-12 14:20:35 +02:00
Kamil Jarosz f71e63379d tests: Add avm2/edittext_html_condensewhite test 2024-07-12 14:01:24 +02:00
Kamil Jarosz 2a667d713d tests: Add avm1/edittext_html_condensewhite_swf7 test 2024-07-12 14:01:24 +02:00
Kamil Jarosz 25caca16f1 tests: Add avm1/edittext_html_condensewhite_swf8 test 2024-07-12 14:01:24 +02:00
Kamil Jarosz 6b0bbb85b1 avm2: Implement TextField.condenseWhite 2024-07-12 14:01:24 +02:00
Kamil Jarosz 12edbc8b75 avm1: Implement TextField.condenseWhite 2024-07-12 14:01:24 +02:00
Kamil Jarosz 83179129e3 core: Implement condensing whitespace in HTML 2024-07-12 14:01:24 +02:00
Kamil Jarosz f54087143f tests: Assert on newlines in HTML tests 2024-07-12 14:01:24 +02:00
Kamil Jarosz 96468a4445 core: Use CR as the newline character in HTML
Tests show that CR is the newline character internally used in FP
both on Linux and on Windows.
2024-07-12 14:01:24 +02:00
TÖRÖK Attila a66ba15051 ci: Get wasm-opt directly from GitHub using sigoden/install-binary@v1
... instead of from conda-forge using miniconda.

And using wget+tar in the extension builder Dockerfile.
2024-07-12 13:40:12 +02:00
riku-42 e93cf15b7c web/extension: Use source-map as webpack devtool for debug builds 2024-07-12 13:22:16 +02:00
Lord-McSweeney d7a46b1eb2 avm2: Add `flash.text.engine::TextLineMirrorRegion` class 2024-07-12 13:10:15 +02:00
Lord-McSweeney af6a66b8cf avm2: Partially implement `flash.trace::Trace` 2024-07-12 13:10:15 +02:00
Aaron Hill c852990346 swf: Remove 'libflate' feature
The 'flate2' crate already supports both C and pure Rust
backends, so we don't gain anything by supporting libflate
2024-07-12 09:09:49 +02:00