libservo: Make FormControl responses completely asynchronous (#39709)

Before responses to `FormControl` requests were handled synchronous in
script (ie they would block the page). This change makes it so that they
are handled asynchronously, with their responses filtering back through
the Constellation. This should fix many WPT tests when run with
WebDriver.

Testing: There are some WebDriver-based test for this, but they do
not quite pass yet. More investigation is required, but this is
necessary to get them to pass.
Fixes: #39652
Fixes: #37013

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
Martin Robinson
2025-10-08 11:06:17 +02:00
committed by GitHub
parent a77d03998c
commit 89dfb3ee49
18 changed files with 330 additions and 136 deletions

View File

@@ -28,8 +28,9 @@ use crossbeam_channel::{RecvTimeoutError, Sender};
use devtools_traits::ScriptToDevtoolsControlMsg;
use embedder_traits::user_content_manager::UserContentManager;
use embedder_traits::{
CompositorHitTestResult, FocusSequenceNumber, InputEvent, JavaScriptEvaluationId,
MediaSessionActionType, ScriptToEmbedderChan, Theme, ViewportDetails, WebDriverScriptCommand,
CompositorHitTestResult, EmbedderControlId, FocusSequenceNumber, FormControlResponse,
InputEvent, JavaScriptEvaluationId, MediaSessionActionType, ScriptToEmbedderChan, Theme,
ViewportDetails, WebDriverScriptCommand,
};
use euclid::{Rect, Scale, Size2D, UnknownUnit};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
@@ -272,6 +273,8 @@ pub enum ScriptThreadMessage {
/// respond when it is ready to take the screenshot or will not be able to take it
/// in the future.
RequestScreenshotReadiness(PipelineId),
/// A response to a request to show an embedder user interface control.
EmbedderControlResponse(EmbedderControlId, FormControlResponse),
}
impl fmt::Debug for ScriptThreadMessage {