Commit Graph

15 Commits

Author SHA1 Message Date
Tim Ledbetter
6f5dd9e11c LibWeb: Return correct RoleType for composite ARIA role 2024-01-27 14:52:41 -05:00
Tim Ledbetter
f0d2a21d77 LibWeb: Add missing ARIA roles to RoleType::build_role_object()
This change allows `contentinfo`, `none`, `subscript` and `superscript`
RoleTypes to be built. These were the only non-abstract role types
missing from this function.

This fixes an issue where clicking on an element with one of these role
types in Inspector would cause a crash.
2024-01-27 14:52:41 -05:00
Shannon Booth
e2e7c4d574 Everywhere: Use to_number<T> instead of to_{int,uint,float,double}
In a bunch of cases, this actually ends up simplifying the code as
to_number will handle something such as:

```
Optional<I> opt;
if constexpr (IsSigned<I>)
    opt = view.to_int<I>();
else
    opt = view.to_uint<I>();
```

For us.

The main goal here however is to have a single generic number conversion
API between all of the String classes.
2023-12-23 20:41:07 +01:00
Shannon Booth
c5d3ccca00 LibWeb: Port AriaData from DeprecatedString to String 2023-11-20 15:00:19 +01:00
Shannon Booth
4321606bba LibWeb: Port Element interface from DeprecatedString
This is the last IDL interface which was using DeprecatedString! :^)
2023-10-06 08:25:40 +02:00
Lucas CHOLLET
3f35ffb648 Userland: Prefer _string over _short_string
As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
2023-08-08 07:37:21 +02:00
Timothy Flynn
c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Jonah
e9840bfd4e LibWeb: Build out the ARIA role model
We now have implemented the ARIA role model. These classes will
control which states and properties are exposed to end users.
2023-07-06 11:21:36 +01:00
Jonah
125792e5ff LibWeb: Add helper functions for handling ARIA state and properties
These will make serializing and calculating default values easier.
2023-07-06 11:21:36 +01:00
Jonah
57a6d577ad LibWeb: Add AriaData object to parse ARIAMixin data
This provides an easily serializeable interface for us to use in IPC.
2023-07-06 11:21:36 +01:00
Andreas Kling
a504ac3e2a Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_case
Let's make it clear that these functions deal with ASCII case only.
2023-03-10 13:15:44 +01:00
Jonah
fc3ee471ed LibWeb: Add ARIA::allows_name_from_content
This is required to implement accessible name and description
calculation.
2023-02-19 15:58:20 +01:00
MacDue
489fe49321 LibWeb: Fix parsing/to_string for "switch" ARIA role
I accidentally regressed this in 890b4d7, this role needs to be
handled specially due to the clash with the C++ 'switch' keyword.
2023-01-29 00:57:41 +00:00
Linus Groh
476d4b4963 LibWeb: Remove no longer needed DeprecatedFlyString.h includes
ARIA roles no longer use DeprecatedFlyString, replace them with the
forwarding header, and StringView.h in one case, for other things from
AK used in those headers.
2023-01-29 00:02:55 +00:00
Linus Groh
8556d47240 LibWeb: Move ARIA-related code into the Web::ARIA namespace
ARIA has its own spec and is not part of the DOM spec, which is what the
Web::DOM namespace is for (https://www.w3.org/TR/wai-aria-1.2/).

This allows us to stay closer to the spec with function names and don't
have to add the word "ARIA" to identifiers constantly - the namespace
now provides that clarity.
2023-01-29 00:02:55 +00:00