mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibWeb: Complete support for all ARIA properties in current spec
This change completes handling for all ARIA properties defined in the current ARIA spec — by adding handling for the following properties: - aria-braillelabel - aria-brailleroledescription - aria-colindextext - aria-description - aria-rowindextext
This commit is contained in:
parent
536e4d1d36
commit
ede6924db8
Notes:
github-actions[bot]
2024-10-24 20:22:40 +00:00
Author: https://github.com/sideshowbarker
Commit: ede6924db8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1930
12 changed files with 392 additions and 25 deletions
|
@ -139,6 +139,10 @@ StringView aria_name_to_enum_name(StringView name)
|
||||||
return "AriaAtomic"sv;
|
return "AriaAtomic"sv;
|
||||||
} else if (name == "aria-autocomplete"sv) {
|
} else if (name == "aria-autocomplete"sv) {
|
||||||
return "AriaAutoComplete"sv;
|
return "AriaAutoComplete"sv;
|
||||||
|
} else if (name == "aria-braillelabel"sv) {
|
||||||
|
return "AriaBrailleLabel"sv;
|
||||||
|
} else if (name == "aria-brailleroledescription"sv) {
|
||||||
|
return "AriaBrailleRoleDescription"sv;
|
||||||
} else if (name == "aria-busy"sv) {
|
} else if (name == "aria-busy"sv) {
|
||||||
return "AriaBusy"sv;
|
return "AriaBusy"sv;
|
||||||
} else if (name == "aria-checked"sv) {
|
} else if (name == "aria-checked"sv) {
|
||||||
|
@ -147,6 +151,8 @@ StringView aria_name_to_enum_name(StringView name)
|
||||||
return "AriaColCount"sv;
|
return "AriaColCount"sv;
|
||||||
} else if (name == "aria-colindex"sv) {
|
} else if (name == "aria-colindex"sv) {
|
||||||
return "AriaColIndex"sv;
|
return "AriaColIndex"sv;
|
||||||
|
} else if (name == "aria-colindextext"sv) {
|
||||||
|
return "AriaColIndexText"sv;
|
||||||
} else if (name == "aria-colspan"sv) {
|
} else if (name == "aria-colspan"sv) {
|
||||||
return "AriaColSpan"sv;
|
return "AriaColSpan"sv;
|
||||||
} else if (name == "aria-controls"sv) {
|
} else if (name == "aria-controls"sv) {
|
||||||
|
@ -155,6 +161,8 @@ StringView aria_name_to_enum_name(StringView name)
|
||||||
return "AriaCurrent"sv;
|
return "AriaCurrent"sv;
|
||||||
} else if (name == "aria-describedby"sv) {
|
} else if (name == "aria-describedby"sv) {
|
||||||
return "AriaDescribedBy"sv;
|
return "AriaDescribedBy"sv;
|
||||||
|
} else if (name == "aria-description"sv) {
|
||||||
|
return "AriaDescription"sv;
|
||||||
} else if (name == "aria-details"sv) {
|
} else if (name == "aria-details"sv) {
|
||||||
return "AriaDetails"sv;
|
return "AriaDetails"sv;
|
||||||
} else if (name == "aria-disabled"sv) {
|
} else if (name == "aria-disabled"sv) {
|
||||||
|
@ -213,6 +221,8 @@ StringView aria_name_to_enum_name(StringView name)
|
||||||
return "AriaRowCount"sv;
|
return "AriaRowCount"sv;
|
||||||
} else if (name == "aria-rowindex"sv) {
|
} else if (name == "aria-rowindex"sv) {
|
||||||
return "AriaRowIndex"sv;
|
return "AriaRowIndex"sv;
|
||||||
|
} else if (name == "aria-rowindextext"sv) {
|
||||||
|
return "AriaRowIndexText"sv;
|
||||||
} else if (name == "aria-rowspan"sv) {
|
} else if (name == "aria-rowspan"sv) {
|
||||||
return "AriaRowSpan"sv;
|
return "AriaRowSpan"sv;
|
||||||
} else if (name == "aria-selected"sv) {
|
} else if (name == "aria-selected"sv) {
|
||||||
|
|
|
@ -15,19 +15,15 @@ Testing: aria-autocomplete attribute reflects.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
Testing: aria-braillelabel attribute reflects.
|
Testing: aria-braillelabel attribute reflects.
|
||||||
❌ FAIL: undefined is not equal to x.
|
✅ PASS: x is equal to x as expected.
|
||||||
❌ FAIL: x is not equal to y.
|
✅ PASS: y is equal to y as expected.
|
||||||
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
✅ PASS: undefined is equal to null as expected.
|
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
Testing: aria-brailleroledescription attribute reflects.
|
Testing: aria-brailleroledescription attribute reflects.
|
||||||
❌ FAIL: undefined is not equal to x.
|
✅ PASS: x is equal to x as expected.
|
||||||
❌ FAIL: x is not equal to y.
|
✅ PASS: y is equal to y as expected.
|
||||||
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
✅ PASS: undefined is equal to null as expected.
|
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
Testing: aria-busy attribute reflects.
|
Testing: aria-busy attribute reflects.
|
||||||
✅ PASS: true is equal to true as expected.
|
✅ PASS: true is equal to true as expected.
|
||||||
✅ PASS: false is equal to false as expected.
|
✅ PASS: false is equal to false as expected.
|
||||||
|
@ -49,12 +45,10 @@ Testing: aria-colindex attribute reflects.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
Testing: aria-colindextext attribute reflects.
|
Testing: aria-colindextext attribute reflects.
|
||||||
❌ FAIL: undefined is not equal to x.
|
✅ PASS: x is equal to x as expected.
|
||||||
❌ FAIL: x is not equal to y.
|
✅ PASS: y is equal to y as expected.
|
||||||
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
✅ PASS: undefined is equal to null as expected.
|
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
Testing: aria-colspan attribute reflects.
|
Testing: aria-colspan attribute reflects.
|
||||||
✅ PASS: 2 is equal to 2 as expected.
|
✅ PASS: 2 is equal to 2 as expected.
|
||||||
✅ PASS: 3 is equal to 3 as expected.
|
✅ PASS: 3 is equal to 3 as expected.
|
||||||
|
@ -66,12 +60,10 @@ Testing: aria-current attribute reflects.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
Testing: aria-description attribute reflects.
|
Testing: aria-description attribute reflects.
|
||||||
❌ FAIL: undefined is not equal to cold as ice.
|
✅ PASS: cold as ice is equal to cold as ice as expected.
|
||||||
❌ FAIL: cold as ice is not equal to hot as fire.
|
✅ PASS: hot as fire is equal to hot as fire as expected.
|
||||||
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
✅ PASS: undefined is equal to null as expected.
|
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
Testing: aria-disabled attribute reflects.
|
Testing: aria-disabled attribute reflects.
|
||||||
✅ PASS: true is equal to true as expected.
|
✅ PASS: true is equal to true as expected.
|
||||||
✅ PASS: false is equal to false as expected.
|
✅ PASS: false is equal to false as expected.
|
||||||
|
@ -183,12 +175,10 @@ Testing: aria-rowindex attribute reflects.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
Testing: aria-rowindextext attribute reflects.
|
Testing: aria-rowindextext attribute reflects.
|
||||||
❌ FAIL: undefined is not equal to x.
|
✅ PASS: x is equal to x as expected.
|
||||||
❌ FAIL: x is not equal to y.
|
✅ PASS: y is equal to y as expected.
|
||||||
|
✅ PASS: null is equal to null as expected.
|
||||||
✅ PASS: null is equal to null as expected.
|
✅ PASS: null is equal to null as expected.
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
✅ PASS: undefined is equal to null as expected.
|
|
||||||
❌ FAIL: Expected false but got true.
|
|
||||||
Testing: aria-rowspan attribute reflects.
|
Testing: aria-rowspan attribute reflects.
|
||||||
✅ PASS: 2 is equal to 2 as expected.
|
✅ PASS: 2 is equal to 2 as expected.
|
||||||
✅ PASS: 3 is equal to 3 as expected.
|
✅ PASS: 3 is equal to 3 as expected.
|
||||||
|
|
|
@ -42,10 +42,13 @@ Optional<Role> ARIAMixin::role_or_default() const
|
||||||
bool ARIAMixin::has_global_aria_attribute() const
|
bool ARIAMixin::has_global_aria_attribute() const
|
||||||
{
|
{
|
||||||
return aria_atomic().has_value()
|
return aria_atomic().has_value()
|
||||||
|
|| aria_braille_label().has_value()
|
||||||
|
|| aria_braille_role_description().has_value()
|
||||||
|| aria_busy().has_value()
|
|| aria_busy().has_value()
|
||||||
|| aria_controls().has_value()
|
|| aria_controls().has_value()
|
||||||
|| aria_current().has_value()
|
|| aria_current().has_value()
|
||||||
|| aria_described_by().has_value()
|
|| aria_described_by().has_value()
|
||||||
|
|| aria_description().has_value()
|
||||||
|| aria_details().has_value()
|
|| aria_details().has_value()
|
||||||
|| aria_disabled().has_value()
|
|| aria_disabled().has_value()
|
||||||
|| aria_drop_effect().has_value()
|
|| aria_drop_effect().has_value()
|
||||||
|
|
|
@ -31,6 +31,12 @@ public:
|
||||||
virtual Optional<String> aria_auto_complete() const = 0;
|
virtual Optional<String> aria_auto_complete() const = 0;
|
||||||
virtual WebIDL::ExceptionOr<void> set_aria_auto_complete(Optional<String> const&) = 0;
|
virtual WebIDL::ExceptionOr<void> set_aria_auto_complete(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
virtual Optional<String> aria_braille_label() const = 0;
|
||||||
|
virtual WebIDL::ExceptionOr<void> set_aria_braille_label(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
virtual Optional<String> aria_braille_role_description() const = 0;
|
||||||
|
virtual WebIDL::ExceptionOr<void> set_aria_braille_role_description(Optional<String> const&) = 0;
|
||||||
|
|
||||||
virtual Optional<String> aria_busy() const = 0;
|
virtual Optional<String> aria_busy() const = 0;
|
||||||
virtual WebIDL::ExceptionOr<void> set_aria_busy(Optional<String> const&) = 0;
|
virtual WebIDL::ExceptionOr<void> set_aria_busy(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
@ -43,6 +49,9 @@ public:
|
||||||
virtual Optional<String> aria_col_index() const = 0;
|
virtual Optional<String> aria_col_index() const = 0;
|
||||||
virtual WebIDL::ExceptionOr<void> set_aria_col_index(Optional<String> const&) = 0;
|
virtual WebIDL::ExceptionOr<void> set_aria_col_index(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
virtual Optional<String> aria_col_index_text() const = 0;
|
||||||
|
virtual WebIDL::ExceptionOr<void> set_aria_col_index_text(Optional<String> const&) = 0;
|
||||||
|
|
||||||
virtual Optional<String> aria_col_span() const = 0;
|
virtual Optional<String> aria_col_span() const = 0;
|
||||||
virtual WebIDL::ExceptionOr<void> set_aria_col_span(Optional<String> const&) = 0;
|
virtual WebIDL::ExceptionOr<void> set_aria_col_span(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
@ -55,6 +64,9 @@ public:
|
||||||
virtual Optional<String> aria_described_by() const = 0;
|
virtual Optional<String> aria_described_by() const = 0;
|
||||||
virtual WebIDL::ExceptionOr<void> set_aria_described_by(Optional<String> const&) = 0;
|
virtual WebIDL::ExceptionOr<void> set_aria_described_by(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
virtual Optional<String> aria_description() const = 0;
|
||||||
|
virtual WebIDL::ExceptionOr<void> set_aria_description(Optional<String> const&) = 0;
|
||||||
|
|
||||||
virtual Optional<String> aria_details() const = 0;
|
virtual Optional<String> aria_details() const = 0;
|
||||||
virtual WebIDL::ExceptionOr<void> set_aria_details(Optional<String> const&) = 0;
|
virtual WebIDL::ExceptionOr<void> set_aria_details(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
@ -142,6 +154,9 @@ public:
|
||||||
virtual Optional<String> aria_row_index() const = 0;
|
virtual Optional<String> aria_row_index() const = 0;
|
||||||
virtual WebIDL::ExceptionOr<void> set_aria_row_index(Optional<String> const&) = 0;
|
virtual WebIDL::ExceptionOr<void> set_aria_row_index(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
virtual Optional<String> aria_row_index_text() const = 0;
|
||||||
|
virtual WebIDL::ExceptionOr<void> set_aria_row_index_text(Optional<String> const&) = 0;
|
||||||
|
|
||||||
virtual Optional<String> aria_row_span() const = 0;
|
virtual Optional<String> aria_row_span() const = 0;
|
||||||
virtual WebIDL::ExceptionOr<void> set_aria_row_span(Optional<String> const&) = 0;
|
virtual WebIDL::ExceptionOr<void> set_aria_row_span(Optional<String> const&) = 0;
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,16 @@ interface mixin ARIAMixin {
|
||||||
[CEReactions] attribute DOMString? role;
|
[CEReactions] attribute DOMString? role;
|
||||||
[CEReactions] attribute DOMString? ariaAtomic;
|
[CEReactions] attribute DOMString? ariaAtomic;
|
||||||
[CEReactions] attribute DOMString? ariaAutoComplete;
|
[CEReactions] attribute DOMString? ariaAutoComplete;
|
||||||
|
[CEReactions] attribute DOMString? ariaBrailleLabel;
|
||||||
|
[CEReactions] attribute DOMString? ariaBrailleRoleDescription;
|
||||||
[CEReactions] attribute DOMString? ariaBusy;
|
[CEReactions] attribute DOMString? ariaBusy;
|
||||||
[CEReactions] attribute DOMString? ariaChecked;
|
[CEReactions] attribute DOMString? ariaChecked;
|
||||||
[CEReactions] attribute DOMString? ariaColCount;
|
[CEReactions] attribute DOMString? ariaColCount;
|
||||||
[CEReactions] attribute DOMString? ariaColIndex;
|
[CEReactions] attribute DOMString? ariaColIndex;
|
||||||
|
[CEReactions] attribute DOMString? ariaColIndexText;
|
||||||
[CEReactions] attribute DOMString? ariaColSpan;
|
[CEReactions] attribute DOMString? ariaColSpan;
|
||||||
[CEReactions] attribute DOMString? ariaCurrent;
|
[CEReactions] attribute DOMString? ariaCurrent;
|
||||||
|
[CEReactions] attribute DOMString? ariaDescription;
|
||||||
[CEReactions] attribute DOMString? ariaDisabled;
|
[CEReactions] attribute DOMString? ariaDisabled;
|
||||||
[CEReactions] attribute DOMString? ariaExpanded;
|
[CEReactions] attribute DOMString? ariaExpanded;
|
||||||
[CEReactions] attribute DOMString? ariaHasPopup;
|
[CEReactions] attribute DOMString? ariaHasPopup;
|
||||||
|
@ -31,6 +35,7 @@ interface mixin ARIAMixin {
|
||||||
[CEReactions] attribute DOMString? ariaRoleDescription;
|
[CEReactions] attribute DOMString? ariaRoleDescription;
|
||||||
[CEReactions] attribute DOMString? ariaRowCount;
|
[CEReactions] attribute DOMString? ariaRowCount;
|
||||||
[CEReactions] attribute DOMString? ariaRowIndex;
|
[CEReactions] attribute DOMString? ariaRowIndex;
|
||||||
|
[CEReactions] attribute DOMString? ariaRowIndexText;
|
||||||
[CEReactions] attribute DOMString? ariaRowSpan;
|
[CEReactions] attribute DOMString? ariaRowSpan;
|
||||||
[CEReactions] attribute DOMString? ariaSelected;
|
[CEReactions] attribute DOMString? ariaSelected;
|
||||||
[CEReactions] attribute DOMString? ariaSetSize;
|
[CEReactions] attribute DOMString? ariaSetSize;
|
||||||
|
|
|
@ -15,14 +15,18 @@ AriaData::AriaData(Web::ARIA::ARIAMixin const& source)
|
||||||
m_aria_active_descendant = source.aria_active_descendant();
|
m_aria_active_descendant = source.aria_active_descendant();
|
||||||
m_aria_atomic = AriaData::parse_optional_true_false(source.aria_atomic());
|
m_aria_atomic = AriaData::parse_optional_true_false(source.aria_atomic());
|
||||||
m_aria_auto_complete = AriaData::parse_aria_autocomplete(source.aria_auto_complete());
|
m_aria_auto_complete = AriaData::parse_aria_autocomplete(source.aria_auto_complete());
|
||||||
|
m_aria_braille_label = source.aria_braille_label().value_or(String {});
|
||||||
|
m_aria_braille_role_description = source.aria_braille_role_description().value_or(String {});
|
||||||
m_aria_busy = AriaData::parse_true_false(source.aria_busy());
|
m_aria_busy = AriaData::parse_true_false(source.aria_busy());
|
||||||
m_aria_checked = AriaData::parse_tristate(source.aria_checked());
|
m_aria_checked = AriaData::parse_tristate(source.aria_checked());
|
||||||
m_aria_col_count = AriaData::parse_integer(source.aria_col_count());
|
m_aria_col_count = AriaData::parse_integer(source.aria_col_count());
|
||||||
m_aria_col_index = AriaData::parse_integer(source.aria_col_index());
|
m_aria_col_index = AriaData::parse_integer(source.aria_col_index());
|
||||||
|
m_aria_col_index_text = source.aria_col_index_text().value_or(String {});
|
||||||
m_aria_col_span = AriaData::parse_integer(source.aria_col_span());
|
m_aria_col_span = AriaData::parse_integer(source.aria_col_span());
|
||||||
m_aria_controls = source.parse_id_reference_list(source.aria_controls());
|
m_aria_controls = source.parse_id_reference_list(source.aria_controls());
|
||||||
m_aria_current = AriaData::parse_aria_current(source.aria_current());
|
m_aria_current = AriaData::parse_aria_current(source.aria_current());
|
||||||
m_aria_described_by = source.parse_id_reference_list(source.aria_described_by());
|
m_aria_described_by = source.parse_id_reference_list(source.aria_described_by());
|
||||||
|
m_aria_description = source.aria_description().value_or(String {});
|
||||||
m_aria_details = source.parse_id_reference(source.aria_details());
|
m_aria_details = source.parse_id_reference(source.aria_details());
|
||||||
m_aria_disabled = AriaData::parse_true_false(source.aria_disabled());
|
m_aria_disabled = AriaData::parse_true_false(source.aria_disabled());
|
||||||
m_aria_drop_effect = AriaData::parse_aria_drop_effect(source.aria_drop_effect());
|
m_aria_drop_effect = AriaData::parse_aria_drop_effect(source.aria_drop_effect());
|
||||||
|
@ -52,6 +56,7 @@ AriaData::AriaData(Web::ARIA::ARIAMixin const& source)
|
||||||
m_aria_role_description = source.aria_role_description().value_or(String {});
|
m_aria_role_description = source.aria_role_description().value_or(String {});
|
||||||
m_aria_row_count = AriaData::parse_integer(source.aria_row_count());
|
m_aria_row_count = AriaData::parse_integer(source.aria_row_count());
|
||||||
m_aria_row_index = AriaData::parse_integer(source.aria_row_index());
|
m_aria_row_index = AriaData::parse_integer(source.aria_row_index());
|
||||||
|
m_aria_row_index_text = source.aria_row_index_text().value_or(String {});
|
||||||
m_aria_row_span = AriaData::parse_integer(source.aria_row_span());
|
m_aria_row_span = AriaData::parse_integer(source.aria_row_span());
|
||||||
m_aria_selected = AriaData::parse_true_false_undefined(source.aria_selected());
|
m_aria_selected = AriaData::parse_true_false_undefined(source.aria_selected());
|
||||||
m_aria_set_size = AriaData::parse_integer(source.aria_set_size());
|
m_aria_set_size = AriaData::parse_integer(source.aria_set_size());
|
||||||
|
@ -127,6 +132,16 @@ AriaAutocomplete AriaData::aria_auto_complete_or_default() const
|
||||||
return m_aria_auto_complete;
|
return m_aria_auto_complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String AriaData::aria_braille_label_or_default() const
|
||||||
|
{
|
||||||
|
return m_aria_braille_label;
|
||||||
|
}
|
||||||
|
|
||||||
|
String AriaData::aria_braille_role_description_or_default() const
|
||||||
|
{
|
||||||
|
return m_aria_braille_role_description;
|
||||||
|
}
|
||||||
|
|
||||||
bool AriaData::aria_busy_or_default() const
|
bool AriaData::aria_busy_or_default() const
|
||||||
{
|
{
|
||||||
return m_aria_busy;
|
return m_aria_busy;
|
||||||
|
@ -147,6 +162,11 @@ Optional<i32> AriaData::aria_col_index_or_default() const
|
||||||
return m_aria_col_index;
|
return m_aria_col_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String AriaData::aria_col_index_text_or_default() const
|
||||||
|
{
|
||||||
|
return m_aria_col_index_text;
|
||||||
|
}
|
||||||
|
|
||||||
Optional<i32> AriaData::aria_col_span_or_default() const
|
Optional<i32> AriaData::aria_col_span_or_default() const
|
||||||
{
|
{
|
||||||
return m_aria_col_span;
|
return m_aria_col_span;
|
||||||
|
@ -167,6 +187,11 @@ Vector<String> AriaData::aria_described_by_or_default() const
|
||||||
return m_aria_described_by;
|
return m_aria_described_by;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String AriaData::aria_description_or_default() const
|
||||||
|
{
|
||||||
|
return m_aria_description;
|
||||||
|
}
|
||||||
|
|
||||||
Optional<String> AriaData::aria_details_or_default() const
|
Optional<String> AriaData::aria_details_or_default() const
|
||||||
{
|
{
|
||||||
return m_aria_details;
|
return m_aria_details;
|
||||||
|
@ -320,6 +345,11 @@ Optional<i32> AriaData::aria_row_index_or_default() const
|
||||||
return m_aria_row_index;
|
return m_aria_row_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String AriaData::aria_row_index_text_or_default() const
|
||||||
|
{
|
||||||
|
return m_aria_row_index_text;
|
||||||
|
}
|
||||||
|
|
||||||
Optional<i32> AriaData::aria_row_span_or_default() const
|
Optional<i32> AriaData::aria_row_span_or_default() const
|
||||||
{
|
{
|
||||||
return m_aria_row_span;
|
return m_aria_row_span;
|
||||||
|
|
|
@ -154,14 +154,18 @@ public:
|
||||||
Optional<String> aria_active_descendant_or_default() const;
|
Optional<String> aria_active_descendant_or_default() const;
|
||||||
bool aria_atomic_or_default(bool default_value = false) const;
|
bool aria_atomic_or_default(bool default_value = false) const;
|
||||||
AriaAutocomplete aria_auto_complete_or_default() const;
|
AriaAutocomplete aria_auto_complete_or_default() const;
|
||||||
|
String aria_braille_label_or_default() const;
|
||||||
|
String aria_braille_role_description_or_default() const;
|
||||||
bool aria_busy_or_default() const;
|
bool aria_busy_or_default() const;
|
||||||
Tristate aria_checked_or_default() const;
|
Tristate aria_checked_or_default() const;
|
||||||
Optional<i32> aria_col_count_or_default() const;
|
Optional<i32> aria_col_count_or_default() const;
|
||||||
Optional<i32> aria_col_index_or_default() const;
|
Optional<i32> aria_col_index_or_default() const;
|
||||||
|
String aria_col_index_text_or_default() const;
|
||||||
Optional<i32> aria_col_span_or_default() const;
|
Optional<i32> aria_col_span_or_default() const;
|
||||||
Vector<String> aria_controls_or_default() const;
|
Vector<String> aria_controls_or_default() const;
|
||||||
AriaCurrent aria_current_or_default() const;
|
AriaCurrent aria_current_or_default() const;
|
||||||
Vector<String> aria_described_by_or_default() const;
|
Vector<String> aria_described_by_or_default() const;
|
||||||
|
String aria_description_or_default() const;
|
||||||
Optional<String> aria_details_or_default() const;
|
Optional<String> aria_details_or_default() const;
|
||||||
bool aria_disabled_or_default() const;
|
bool aria_disabled_or_default() const;
|
||||||
Vector<AriaDropEffect> aria_drop_effect_or_default() const;
|
Vector<AriaDropEffect> aria_drop_effect_or_default() const;
|
||||||
|
@ -191,6 +195,7 @@ public:
|
||||||
String aria_role_description_or_default() const;
|
String aria_role_description_or_default() const;
|
||||||
Optional<i32> aria_row_count_or_default() const;
|
Optional<i32> aria_row_count_or_default() const;
|
||||||
Optional<i32> aria_row_index_or_default() const;
|
Optional<i32> aria_row_index_or_default() const;
|
||||||
|
String aria_row_index_text_or_default() const;
|
||||||
Optional<i32> aria_row_span_or_default() const;
|
Optional<i32> aria_row_span_or_default() const;
|
||||||
Optional<bool> aria_selected_or_default() const;
|
Optional<bool> aria_selected_or_default() const;
|
||||||
Optional<i32> aria_set_size_or_default() const;
|
Optional<i32> aria_set_size_or_default() const;
|
||||||
|
@ -235,14 +240,18 @@ private:
|
||||||
Optional<String> m_aria_active_descendant;
|
Optional<String> m_aria_active_descendant;
|
||||||
Optional<bool> m_aria_atomic;
|
Optional<bool> m_aria_atomic;
|
||||||
AriaAutocomplete m_aria_auto_complete;
|
AriaAutocomplete m_aria_auto_complete;
|
||||||
|
String m_aria_braille_label;
|
||||||
|
String m_aria_braille_role_description;
|
||||||
bool m_aria_busy;
|
bool m_aria_busy;
|
||||||
Tristate m_aria_checked;
|
Tristate m_aria_checked;
|
||||||
Optional<i32> m_aria_col_count;
|
Optional<i32> m_aria_col_count;
|
||||||
Optional<i32> m_aria_col_index;
|
Optional<i32> m_aria_col_index;
|
||||||
|
String m_aria_col_index_text;
|
||||||
Optional<i32> m_aria_col_span;
|
Optional<i32> m_aria_col_span;
|
||||||
Vector<String> m_aria_controls;
|
Vector<String> m_aria_controls;
|
||||||
AriaCurrent m_aria_current;
|
AriaCurrent m_aria_current;
|
||||||
Vector<String> m_aria_described_by;
|
Vector<String> m_aria_described_by;
|
||||||
|
String m_aria_description;
|
||||||
Optional<String> m_aria_details;
|
Optional<String> m_aria_details;
|
||||||
bool m_aria_disabled;
|
bool m_aria_disabled;
|
||||||
Vector<AriaDropEffect> m_aria_drop_effect;
|
Vector<AriaDropEffect> m_aria_drop_effect;
|
||||||
|
@ -272,6 +281,7 @@ private:
|
||||||
String m_aria_role_description;
|
String m_aria_role_description;
|
||||||
Optional<i32> m_aria_row_count;
|
Optional<i32> m_aria_row_count;
|
||||||
Optional<i32> m_aria_row_index;
|
Optional<i32> m_aria_row_index;
|
||||||
|
String m_aria_row_index_text;
|
||||||
Optional<i32> m_aria_row_span;
|
Optional<i32> m_aria_row_span;
|
||||||
Optional<bool> m_aria_selected;
|
Optional<bool> m_aria_selected;
|
||||||
Optional<i32> m_aria_set_size;
|
Optional<i32> m_aria_set_size;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -15,6 +15,7 @@ RoleType::RoleType(AriaData const& data)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://w3c.github.io/aria/#global_states
|
||||||
constexpr StateAndProperties supported_state_array[] = {
|
constexpr StateAndProperties supported_state_array[] = {
|
||||||
StateAndProperties::AriaBusy,
|
StateAndProperties::AriaBusy,
|
||||||
StateAndProperties::AriaCurrent,
|
StateAndProperties::AriaCurrent,
|
||||||
|
@ -23,10 +24,14 @@ constexpr StateAndProperties supported_state_array[] = {
|
||||||
StateAndProperties::AriaHidden,
|
StateAndProperties::AriaHidden,
|
||||||
StateAndProperties::AriaInvalid
|
StateAndProperties::AriaInvalid
|
||||||
};
|
};
|
||||||
|
// https://w3c.github.io/aria/#global_states
|
||||||
constexpr StateAndProperties supported_properties_array[] = {
|
constexpr StateAndProperties supported_properties_array[] = {
|
||||||
StateAndProperties::AriaAtomic,
|
StateAndProperties::AriaAtomic,
|
||||||
|
StateAndProperties::AriaBrailleLabel,
|
||||||
|
StateAndProperties::AriaBrailleRoleDescription,
|
||||||
StateAndProperties::AriaControls,
|
StateAndProperties::AriaControls,
|
||||||
StateAndProperties::AriaDescribedBy,
|
StateAndProperties::AriaDescribedBy,
|
||||||
|
StateAndProperties::AriaDescription,
|
||||||
StateAndProperties::AriaDetails,
|
StateAndProperties::AriaDetails,
|
||||||
StateAndProperties::AriaDropEffect,
|
StateAndProperties::AriaDropEffect,
|
||||||
StateAndProperties::AriaFlowTo,
|
StateAndProperties::AriaFlowTo,
|
||||||
|
|
|
@ -37,6 +37,10 @@ ErrorOr<String> state_or_property_to_string_value(StateAndProperties state_or_pr
|
||||||
}
|
}
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
case StateAndProperties::AriaBrailleLabel:
|
||||||
|
return aria_data.aria_braille_label_or_default();
|
||||||
|
case StateAndProperties::AriaBrailleRoleDescription:
|
||||||
|
return aria_data.aria_braille_role_description_or_default();
|
||||||
case StateAndProperties::AriaBusy:
|
case StateAndProperties::AriaBusy:
|
||||||
return String::from_utf8(aria_data.aria_busy_or_default() ? "true"sv : "false"sv);
|
return String::from_utf8(aria_data.aria_busy_or_default() ? "true"sv : "false"sv);
|
||||||
case StateAndProperties::AriaChecked:
|
case StateAndProperties::AriaChecked:
|
||||||
|
@ -45,6 +49,8 @@ ErrorOr<String> state_or_property_to_string_value(StateAndProperties state_or_pr
|
||||||
return ARIA::optional_integer_to_string(aria_data.aria_col_count_or_default());
|
return ARIA::optional_integer_to_string(aria_data.aria_col_count_or_default());
|
||||||
case StateAndProperties::AriaColIndex:
|
case StateAndProperties::AriaColIndex:
|
||||||
return ARIA::optional_integer_to_string(aria_data.aria_col_index_or_default());
|
return ARIA::optional_integer_to_string(aria_data.aria_col_index_or_default());
|
||||||
|
case StateAndProperties::AriaColIndexText:
|
||||||
|
return aria_data.aria_col_index_text_or_default();
|
||||||
case StateAndProperties::AriaColSpan:
|
case StateAndProperties::AriaColSpan:
|
||||||
return ARIA::optional_integer_to_string(aria_data.aria_col_span_or_default());
|
return ARIA::optional_integer_to_string(aria_data.aria_col_span_or_default());
|
||||||
case StateAndProperties::AriaControls:
|
case StateAndProperties::AriaControls:
|
||||||
|
@ -71,6 +77,8 @@ ErrorOr<String> state_or_property_to_string_value(StateAndProperties state_or_pr
|
||||||
}
|
}
|
||||||
case StateAndProperties::AriaDescribedBy:
|
case StateAndProperties::AriaDescribedBy:
|
||||||
return id_reference_list_to_string(aria_data.aria_described_by_or_default());
|
return id_reference_list_to_string(aria_data.aria_described_by_or_default());
|
||||||
|
case StateAndProperties::AriaDescription:
|
||||||
|
return aria_data.aria_description_or_default();
|
||||||
case StateAndProperties::AriaDetails: {
|
case StateAndProperties::AriaDetails: {
|
||||||
return aria_data.aria_details_or_default().value_or(String {});
|
return aria_data.aria_details_or_default().value_or(String {});
|
||||||
}
|
}
|
||||||
|
@ -252,6 +260,8 @@ ErrorOr<String> state_or_property_to_string_value(StateAndProperties state_or_pr
|
||||||
return ARIA::optional_integer_to_string(aria_data.aria_row_count_or_default());
|
return ARIA::optional_integer_to_string(aria_data.aria_row_count_or_default());
|
||||||
case StateAndProperties::AriaRowIndex:
|
case StateAndProperties::AriaRowIndex:
|
||||||
return ARIA::optional_integer_to_string(aria_data.aria_row_index_or_default());
|
return ARIA::optional_integer_to_string(aria_data.aria_row_index_or_default());
|
||||||
|
case StateAndProperties::AriaRowIndexText:
|
||||||
|
return aria_data.aria_row_index_text_or_default();
|
||||||
case StateAndProperties::AriaRowSpan:
|
case StateAndProperties::AriaRowSpan:
|
||||||
return ARIA::optional_integer_to_string(aria_data.aria_row_span_or_default());
|
return ARIA::optional_integer_to_string(aria_data.aria_row_span_or_default());
|
||||||
case StateAndProperties::AriaSelected:
|
case StateAndProperties::AriaSelected:
|
||||||
|
@ -351,6 +361,10 @@ StringView state_or_property_to_string(StateAndProperties value)
|
||||||
return "aria-atomic"sv;
|
return "aria-atomic"sv;
|
||||||
case StateAndProperties::AriaAutoComplete:
|
case StateAndProperties::AriaAutoComplete:
|
||||||
return "aria-autocomplete"sv;
|
return "aria-autocomplete"sv;
|
||||||
|
case StateAndProperties::AriaBrailleLabel:
|
||||||
|
return "aria-braillelabel"sv;
|
||||||
|
case StateAndProperties::AriaBrailleRoleDescription:
|
||||||
|
return "aria-brailleroledescription"sv;
|
||||||
case StateAndProperties::AriaBusy:
|
case StateAndProperties::AriaBusy:
|
||||||
return "aria-busy"sv;
|
return "aria-busy"sv;
|
||||||
case StateAndProperties::AriaChecked:
|
case StateAndProperties::AriaChecked:
|
||||||
|
@ -359,6 +373,8 @@ StringView state_or_property_to_string(StateAndProperties value)
|
||||||
return "aria-colcount"sv;
|
return "aria-colcount"sv;
|
||||||
case StateAndProperties::AriaColIndex:
|
case StateAndProperties::AriaColIndex:
|
||||||
return "aria-colindex"sv;
|
return "aria-colindex"sv;
|
||||||
|
case StateAndProperties::AriaColIndexText:
|
||||||
|
return "aria-colindextext"sv;
|
||||||
case StateAndProperties::AriaColSpan:
|
case StateAndProperties::AriaColSpan:
|
||||||
return "aria-colspan"sv;
|
return "aria-colspan"sv;
|
||||||
case StateAndProperties::AriaControls:
|
case StateAndProperties::AriaControls:
|
||||||
|
@ -367,6 +383,8 @@ StringView state_or_property_to_string(StateAndProperties value)
|
||||||
return "aria-current"sv;
|
return "aria-current"sv;
|
||||||
case StateAndProperties::AriaDescribedBy:
|
case StateAndProperties::AriaDescribedBy:
|
||||||
return "aria-describedby"sv;
|
return "aria-describedby"sv;
|
||||||
|
case StateAndProperties::AriaDescription:
|
||||||
|
return "aria-description"sv;
|
||||||
case StateAndProperties::AriaDetails:
|
case StateAndProperties::AriaDetails:
|
||||||
return "aria-details"sv;
|
return "aria-details"sv;
|
||||||
case StateAndProperties::AriaDisabled:
|
case StateAndProperties::AriaDisabled:
|
||||||
|
@ -425,6 +443,8 @@ StringView state_or_property_to_string(StateAndProperties value)
|
||||||
return "aria-rowcount"sv;
|
return "aria-rowcount"sv;
|
||||||
case StateAndProperties::AriaRowIndex:
|
case StateAndProperties::AriaRowIndex:
|
||||||
return "aria-rowindex"sv;
|
return "aria-rowindex"sv;
|
||||||
|
case StateAndProperties::AriaRowIndexText:
|
||||||
|
return "aria-rowindextext"sv;
|
||||||
case StateAndProperties::AriaRowSpan:
|
case StateAndProperties::AriaRowSpan:
|
||||||
return "aria-rowspan"sv;
|
return "aria-rowspan"sv;
|
||||||
case StateAndProperties::AriaSelected:
|
case StateAndProperties::AriaSelected:
|
||||||
|
|
|
@ -16,14 +16,18 @@ enum class StateAndProperties {
|
||||||
AriaActiveDescendant,
|
AriaActiveDescendant,
|
||||||
AriaAtomic,
|
AriaAtomic,
|
||||||
AriaAutoComplete,
|
AriaAutoComplete,
|
||||||
|
AriaBrailleLabel,
|
||||||
|
AriaBrailleRoleDescription,
|
||||||
AriaBusy,
|
AriaBusy,
|
||||||
AriaChecked,
|
AriaChecked,
|
||||||
AriaColCount,
|
AriaColCount,
|
||||||
AriaColIndex,
|
AriaColIndex,
|
||||||
|
AriaColIndexText,
|
||||||
AriaColSpan,
|
AriaColSpan,
|
||||||
AriaControls,
|
AriaControls,
|
||||||
AriaCurrent,
|
AriaCurrent,
|
||||||
AriaDescribedBy,
|
AriaDescribedBy,
|
||||||
|
AriaDescription,
|
||||||
AriaDetails,
|
AriaDetails,
|
||||||
AriaDisabled,
|
AriaDisabled,
|
||||||
AriaDropEffect,
|
AriaDropEffect,
|
||||||
|
@ -53,6 +57,7 @@ enum class StateAndProperties {
|
||||||
AriaRoleDescription,
|
AriaRoleDescription,
|
||||||
AriaRowCount,
|
AriaRowCount,
|
||||||
AriaRowIndex,
|
AriaRowIndex,
|
||||||
|
AriaRowIndexText,
|
||||||
AriaRowSpan,
|
AriaRowSpan,
|
||||||
AriaSelected,
|
AriaSelected,
|
||||||
AriaSetSize,
|
AriaSetSize,
|
||||||
|
|
|
@ -291,14 +291,18 @@ public:
|
||||||
ARIA_IMPL(aria_active_descendant, "aria-activedescendant"_fly_string);
|
ARIA_IMPL(aria_active_descendant, "aria-activedescendant"_fly_string);
|
||||||
ARIA_IMPL(aria_atomic, "aria-atomic"_fly_string);
|
ARIA_IMPL(aria_atomic, "aria-atomic"_fly_string);
|
||||||
ARIA_IMPL(aria_auto_complete, "aria-autocomplete"_fly_string);
|
ARIA_IMPL(aria_auto_complete, "aria-autocomplete"_fly_string);
|
||||||
|
ARIA_IMPL(aria_braille_label, "aria-braillelabel"_fly_string);
|
||||||
|
ARIA_IMPL(aria_braille_role_description, "aria-brailleroledescription"_fly_string);
|
||||||
ARIA_IMPL(aria_busy, "aria-busy"_fly_string);
|
ARIA_IMPL(aria_busy, "aria-busy"_fly_string);
|
||||||
ARIA_IMPL(aria_checked, "aria-checked"_fly_string);
|
ARIA_IMPL(aria_checked, "aria-checked"_fly_string);
|
||||||
ARIA_IMPL(aria_col_count, "aria-colcount"_fly_string);
|
ARIA_IMPL(aria_col_count, "aria-colcount"_fly_string);
|
||||||
ARIA_IMPL(aria_col_index, "aria-colindex"_fly_string);
|
ARIA_IMPL(aria_col_index, "aria-colindex"_fly_string);
|
||||||
|
ARIA_IMPL(aria_col_index_text, "aria-colindextext"_fly_string);
|
||||||
ARIA_IMPL(aria_col_span, "aria-colspan"_fly_string);
|
ARIA_IMPL(aria_col_span, "aria-colspan"_fly_string);
|
||||||
ARIA_IMPL(aria_controls, "aria-controls"_fly_string);
|
ARIA_IMPL(aria_controls, "aria-controls"_fly_string);
|
||||||
ARIA_IMPL(aria_current, "aria-current"_fly_string);
|
ARIA_IMPL(aria_current, "aria-current"_fly_string);
|
||||||
ARIA_IMPL(aria_described_by, "aria-describedby"_fly_string);
|
ARIA_IMPL(aria_described_by, "aria-describedby"_fly_string);
|
||||||
|
ARIA_IMPL(aria_description, "aria-description"_fly_string);
|
||||||
ARIA_IMPL(aria_details, "aria-details"_fly_string);
|
ARIA_IMPL(aria_details, "aria-details"_fly_string);
|
||||||
ARIA_IMPL(aria_drop_effect, "aria-dropeffect"_fly_string);
|
ARIA_IMPL(aria_drop_effect, "aria-dropeffect"_fly_string);
|
||||||
ARIA_IMPL(aria_error_message, "aria-errormessage"_fly_string);
|
ARIA_IMPL(aria_error_message, "aria-errormessage"_fly_string);
|
||||||
|
@ -328,6 +332,7 @@ public:
|
||||||
ARIA_IMPL(aria_role_description, "aria-roledescription"_fly_string);
|
ARIA_IMPL(aria_role_description, "aria-roledescription"_fly_string);
|
||||||
ARIA_IMPL(aria_row_count, "aria-rowcount"_fly_string);
|
ARIA_IMPL(aria_row_count, "aria-rowcount"_fly_string);
|
||||||
ARIA_IMPL(aria_row_index, "aria-rowindex"_fly_string);
|
ARIA_IMPL(aria_row_index, "aria-rowindex"_fly_string);
|
||||||
|
ARIA_IMPL(aria_row_index_text, "aria-rowindextext"_fly_string);
|
||||||
ARIA_IMPL(aria_row_span, "aria-rowspan"_fly_string);
|
ARIA_IMPL(aria_row_span, "aria-rowspan"_fly_string);
|
||||||
ARIA_IMPL(aria_selected, "aria-selected"_fly_string);
|
ARIA_IMPL(aria_selected, "aria-selected"_fly_string);
|
||||||
ARIA_IMPL(aria_set_size, "aria-setsize"_fly_string);
|
ARIA_IMPL(aria_set_size, "aria-setsize"_fly_string);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue