mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
LibWeb: Port AttributeNames to FlyString
This commit is contained in:
parent
6a3f27509f
commit
e4f8c59210
93 changed files with 148 additions and 149 deletions
|
@ -46,14 +46,14 @@ JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Object>> AudioConstructor::construct(
|
|||
auto audio = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() { return DOM::create_element(document, HTML::TagNames::audio, Namespace::HTML); }));
|
||||
|
||||
// 3. Set an attribute value for audio using "preload" and "auto".
|
||||
MUST(audio->set_attribute(HTML::AttributeNames::preload, "auto"sv));
|
||||
MUST(audio->set_attribute(HTML::AttributeNames::preload, "auto"_string));
|
||||
|
||||
auto src_value = vm.argument(0);
|
||||
|
||||
// 4. If src is given, then set an attribute value for audio using "src" and src.
|
||||
// (This will cause the user agent to invoke the object's resource selection algorithm before returning.)
|
||||
if (!src_value.is_undefined()) {
|
||||
auto src = TRY(src_value.to_deprecated_string(vm));
|
||||
auto src = TRY(src_value.to_string(vm));
|
||||
MUST(audio->set_attribute(HTML::AttributeNames::src, move(src)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue