mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibWeb: Honor LegacyNullToEmptyString in union string conversion
The IDL generator was passing 'false' to generate_to_cpp when converting a union containing a string type. This broke WebIDL's LegacyNullToEmptyString behavior. Pass the actual legacy_null_to_empty_string flag instead. Fixes some WPTs: domparsing/outerhtml-02 trusted-types/block-string-assignment-to-Element-outerHTML trusted-types/block-string-assignment-to-HTMLElement-generic trusted-types/block-string-assignment-to-ShadowRoot-innerHTML
This commit is contained in:
Notes:
github-actions[bot]
2025-12-07 07:47:01 +00:00
Author: https://github.com/mikiubo Commit: https://github.com/LadybirdBrowser/ladybird/commit/de4e3ef63a8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7043 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -1636,7 +1636,7 @@ static void generate_to_cpp(SourceGenerator& generator, ParameterType& parameter
|
||||
// NOTE: Currently all string types are converted to String.
|
||||
|
||||
IDL::Parameter parameter { .type = *string_type, .name = ByteString::empty(), .optional_default_value = {}, .extended_attributes = {} };
|
||||
generate_to_cpp(union_generator, parameter, js_name, js_suffix, ByteString::formatted("{}{}_string", js_name, js_suffix), interface, false, false, {}, false, recursion_depth + 1);
|
||||
generate_to_cpp(union_generator, parameter, js_name, js_suffix, ByteString::formatted("{}{}_string", js_name, js_suffix), interface, legacy_null_to_empty_string, false, {}, false, recursion_depth + 1);
|
||||
|
||||
union_generator.append(R"~~~(
|
||||
return { @js_name@@js_suffix@_string };
|
||||
|
||||
Reference in New Issue
Block a user