libservo: Merge file selection dialog into EmbedderControls (#39859)

in #39709, we introduced a single “form control” or “embedder control”
delegate that requests the embedder’s input for <select> and
<input type="color"> elements.

this patch partially merges <input type="file"> elements into that
new system, and renames “form controls” to “embedder controls” for
consistency.

internally we continue to use a separate code path where the embedder
directly communicates with the file manager thread. subsequent work will
make the messages asynchronous via the constellation and script thread,
like other embedder controls.

Testing: this is currently tricky to write an automated test for; we
expect to write a WebDriver test for this once we make the communication
asynchronous

---------

Signed-off-by: delan azabani <dazabani@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
shuppy
2025-10-15 14:12:19 +08:00
committed by GitHub
parent 0ffa1c628d
commit 0d57fcb3e6
16 changed files with 220 additions and 156 deletions

View File

@@ -50,7 +50,7 @@ use devtools_traits::{
};
use embedder_traits::user_content_manager::UserContentManager;
use embedder_traits::{
EmbedderControlId, EmbedderMsg, FocusSequenceNumber, FormControlResponse,
EmbedderControlId, EmbedderControlResponse, EmbedderMsg, FocusSequenceNumber,
JavaScriptEvaluationError, JavaScriptEvaluationId, MediaSessionActionType, Theme,
ViewportDetails, WebDriverScriptCommand,
};
@@ -3904,7 +3904,7 @@ impl ScriptThread {
fn handle_embedder_control_response(
&self,
id: EmbedderControlId,
response: FormControlResponse,
response: EmbedderControlResponse,
can_gc: CanGc,
) {
let Some(document) = self.documents.borrow().find_document(id.pipeline_id) else {