-
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(label-content-name-mismatch): ignore ligature fonts #1829
Conversation
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.
Let's try simplifying the double-for-loop that is diffing the bitmaps. See comments or msg me.
// it has to be an icon ligature (e.g. Material Icon) | ||
if (!compareData.some(pixel => pixel)) { | ||
font.numLigatures++; | ||
return true; |
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.
Good point, I like this.
|
||
if ( | ||
pixelDifference >= differenceThreshold && | ||
sizeDifference >= differenceThreshold |
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.
right now it's fine but later we might find we need to split pixel and size diff thresholds.
This reverts commit 8c8fdee.
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.
LGTM
document.createElement('canvas').getContext('2d') | ||
); | ||
} | ||
const context = axe._cache.get('context'); |
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.
Dislike this name "context" we have something else called context. Can you rename this to canvasContext or whatever? (Please open an issue)
Part 2 for #1635 to fix using ligature icon fonts.
Note: I couldn't get IE11 to work, I tried loading different font types in different ways and it would always fail, so I had to not check them in IE.
Reviewer checks
Required fields, to be filled out by PR reviewer(s)