diff --git a/lib/checks/shared/non-empty-if-present.js b/lib/checks/shared/non-empty-if-present.js index 23f8480696..7e51a539d9 100644 --- a/lib/checks/shared/non-empty-if-present.js +++ b/lib/checks/shared/non-empty-if-present.js @@ -3,13 +3,6 @@ let nodeName = node.nodeName.toUpperCase(); let type = (node.getAttribute('type') || '').toLowerCase(); let label = node.getAttribute('value'); -// Edge / IE set a default value, we want to filter those out. -const { submitDefault, resetDefault } = axe.commons.text.EdgeFormDefaults; -if ((type === 'submit' && label === submitDefault) || - (type === 'reset' && label === resetDefault)) { - label = null; -} - this.data(label); if (nodeName === 'INPUT' && ['submit', 'reset'].includes(type)) { diff --git a/lib/commons/text/index.js b/lib/commons/text/index.js index 12b6e04d29..e29297d09c 100644 --- a/lib/commons/text/index.js +++ b/lib/commons/text/index.js @@ -6,10 +6,3 @@ * @memberof axe.commons */ var text = commons.text = { EdgeFormDefaults: {} }; - -// These defaults are only available in IE and Edge -const input = document.createElement('input'); -input.type = 'submit'; -text.EdgeFormDefaults.submitDefault = input.getAttribute('value'); -input.type = 'reset'; -text.EdgeFormDefaults.resetDefault = input.getAttribute('value'); diff --git a/test/checks/shared/non-empty-if-present.js b/test/checks/shared/non-empty-if-present.js index b67906f777..a2a89ebc85 100644 --- a/test/checks/shared/non-empty-if-present.js +++ b/test/checks/shared/non-empty-if-present.js @@ -3,6 +3,11 @@ describe('non-empty-if-present', function () { var fixture = document.getElementById('fixture'); + // These defaults are only available in IE and Edge + var input = document.createElement('input'); + input.type = 'submit'; + var isEdgeOrIe = typeof input.getAttribute('value') === 'string'; + var checkContext = { _data: null, data: function (d) { @@ -24,7 +29,7 @@ describe('non-empty-if-present', function () { assert.isFalse(checks['non-empty-if-present'].evaluate.call(checkContext, node)); }); - it('should return true if a value is not present', function () { + (isEdgeOrIe ? xit : it)('should return true if a value is not present', function () { var node = document.createElement('input'); node.setAttribute('type', 'submit'); fixture.appendChild(node);