Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion es5/browser/add-speech.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion es5/browser/auto-render.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion es5/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion es5/index.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions lib/mathjax/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/mathjax/index.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions lib/sre/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/sre/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/mathjax/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ const toAsciiML = ((node, optionAscii): IAsciiData => {
});

const normalizeMathJaxA11y = (adaptor, mjxContainer) => {
adaptor.setAttribute(mjxContainer, 'role', 'math');
adaptor.setAttribute(mjxContainer, 'tabindex', '0');
const svg = adaptor.firstChild(mjxContainer);
if (svg) {
adaptor.setAttribute(svg, 'aria-hidden', 'true');
Expand Down
2 changes: 0 additions & 2 deletions src/sre/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const addSpeechToMathContainer = (
if (!speech) return;
// Set accessibility attributes
elMath.setAttribute('aria-label', speech);
elMath.setAttribute('role', 'math');
elMath.setAttribute('tabindex', '0');
elMath.removeAttribute('aria-labelledby');
// Add hidden speech element for context menu
const elSpeech = doc.createElement('speech');
Expand Down
19 changes: 1 addition & 18 deletions tests/_add_speech.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ describe('add-speech (addSpeechToMathContainer):', () => {
mjx.hasAttribute('aria-label').should.be.true;
mjx.getAttribute('aria-label').should.be.a('string').and.not.be.empty;
});
it('sets role="math" and tabindex="0"', () => {
const dom = renderAndParse('$x^2$');
const mjx = dom.window.document.querySelector('mjx-container');
addSpeechToMathContainer(sre, mjx, dom.window.document);
mjx.getAttribute('role').should.equal('math');
mjx.getAttribute('tabindex').should.equal('0');
});
it('removes aria-labelledby when aria-label is set', () => {
const dom = renderAndParse('$x^2$');
const mjx = dom.window.document.querySelector('mjx-container');
Expand Down Expand Up @@ -111,14 +104,6 @@ describe('add-speech (addSpeechToMathContainer):', () => {
const result = addAriaToMathHTML(sre, html);
result.should.equal(html);
});
it('adds role="math" and tabindex="0" to each container', () => {
const html = MM.markdownToHTML('$x^2$', {
accessibility: { assistiveMml: true }
});
const result = addAriaToMathHTML(sre, html);
result.should.include('role="math"');
result.should.include('tabindex="0"');
});
it('integration: server render → addAriaToMathHTML → full speech pipeline', () => {
const html = MM.markdownToHTML('$\\frac{a}{b}$', {
accessibility: { assistiveMml: true }
Expand All @@ -128,10 +113,8 @@ describe('add-speech (addSpeechToMathContainer):', () => {
html.should.include('aria-labelledby');
html.should.not.include('aria-label=');
const result = addAriaToMathHTML(sre, html);
// After: has aria-label, role, tabindex, speech element
// After: has aria-label, speech element
result.should.include('aria-label');
result.should.include('role="math"');
result.should.include('tabindex="0"');
result.should.include('<speech');
});
});
Expand Down
36 changes: 18 additions & 18 deletions tests/_data/_accessibility/_data.js

Large diffs are not rendered by default.