mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:17:35 +00:00
Ladybird+LibWeb: Add basic select element support
This commit is contained in:
parent
b439431488
commit
466153e680
28 changed files with 641 additions and 4 deletions
38
Userland/Libraries/LibWeb/HTML/SelectItem.h
Normal file
38
Userland/Libraries/LibWeb/HTML/SelectItem.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Bastiaan van der Plaat <bastiaan.v.d.plaat@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <LibIPC/Forward.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
struct SelectItem {
|
||||
enum class Type {
|
||||
OptionGroup,
|
||||
Option,
|
||||
Separator,
|
||||
};
|
||||
|
||||
Type type;
|
||||
Optional<String> label = {};
|
||||
Optional<String> value = {};
|
||||
Optional<Vector<SelectItem>> items = {};
|
||||
bool selected = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace IPC {
|
||||
|
||||
template<>
|
||||
ErrorOr<void> encode(Encoder&, Web::HTML::SelectItem const&);
|
||||
|
||||
template<>
|
||||
ErrorOr<Web::HTML::SelectItem> decode(Decoder&);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue