Skip to content
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): account for text client rects that start outside the parent container #2682

Merged
merged 4 commits into from
Dec 18, 2020

Conversation

straker
Copy link
Contributor

@straker straker commented Dec 9, 2020

The element that was causing the problem had 12 client rects, all of them text rects that started on their own lines (so 12 lines of text). Some of those rects started outside the bounds of the element, so we tried to access part of a grid that didn't exist.

Fixed it so if any text rect wasn't fully contained within the parents bounding box, we just use the parents bounding box. Also moved the textElementStack tests to their own file as they were becoming so large.

Closes issue: #2681

Copy link
Contributor

@WilcoFiers WilcoFiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very small change

lib/commons/dom/get-text-element-stack.js Outdated Show resolved Hide resolved
@straker straker merged commit a4e4a34 into develop Dec 18, 2020
@straker straker deleted the text-color branch December 18, 2020 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants