Skip to content

Truly independent web browser

Meta: Support FormData in the Rust bindings

Shannon Boothd00a6a3a574b
diff --git a/Meta/Generators/libweb_bindings/rust_bindings.py b/Meta/Generators/libweb_bindings/rust_bindings.py
index 7aa9f944af1..c3a1cf58d90 100644
--- a/Meta/Generators/libweb_bindings/rust_bindings.py
+++ b/Meta/Generators/libweb_bindings/rust_bindings.py
@@ -52,7 +52,6 @@ from Generators.libweb_bindings.rust_types import CPP_PARENT_INTERFACES
from Generators.libweb_bindings.rust_types import UnsupportedByRustBindings
from Generators.libweb_bindings.rust_types import cpp_ancestor
from Generators.libweb_bindings.rust_types import cpp_interface_name_constant
-from Generators.libweb_bindings.rust_types import holds_cells
from Generators.libweb_bindings.rust_types import inheriting_interfaces
from Generators.libweb_bindings.rust_types import is_implemented_in_rust
from Generators.libweb_bindings.rust_types import is_promise_type
@@ -644,12 +643,7 @@ def pair_iterator_types(
context: GenerationContext, interface: Interface, pair_iterator: RustPairIterator
) -> Tuple[str, str]:
what = f"the pair iterator of {interface.name}"
- for idl_type in (pair_iterator.key_type, pair_iterator.value_type):
- if holds_cells(idl_type, context):
- raise UnsupportedByRustBindings(
- f"{interface.path}: {what} iterates over {idl_type}, a type whose values are or can hold cells, which "
- "the Rust bindings do not handle yet"
- )
+ # NB: The iteration steps convert a copy of a pair, which is on the stack where the collector finds its cells.
return (
rust_type(pair_iterator.key_type, context, what, is_result=True),
rust_type(pair_iterator.value_type, context, what, is_result=True),
diff --git a/Meta/Generators/libweb_bindings/rust_to_idl_value.py b/Meta/Generators/libweb_bindings/rust_to_idl_value.py
index 71dfb3a6b92..09fa9832a4d 100644
--- a/Meta/Generators/libweb_bindings/rust_to_idl_value.py
+++ b/Meta/Generators/libweb_bindings/rust_to_idl_value.py
@@ -300,6 +300,8 @@ def rust_default_value(
"""An expression of the default value of the parameter or of the dictionary member."""
name = member.type.name
default_value = member.default_value
+ if member.type.nullable and default_value == "null":
+ return "None"
string_literal = rust_string_literal(default_value, name, what)
if string_literal is not None:
return string_literal