-
Notifications
You must be signed in to change notification settings - Fork 779
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(color-contrast): handle text that is outside overflow: hidden
ancestor
#4357
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,4 +120,20 @@ describe('dom.getVisibleChildTextRects', () => { | |
|
||
assert.lengthOf(actual, 2); | ||
}); | ||
|
||
it('changes nodeRect size if all text rects got outside ancestor overflow', () => { | ||
fixtureSetup(` | ||
<div style="overflow: hidden; width: 50px;"> | ||
<div style="overflow: hidden; width: 25px"> | ||
<div id="target" style="padding-left: 65px;">Hello World</div> | ||
</div> | ||
</div> | ||
`); | ||
const node = fixture.querySelector('#target'); | ||
const actual = getVisibleChildTextRects(node); | ||
const rect = getClientRects(node)[0]; | ||
const expected = new DOMRect(rect.left, rect.top, 25, rect.height); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as addressing the issue this makes sense. But this example is odd. This element has no visible text, yet axe is deciding it does. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After thinking and looking into it, I don't believe this is the correct solution. |
||
|
||
assertRectsEqual(actual, [expected]); | ||
}); | ||
}); |
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.
Decided to leave this in as a failsafe though it technically shouldn't be needed anymore