mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibWeb: Add AriaData object to parse ARIAMixin data
This provides an easily serializeable interface for us to use in IPC.
This commit is contained in:
parent
10931dceb8
commit
57a6d577ad
8 changed files with 893 additions and 5 deletions
|
@ -61,4 +61,22 @@ bool ARIAMixin::has_global_aria_attribute() const
|
|||
|| !aria_role_description().is_null();
|
||||
}
|
||||
|
||||
Optional<DeprecatedString> ARIAMixin::parse_id_reference(DeprecatedString const& id_reference) const
|
||||
{
|
||||
if (id_reference_exists(id_reference))
|
||||
return id_reference;
|
||||
return {};
|
||||
}
|
||||
|
||||
Vector<DeprecatedString> ARIAMixin::parse_id_reference_list(DeprecatedString const& id_list) const
|
||||
{
|
||||
Vector<DeprecatedString> result;
|
||||
auto id_references = id_list.split_view(Infra::is_ascii_whitespace);
|
||||
for (auto const id_reference : id_references) {
|
||||
if (id_reference_exists(id_reference))
|
||||
result.append(id_reference);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue