-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abb0673
commit ae48c16
Showing
14 changed files
with
346 additions
and
16 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "css-bundle", | ||
"version": "1.0.0", | ||
"description": "Simple node project to run stylelint from SonarCSS", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "LGPL-3.0", | ||
"dependencies": { | ||
"stylelint": "9.2.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"rules":{"block-no-empty":true,"string-no-newline":true,"comment-no-empty":true,"function-linear-gradient-no-nonstandard-direction":true,"media-feature-name-no-unknown":true,"color-no-invalid-hex":true,"no-descending-specificity":true,"font-family-no-duplicate-names":true,"no-duplicate-at-import-rules":true,"declaration-block-no-duplicate-properties":[true,{"ignore":["consecutive-duplicates-with-different-values"]}],"no-empty-source":true,"selector-type-no-unknown":true,"at-rule-no-unknown":[true,{"ignoreAtRules":["at-root","content","debug","each","else","error","for","function","if","include","mixin","return","warn","while"]}],"no-duplicate-selectors":true,"font-family-no-missing-generic-family-keyword":true,"no-extra-semicolons":true,"no-invalid-double-slash-comments":true,"selector-pseudo-element-no-unknown":true,"selector-pseudo-class-no-unknown":true,"keyframe-declaration-no-important":true,"function-calc-no-unspaced-operator":true,"property-no-unknown":true,"declaration-block-no-shorthand-property-overrides":true,"unit-no-unknown":true}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
organization=wilcofiers-github | ||
projectKey=WilcoFiers_axe-core | ||
serverUrl=https://sonarcloud.io | ||
serverVersion=7.4.0.18669 | ||
dashboardUrl=https://sonarcloud.io/dashboard?id=WilcoFiers_axe-core | ||
ceTaskId=AWa39rVxpAwoMVoOEi-z | ||
ceTaskUrl=https://sonarcloud.io/api/ce/task?id=AWa39rVxpAwoMVoOEi-z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "sonarts-bundle", | ||
"version": "1.0.0", | ||
"description": "bundle for the SonarTS-Plugin", | ||
"license": "LGPL-3.0", | ||
"devDependencies": { | ||
"tslint": "5.11.0", | ||
"tslint-sonarts": "file:../../../sonarts-core/tslint-sonarts-1.8.0.tgz" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
lib/commons/aria/get-owned.js → lib/commons/aria/get-owned-virtual.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
describe('aria.getAriaLabelText', function() { | ||
'use strict'; | ||
var aria = axe.commons.aria; | ||
|
||
it('returns "" if there is no aria-label', function() { | ||
var node = document.createElement('div'); | ||
assert.equal(aria.getAriaLabelText(node), ''); | ||
}); | ||
|
||
it('returns the aria-label attribute of nodes', function() { | ||
var node = document.createElement('div'); | ||
var label = ' my label '; | ||
node.setAttribute('aria-label', label); | ||
assert.equal(aria.getAriaLabelText(node), label); | ||
}); | ||
|
||
it('returns the aria-label attribute of virtual nodes', function() { | ||
var node = document.createElement('div'); | ||
var label = ' my label '; | ||
node.setAttribute('aria-label', label); | ||
const vNode = { actualNode: node }; | ||
assert.equal(aria.getAriaLabelText(vNode), label); | ||
}); | ||
|
||
it('returns "" if there is no aria-label', function() { | ||
var node = document.createElement('div'); | ||
assert.equal(aria.getAriaLabelText(node), ''); | ||
}); | ||
|
||
it('returns "" if the node is not an element', function() { | ||
var node = document.createTextNode('my text node'); | ||
assert.equal(aria.getAriaLabelText(node), ''); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
describe('aria.getAriaLabelledbyText', function() { | ||
'use strict'; | ||
var aria = axe.commons.aria; | ||
var fixtureSetup = axe.testUtils.fixtureSetup; | ||
|
||
it('returns the accessible name of the aria-labelledby references', function() { | ||
var fixture = fixtureSetup( | ||
'<div role="heading" aria-labelledby="foo"></div>' + | ||
'<div id="foo">Foo text</div>' | ||
); | ||
var accName = aria.getAriaLabelledbyText(fixture.firstChild); | ||
assert.equal(accName, 'Foo text'); | ||
}); | ||
|
||
it('works with virtual nodes', function() { | ||
fixtureSetup( | ||
'<div role="heading" id="hdr" aria-labelledby="foo"></div>' + | ||
'<div id="foo">Foo text</div>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#hdr')[0]; | ||
var accName = aria.getAriaLabelledbyText(target); | ||
assert.equal(accName, 'Foo text'); | ||
}); | ||
|
||
it('returns references in order', function() { | ||
var fixture = fixtureSetup( | ||
'<div role="heading" aria-labelledby="bar baz foo"></div>' + | ||
'<div id="foo">Foo</div>' + | ||
'<div id="bar">Bar</div>' + | ||
'<div id="baz">Baz</div>' | ||
); | ||
var accName = aria.getAriaLabelledbyText(fixture.firstChild); | ||
assert.equal(accName, 'Bar Baz Foo'); | ||
}); | ||
|
||
it('returns "" if the node is not an element', function() { | ||
var fixture = fixtureSetup('foo'); | ||
var accName = aria.getAriaLabelledbyText(fixture.firstChild); | ||
assert.equal(accName, ''); | ||
}); | ||
|
||
it('returns "" with context.inLabelledByContext: true', function() { | ||
fixtureSetup( | ||
'<div role="heading" id="hdr" aria-labelledby="foo"></div>' + | ||
'<div id="foo">Foo text</div>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#hdr')[0]; | ||
var accName = aria.getAriaLabelledbyText(target, { | ||
inLabelledByContext: true | ||
}); | ||
assert.equal(accName, ''); | ||
}); | ||
|
||
it('returns "" with context.inControlContext: true', function() { | ||
fixtureSetup( | ||
'<div role="heading" id="hdr" aria-labelledby="foo"></div>' + | ||
'<div id="foo">Foo text</div>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#hdr')[0]; | ||
var accName = aria.getAriaLabelledbyText(target, { | ||
inControlContext: true | ||
}); | ||
assert.equal(accName, ''); | ||
}); | ||
|
||
it('returns content of a aria-hidden reference', function() { | ||
fixtureSetup( | ||
'<div role="heading" id="hdr" aria-labelledby="foo"></div>' + | ||
'<div id="foo" aria-hidden="true">Foo text</div>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#hdr')[0]; | ||
var accName = aria.getAriaLabelledbyText(target); | ||
assert.equal(accName, 'Foo text'); | ||
}); | ||
|
||
it('returns content of a `display:none` reference', function() { | ||
fixtureSetup( | ||
'<div role="heading" id="hdr" aria-labelledby="foo"></div>' + | ||
'<div id="foo" style="display:none">Foo text</div>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#hdr')[0]; | ||
var accName = aria.getAriaLabelledbyText(target); | ||
assert.equal(accName, 'Foo text'); | ||
}); | ||
|
||
it('returns does not return hidden content of a visible reference', function() { | ||
fixtureSetup( | ||
'<div role="heading" id="hdr" aria-labelledby="foo"></div>' + | ||
'<div id="foo"><div style="display:none">Foo text</div></div>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#hdr')[0]; | ||
var accName = aria.getAriaLabelledbyText(target); | ||
assert.equal(accName, ''); | ||
}); | ||
|
||
it('does not follow more than one aria-labelledy reference', function() { | ||
fixtureSetup( | ||
'<div role="heading" id="hdr" aria-labelledby="foo"></div>' + | ||
'<div id="foo"><div aria-labelledby="bar" role="heading"></div></div>' + | ||
'<div id="bar">Foo text</div>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#hdr')[0]; | ||
var accName = aria.getAriaLabelledbyText(target, { | ||
inControlContext: true | ||
}); | ||
assert.equal(accName, ''); | ||
}); | ||
|
||
it('preserves spacing', function() { | ||
var fixture = fixtureSetup( | ||
'<div role="heading" aria-labelledby="foo"></div>' + | ||
'<div id="foo"> \t Foo \n text \t </div>' | ||
); | ||
var accName = aria.getAriaLabelledbyText(fixture.firstChild); | ||
assert.equal(accName, ' \t Foo \n text \t '); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
describe('aria.getOwnedVirtual', function() { | ||
'use strict'; | ||
var aria = axe.commons.aria; | ||
var fixtureSetup = axe.testUtils.fixtureSetup; | ||
|
||
it('returns a list of children in order', function() { | ||
fixtureSetup( | ||
'<div id="target">' + | ||
'<h1>heading 1</h1>' + | ||
'<h2>heading 2</h2>' + | ||
'<h3>heading 3</h3>' + | ||
'</div>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#target')[0]; | ||
var owned = aria.getOwnedVirtual(target); | ||
assert.lengthOf(owned, 3); | ||
assert.equal(owned[0].actualNode.nodeName.toUpperCase(), 'H1'); | ||
assert.equal(owned[1].actualNode.nodeName.toUpperCase(), 'H2'); | ||
assert.equal(owned[2].actualNode.nodeName.toUpperCase(), 'H3'); | ||
}); | ||
|
||
it('adds aria-owned reffed elements to the children', function() { | ||
fixtureSetup( | ||
'<div id="target" aria-owns="hdr3 hdr4">' + | ||
'<h1>heading 1</h1>' + | ||
'<h2>heading 2</h2>' + | ||
'</div>' + | ||
'<h4 id="hdr4">heading 4</h4>' + | ||
'<h3 id="hdr3">heading 3</h3>' | ||
); | ||
var target = axe.utils.querySelectorAll(axe._tree[0], '#target')[0]; | ||
var owned = aria.getOwnedVirtual(target); | ||
assert.lengthOf(owned, 4); | ||
assert.equal(owned[0].actualNode.nodeName.toUpperCase(), 'H1'); | ||
assert.equal(owned[1].actualNode.nodeName.toUpperCase(), 'H2'); | ||
assert.equal(owned[2].actualNode.nodeName.toUpperCase(), 'H3'); | ||
assert.equal(owned[2].actualNode.nodeName.toUpperCase(), 'H4'); | ||
}); | ||
|
||
it('ignores whitespace-only aria-owned'); | ||
|
||
it('ignores broken aria-owned refs'); | ||
|
||
it('includes text nodes'); | ||
|
||
it('returns an empty array if there are no owned elements'); | ||
}); |
Oops, something went wrong.