-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(target-size): do not crash for nodes with many overlapping widgets #4373
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
77daf9e
fix(target-size): do not crash for nodes with many overlapping widgets
straker 4f98389
remove comments, add test, add _template
straker c9377ab
put back comment
straker 1d4f519
reset
straker fbb6acd
comment
straker 9c77077
Apply suggestions from code review
straker a6eab33
intergration test
straker c0039dd
no inner function
straker ad43fc5
move to own file
straker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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,53 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Target-size too many rects Test</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: 10000, | ||
ui: 'bdd' | ||
}); | ||
var assert = chai.assert; | ||
</script> | ||
</head> | ||
<body> | ||
<main id="mocha"></main> | ||
|
||
<section id="incomplete"> | ||
<div id="incomplete-many-rects" role="tabpanel" tabindex="0"> | ||
<table id="tab-table"></table> | ||
</div> | ||
</section> | ||
|
||
<script> | ||
let html = ''; | ||
for (let i = 0; i < 100; i++) { | ||
html += ` | ||
<tr> | ||
<td><a href="#">Hello</a></td> | ||
<td>Hello</td> | ||
<td>Hello</td> | ||
<td>Hello</td> | ||
<td>Hello</td> | ||
<td>Hello</td> | ||
<td>Hello</td> | ||
<td><button>view</button></td> | ||
<td><button>download</button></td> | ||
<td><button>expand</button></td> | ||
</tr>`; | ||
} | ||
document.querySelector('#tab-table').innerHTML = html; | ||
</script> | ||
<script src="/test/testutils.js"></script> | ||
<script src="too-many-rects.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,36 @@ | ||
describe('target-size too many rects test', () => { | ||
'use strict'; | ||
let results; | ||
|
||
before(done => { | ||
axe.testUtils.awaitNestedLoad(() => { | ||
const options = { | ||
runOnly: ['target-size'], | ||
elementRef: true | ||
}; | ||
const context = { | ||
// ignore the incomplete table results | ||
exclude: 'table tr' | ||
}; | ||
axe.run(context, options, (err, r) => { | ||
if (err) { | ||
done(err); | ||
} | ||
results = r; | ||
console.log(results); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
|
||
it('incompletes with too many rects', () => { | ||
const incompleteNodes = results.incomplete[0] | ||
? results.incomplete[0].nodes | ||
: []; | ||
assert.lengthOf(incompleteNodes, 1); | ||
assert.include( | ||
incompleteNodes[0].element, | ||
document.querySelector('#incomplete-many-rects') | ||
); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about adding an early pass for elements that have 10x the required size. I don't mind that in a different PR, but I don't think we should close the issues until we have that in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer to move that to it's own pr so we can get this in quicker. Which ticket do you think it shouldn't close?