Skip to content

fix(label-content-name-mismatch): ignore ligature fonts#1829

Merged
straker merged 20 commits into
developfrom
ignoreLigatures
Oct 14, 2019
Merged

fix(label-content-name-mismatch): ignore ligature fonts#1829
straker merged 20 commits into
developfrom
ignoreLigatures

Conversation

@straker

@straker straker commented Sep 27, 2019

Copy link
Copy Markdown
Contributor

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
Comment thread lib/commons/text/is-icon-ligature.js Outdated
Comment thread lib/commons/text/is-icon-ligature.js Outdated

@AutoSponge AutoSponge left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread test/commons/text/is-icon-ligature.js
Comment thread lib/commons/text/is-icon-ligature.js
// it has to be an icon ligature (e.g. Material Icon)
if (!compareData.some(pixel => pixel)) {
font.numLigatures++;
return true;

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

@WilcoFiers WilcoFiers left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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