LibWeb: Add a DOM::Element::set_attribute override for UTF-16 strings

This just transcodes to UTF-8 for now, but primarily serves to to keep
compatibility with generated IDL definitions.
This commit is contained in:
Timothy Flynn 2025-07-26 11:00:09 -04:00 committed by Andreas Kling
commit e7b08cf291
Notes: github-actions[bot] 2025-07-28 10:26:37 +00:00
6 changed files with 14 additions and 7 deletions

View file

@ -132,7 +132,7 @@ WebIDL::ExceptionOr<void> HTMLDialogElement::show()
queue_a_dialog_toggle_event_task("closed"_string, "open"_string, nullptr);
// 6. Add an open attribute to this, whose value is the empty string.
TRY(set_attribute(AttributeNames::open, {}));
TRY(set_attribute(AttributeNames::open, String {}));
// 7. Assert: this's node document's open dialogs list does not contain this.
VERIFY(!m_document->open_dialogs_list().contains_slow(GC::Ref(*this)));
@ -227,7 +227,7 @@ WebIDL::ExceptionOr<void> HTMLDialogElement::show_a_modal_dialog(HTMLDialogEleme
subject.queue_a_dialog_toggle_event_task("closed"_string, "open"_string, source);
// 11. Add an open attribute to subject, whose value is the empty string.
TRY(subject.set_attribute(AttributeNames::open, {}));
TRY(subject.set_attribute(AttributeNames::open, String {}));
// 12. Set is modal of subject to true.
subject.set_is_modal(true);