mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 21:57:18 +00:00
parent
a0b44ff5e7
commit
85b424464a
Notes:
github-actions[bot]
2025-01-21 16:49:39 +00:00
Author: https://github.com/trflynn89
Commit: 85b424464a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3335
191 changed files with 574 additions and 574 deletions
|
@ -52,12 +52,12 @@ JS::ThrowCompletionOr<GC::Ref<JS::Object>> OptionConstructor::construct(Function
|
|||
text_value = &vm.empty_string();
|
||||
|
||||
// 1. Let document be the current principal global object's associated Document.
|
||||
auto& window = verify_cast<HTML::Window>(HTML::current_principal_global_object());
|
||||
auto& window = as<HTML::Window>(HTML::current_principal_global_object());
|
||||
auto& document = window.associated_document();
|
||||
|
||||
// 2. Let option be the result of creating an element given document, "option", and the HTML namespace.
|
||||
auto element = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() { return DOM::create_element(document, HTML::TagNames::option, Namespace::HTML); }));
|
||||
GC::Ref<HTML::HTMLOptionElement> option_element = verify_cast<HTML::HTMLOptionElement>(*element);
|
||||
GC::Ref<HTML::HTMLOptionElement> option_element = as<HTML::HTMLOptionElement>(*element);
|
||||
|
||||
// 3. If text is not the empty string, then append to option a new Text node whose data is text.
|
||||
auto text = TRY(text_value.to_string(vm));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue