Skip to content

Commit

Permalink
Commenting and cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
zorkow committed Sep 27, 2019
1 parent 1a4a40a commit fbd046e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ts/a11y/semantic-enrich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function EnrichedMathItemMixin<N, T, D, B extends Constructor<AbstractMat
/**
* @param {MathDocument} document The MathDocument for the MathItem
*/
attachSpeech(document: MathDocument<N, T, D>) {
public attachSpeech(document: MathDocument<N, T, D>) {
if (this.state() >= STATE.ATTACHSPEECH) return;
const attributes = this.root.attributes;
const speech = (attributes.get('aria-label') ||
Expand All @@ -147,6 +147,11 @@ export function EnrichedMathItemMixin<N, T, D, B extends Constructor<AbstractMat
this.state(STATE.ATTACHSPEECH);
}

/**
* Retrieves the actual speech element that should be used as aria label.
* @param {MmlNode} node The root node to search from.
* @return {string} The speech content.
*/
private getSpeech(node: MmlNode): string {
const attributes = node.attributes;
if (!attributes) return;
Expand Down

0 comments on commit fbd046e

Please sign in to comment.