LibWeb: Reduce SelectItemOption struct from 40 to 32 bytes
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Pavel Shliak 2024-11-11 14:22:44 +04:00 committed by Andreas Kling
parent 566870b2bd
commit 1bdc41faa1
Notes: github-actions[bot] 2024-11-11 16:07:12 +00:00
3 changed files with 5 additions and 5 deletions

View file

@ -389,7 +389,7 @@ void HTMLSelectElement::show_the_picker_if_applicable()
for (auto const& child : opt_group_element.children_as_vector()) {
if (is<HTMLOptionElement>(*child)) {
auto& option_element = verify_cast<HTMLOptionElement>(*child);
option_group_items.append(SelectItemOption { id_counter++, strip_newlines(option_element.text_content()), option_element.value(), option_element.selected(), option_element.disabled(), option_element });
option_group_items.append(SelectItemOption { id_counter++, option_element.selected(), option_element.disabled(), option_element, strip_newlines(option_element.text_content()), option_element.value() });
}
}
m_select_items.append(SelectItemOptionGroup { opt_group_element.get_attribute(AttributeNames::label).value_or(String {}), option_group_items });
@ -397,7 +397,7 @@ void HTMLSelectElement::show_the_picker_if_applicable()
if (is<HTMLOptionElement>(*child)) {
auto& option_element = verify_cast<HTMLOptionElement>(*child);
m_select_items.append(SelectItemOption { id_counter++, strip_newlines(option_element.text_content()), option_element.value(), option_element.selected(), option_element.disabled(), option_element });
m_select_items.append(SelectItemOption { id_counter++, option_element.selected(), option_element.disabled(), option_element, strip_newlines(option_element.text_content()), option_element.value() });
}
if (is<HTMLHRElement>(*child))

View file

@ -27,7 +27,7 @@ ErrorOr<Web::HTML::SelectItemOption> IPC::decode(Decoder& decoder)
auto value = TRY(decoder.decode<String>());
auto selected = TRY(decoder.decode<bool>());
auto disabled = TRY(decoder.decode<bool>());
return Web::HTML::SelectItemOption { id, move(label), move(value), selected, disabled };
return Web::HTML::SelectItemOption { id, selected, disabled, {}, move(label), move(value) };
}
template<>

View file

@ -14,11 +14,11 @@ namespace Web::HTML {
struct SelectItemOption {
u32 id { 0 };
String label {};
String value {};
bool selected { false };
bool disabled { false };
JS::GCPtr<HTMLOptionElement> option_element {};
String label {};
String value {};
};
struct SelectItemOptionGroup {