LibWeb: Amend Element interface to make it compatible with TrustedTypes

This commit is contained in:
Tete17 2025-08-10 23:49:19 +02:00 committed by Luke Wilde
parent 1368744d33
commit db41ea8117
Notes: github-actions[bot] 2025-10-27 16:16:02 +00:00
12 changed files with 93 additions and 61 deletions

View file

@ -1103,7 +1103,7 @@ void HTMLInputElement::create_text_input_shadow_tree()
padding: 0;
cursor: default;
)~~~"_string));
MUST(up_button->set_inner_html("<svg style=\"width: 1em; height: 1em;\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z\" /></svg>"sv));
MUST(up_button->set_inner_html("<svg style=\"width: 1em; height: 1em;\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z\" /></svg>"_utf16));
MUST(element->append_child(up_button));
auto mouseup_callback_function = JS::NativeFunction::create(
@ -1135,7 +1135,7 @@ void HTMLInputElement::create_text_input_shadow_tree()
padding: 0;
cursor: default;
)~~~"_string));
MUST(down_button->set_inner_html("<svg style=\"width: 1em; height: 1em;\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z\" /></svg>"sv));
MUST(down_button->set_inner_html("<svg style=\"width: 1em; height: 1em;\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z\" /></svg>"_utf16));
MUST(element->append_child(down_button));
auto down_callback_function = JS::NativeFunction::create(

View file

@ -612,7 +612,7 @@ void HTMLSelectElement::create_shadow_tree_if_needed()
height: 16px;
margin-left: 4px;
)~~~"_string));
MUST(m_chevron_icon_element->set_inner_html(chevron_svg));
MUST(m_chevron_icon_element->set_inner_html(Utf16String::from_utf8(chevron_svg)));
MUST(border->append_child(*m_chevron_icon_element));
update_inner_text_element();