-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(commons/dom/createGrid): only add the visible, non-overflow areas…
… of an element to the grid (#4101) * fix(commons/dom/createGrid): only add the visible, non-overflow areas of an element to the grid * integration test * Update test/integration/full/contrast/memory.html Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com> --------- Co-authored-by: Wilco Fiers <WilcoFiers@users.noreply.github.com>
- Loading branch information
1 parent
9634282
commit d77f47b
Showing
4 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Test Page</title> | ||
<link | ||
rel="stylesheet" | ||
type="text/css" | ||
href="/node_modules/mocha/mocha.css" | ||
/> | ||
<script src="/node_modules/mocha/mocha.js"></script> | ||
<script src="/node_modules/chai/chai.js"></script> | ||
<script src="/axe.js"></script> | ||
<script> | ||
mocha.setup({ | ||
timeout: 2000, | ||
ui: 'bdd' | ||
}); | ||
var assert = chai.assert; | ||
</script> | ||
<script src="/test/integration/no-ui-reporter.js"></script> | ||
<style> | ||
* { | ||
box-sizing: border-box; | ||
} | ||
html, | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
height: 100%; | ||
background: #fff; | ||
color: #000; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="fixture"> | ||
<div style="overflow: hidden; width: 200px; height: 200px"> | ||
<!-- browsers each have their own CSS size limit so this number (which should be greater than the limit) will be capped to that --> | ||
<div style="width: 1e9px; height: 1e9px">Hello World</div> | ||
</div> | ||
</div> | ||
<script src="memory.js"></script> | ||
<script src="/test/integration/adapter.js"></script> | ||
</body> | ||
</html> |
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,18 @@ | ||
/* | ||
Since we can't easily test for memory issue we'll assume that if this test doesn't time out then the memory issue isn't a problem | ||
*/ | ||
describe('color-contrast memory test', () => { | ||
describe('violations', () => { | ||
it('should find none', done => { | ||
axe.run( | ||
'#fixture', | ||
{ runOnly: { type: 'rule', values: ['color-contrast'] } }, | ||
(err, results) => { | ||
assert.isNull(err); | ||
assert.lengthOf(results.violations, 0); | ||
done(); | ||
} | ||
); | ||
}); | ||
}); | ||
}); |