From 1a4a40a8b0df806034aaaa30dd657980a458e59d Mon Sep 17 00:00:00 2001 From: zorkow Date: Tue, 24 Sep 2019 16:42:52 +0100 Subject: [PATCH 1/2] Corrects aria-label construction from speech attribute. --- ts/a11y/semantic-enrich.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ts/a11y/semantic-enrich.ts b/ts/a11y/semantic-enrich.ts index 52565892a..eb370107b 100644 --- a/ts/a11y/semantic-enrich.ts +++ b/ts/a11y/semantic-enrich.ts @@ -133,8 +133,9 @@ export function EnrichedMathItemMixin) { if (this.state() >= STATE.ATTACHSPEECH) return; - const attributes =this.root.attributes; - const speech = (attributes.get('aria-label') || attributes.get('data-semantic-speech')) as string; + const attributes = this.root.attributes; + const speech = (attributes.get('aria-label') || + this.getSpeech(this.root)) as string; if (speech) { const adaptor = document.adaptor; const node = this.typesetRoot; @@ -146,6 +147,21 @@ export function EnrichedMathItemMixin Date: Tue, 24 Sep 2019 17:03:15 +0100 Subject: [PATCH 2/2] Commenting and cleanup. --- ts/a11y/semantic-enrich.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/a11y/semantic-enrich.ts b/ts/a11y/semantic-enrich.ts index eb370107b..692679335 100644 --- a/ts/a11y/semantic-enrich.ts +++ b/ts/a11y/semantic-enrich.ts @@ -131,7 +131,7 @@ export function EnrichedMathItemMixin) { + public attachSpeech(document: MathDocument) { if (this.state() >= STATE.ATTACHSPEECH) return; const attributes = this.root.attributes; const speech = (attributes.get('aria-label') || @@ -147,6 +147,11 @@ export function EnrichedMathItemMixin