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(label-content-name-mismatch): ignore ligature fonts #1829

Merged
merged 20 commits into from
Oct 14, 2019

Conversation

straker
Copy link
Contributor

@straker straker commented Sep 27, 2019

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)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@straker straker requested a review from a team as a code owner September 27, 2019 17:29
Copy link
Contributor

@AutoSponge AutoSponge left a 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;
Copy link
Contributor

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
Copy link
Contributor

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.

AutoSponge
AutoSponge previously approved these changes Oct 1, 2019
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.

LGTM

document.createElement('canvas').getContext('2d')
);
}
const context = axe._cache.get('context');
Copy link
Contributor

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)

@straker straker merged commit 683e005 into develop Oct 14, 2019
@straker straker deleted the ignoreLigatures branch October 14, 2019 19:33
@straker straker modified the milestone: Axe-core 3.5 Nov 4, 2019
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.

3 participants