From 9c9dd10bc6fad44bc28a077f4d6b1b5b4112c8ea Mon Sep 17 00:00:00 2001 From: TheOneWithTheBraid Date: Tue, 10 Aug 2021 10:49:35 +0200 Subject: [PATCH 1/3] Fixed aria-live attribute on web --- lib/web_ui/lib/src/engine/semantics/semantics_helper.dart | 8 +++++--- .../test/engine/semantics/semantics_helper_test.dart | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/web_ui/lib/src/engine/semantics/semantics_helper.dart b/lib/web_ui/lib/src/engine/semantics/semantics_helper.dart index 591d85df43d3d..0d57780b29b12 100644 --- a/lib/web_ui/lib/src/engine/semantics/semantics_helper.dart +++ b/lib/web_ui/lib/src/engine/semantics/semantics_helper.dart @@ -174,7 +174,8 @@ class DesktopSemanticsEnabler extends SemanticsEnabler { @override html.Element prepareAccessibilityPlaceholder() { - final html.Element placeholder = _semanticsPlaceholder = html.Element.tag('flt-semantics-placeholder'); + final html.Element placeholder = + _semanticsPlaceholder = html.Element.tag('flt-semantics-placeholder'); // Only listen to "click" because other kinds of events are reported via // PointerBinding. @@ -189,7 +190,7 @@ class DesktopSemanticsEnabler extends SemanticsEnabler { // to the assistive technology user. placeholder ..setAttribute('role', 'button') - ..setAttribute('aria-live', 'true') + ..setAttribute('aria-live', 'polite') ..setAttribute('tabindex', '0') ..setAttribute('aria-label', placeholderMessage); @@ -372,7 +373,8 @@ class MobileSemanticsEnabler extends SemanticsEnabler { @override html.Element prepareAccessibilityPlaceholder() { - final html.Element placeholder = _semanticsPlaceholder = html.Element.tag('flt-semantics-placeholder'); + final html.Element placeholder = + _semanticsPlaceholder = html.Element.tag('flt-semantics-placeholder'); // Only listen to "click" because other kinds of events are reported via // PointerBinding. diff --git a/lib/web_ui/test/engine/semantics/semantics_helper_test.dart b/lib/web_ui/test/engine/semantics/semantics_helper_test.dart index 92b0d42b06928..62d90d61474b3 100644 --- a/lib/web_ui/test/engine/semantics/semantics_helper_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_helper_test.dart @@ -37,7 +37,7 @@ void testMain() { test('prepare accesibility placeholder', () async { expect(_placeholder!.getAttribute('role'), 'button'); - expect(_placeholder!.getAttribute('aria-live'), 'true'); + expect(_placeholder!.getAttribute('aria-live'), 'polite'); expect(_placeholder!.getAttribute('tabindex'), '0'); html.document.body!.append(_placeholder!); From 8d08900d6feeca2c8a5fef20272d041b3866b277 Mon Sep 17 00:00:00 2001 From: TheOneWithTheBraid Date: Tue, 10 Aug 2021 10:58:06 +0200 Subject: [PATCH 2/3] Updated authors --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 9dcfff5242975..455f2c6699c8f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,3 +20,4 @@ Hidenori Matsubayashi Sarbagya Dhaubanjar Callum Moffat Koutaro Mori +TheOneWithTheBraid \ No newline at end of file From d0dc2fc2c06bea404346f0b8b96386b32053ec79 Mon Sep 17 00:00:00 2001 From: TheOneWithTheBraid Date: Tue, 10 Aug 2021 11:00:18 +0200 Subject: [PATCH 3/3] Fixed several typos in documentation of web semantics --- .../test/engine/semantics/semantics_helper_test.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/web_ui/test/engine/semantics/semantics_helper_test.dart b/lib/web_ui/test/engine/semantics/semantics_helper_test.dart index 62d90d61474b3..1b38d0c9d2e66 100644 --- a/lib/web_ui/test/engine/semantics/semantics_helper_test.dart +++ b/lib/web_ui/test/engine/semantics/semantics_helper_test.dart @@ -35,7 +35,7 @@ void testMain() { EngineSemanticsOwner.instance.semanticsEnabled = false; }); - test('prepare accesibility placeholder', () async { + test('prepare accessibility placeholder', () async { expect(_placeholder!.getAttribute('role'), 'button'); expect(_placeholder!.getAttribute('aria-live'), 'polite'); expect(_placeholder!.getAttribute('tabindex'), '0'); @@ -72,7 +72,7 @@ void testMain() { }); test( - 'Relevants events targeting placeholder should not be forwarded to the framework', + 'Relevant events targeting placeholder should not be forwarded to the framework', () async { final html.Event event = html.MouseEvent('mousedown'); _placeholder!.dispatchEvent(event); @@ -110,15 +110,15 @@ void testMain() { EngineSemanticsOwner.instance.semanticsEnabled = false; }); - test('prepare accesibility placeholder', () async { + test('prepare accessibility placeholder', () async { expect(_placeholder!.getAttribute('role'), 'button'); // Placeholder should cover all the screen on a mobile device. final num bodyHeight = html.window.innerHeight!; - final num bodyWidht = html.window.innerWidth!; + final num bodyWidth = html.window.innerWidth!; expect(_placeholder!.getBoundingClientRect().height, bodyHeight); - expect(_placeholder!.getBoundingClientRect().width, bodyWidht); + expect(_placeholder!.getBoundingClientRect().width, bodyWidth); }); test('Non-relevant events should be forwarded to the framework',