diff --git a/packages/ace-core/src/checker/checker-chromium.js b/packages/ace-core/src/checker/checker-chromium.js index 2cedcde7..68e219f2 100644 --- a/packages/ace-core/src/checker/checker-chromium.js +++ b/packages/ace-core/src/checker/checker-chromium.js @@ -14,6 +14,7 @@ const scripts = [ require.resolve('../scripts/vendor/outliner.min.js'), require.resolve('../scripts/axe-patch-getselector.js'), require.resolve('../scripts/axe-patch-arialookuptable.js'), + require.resolve('../scripts/axe-patch-dlitem.js'), require.resolve('../scripts/ace-axe.js'), require.resolve('../scripts/ace-extraction.js'), ]; diff --git a/packages/ace-core/src/scripts/axe-patch-dlitem.js b/packages/ace-core/src/scripts/axe-patch-dlitem.js new file mode 100644 index 00000000..5e875010 --- /dev/null +++ b/packages/ace-core/src/scripts/axe-patch-dlitem.js @@ -0,0 +1,8 @@ +'use strict'; + +(function axePatch(window) { + const axe = window.axe; + axe._audit.checks.dlitem.evaluate = function evaluate(node, options) { + return node.parentNode.nodeName.toUpperCase() === 'DL'; + } +}(window)); diff --git a/tests/__tests__/regression.test.js b/tests/__tests__/regression.test.js index 620b8204..110f9d1d 100644 --- a/tests/__tests__/regression.test.js +++ b/tests/__tests__/regression.test.js @@ -61,3 +61,8 @@ test('issue #108: HTML5Outline is not defined (RequireJS conflict)', async () => const report = await ace('../data/issue-108'); expect(report['earl:result']['earl:outcome']).toEqual('pass'); }); + +test('issue #114: Description list item does not have a
parent element', async () => { + const report = await ace('../data/issue-114'); + expect(report['earl:result']['earl:outcome']).toEqual('pass'); +}); diff --git a/tests/data/issue-114/EPUB/content_001.xhtml b/tests/data/issue-114/EPUB/content_001.xhtml new file mode 100644 index 00000000..8a93bdaf --- /dev/null +++ b/tests/data/issue-114/EPUB/content_001.xhtml @@ -0,0 +1,19 @@ + + +Minimal EPUB + + + +

Loomings

+

Call me Ishmael.

+
+
term
+
def
+
+ + + diff --git a/tests/data/issue-114/EPUB/nav.xhtml b/tests/data/issue-114/EPUB/nav.xhtml new file mode 100644 index 00000000..1d538c19 --- /dev/null +++ b/tests/data/issue-114/EPUB/nav.xhtml @@ -0,0 +1,12 @@ + + +Minimal Nav + + + + + diff --git a/tests/data/issue-114/EPUB/package.opf b/tests/data/issue-114/EPUB/package.opf new file mode 100644 index 00000000..17cf544e --- /dev/null +++ b/tests/data/issue-114/EPUB/package.opf @@ -0,0 +1,23 @@ + + + + Minimal EPUB 3.0 + en + NOID + 2017-01-01T00:00:01Z + structuralNavigation + everything OK! + noFlashingHazard + noSoundHazard + noMotionSimulationHazard + textual + textual + + + + + + + + + diff --git a/tests/data/issue-114/META-INF/container.xml b/tests/data/issue-114/META-INF/container.xml new file mode 100644 index 00000000..2cf00654 --- /dev/null +++ b/tests/data/issue-114/META-INF/container.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/data/issue-114/mimetype b/tests/data/issue-114/mimetype new file mode 100644 index 00000000..57ef03f2 --- /dev/null +++ b/tests/data/issue-114/mimetype @@ -0,0 +1 @@ +application/epub+zip \ No newline at end of file