-
Notifications
You must be signed in to change notification settings - Fork 776
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
Color contrast: text that overflows its parent should go into incomplete #621
Comments
When I looked into fixing this (but decided to wait), the most relevant section of code was the Perhaps we should sample the element stack from more than one corner, and put it into incomplete if the arrays don't match. We have to weigh this with performance, of course...but it's a similar problem to the inline element checking I had to do. One thing that makes this quite difficult is that different browsers have different results with |
* fix(color-contrast): incl. elements w/ line breaks Closes #607 Closes #556 * fix(color-contrast): allow disabled label children Closes #596 * fix: adjust color algorithm for inline elements Elements spanning multiple lines now pass coordinates from their first box/rectangle to document.elementsFromPoint for gathering an element stack. * fix: handle contrast of multiline inline el's * test: ignore Phantom's LIES about color contrast * test: remove failing test TODO: address in #621 * chore: fix formatting issue
Not sure how or when, but this seems to be fixed. |
In working on #610, we found another use case that isn't quite covered: if a block element with text is positioned over an element with a background color but the text overflows, the current color algorithm causes a false positive for the overflowed text. It should return null instead of returning the background color, since we can't really tell. We talked about doing some overflow testing of the text node.
Here's a test that fails both in develop and in the color fixes PR. I didn't want to let it hold up the work that's been ongoing for a while:
The passing version in #610 works when the target has a defined width so the line breaks, and it goes through the new logic for multiple clientRects. But this one doesn't have multiple rects, so we have to look at the text node itself.
The text was updated successfully, but these errors were encountered: