Skip to content

Commit

Permalink
Fix: Limit iOS font fix to 10.3.1 (#225)
Browse files Browse the repository at this point in the history
Apple fixed the font issue in 10.3.2, so we only limit the disableFontFace fix to 10.3.1
  • Loading branch information
tonyjin authored Jul 18, 2017
1 parent 135e717 commit b17054a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/lib/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,12 @@ class Browser {
}

/**
* Returns whether or not the device is running IOS 10.3.X that has Font Ligature rendering issue.
* Returns whether or not the device is running IOS 10.3.1 that has Font Ligature rendering issue.
*
* @return {boolean} True if device is running IOS 10.3.x
* @return {boolean} Whether device is running 10.3.1
*/
static isIOSWithFontIssue() {
return Browser.isIOS() && /(?:OS\s)10_3/i.test(userAgent);
return Browser.isIOS() && /(?:OS\s)10_3_1/i.test(userAgent);
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/lib/__tests__/Browser-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,20 +462,20 @@ describe('lib/Browser', () => {
});

describe('isIOSWithFontIssue()', () => {
it('should return true if device is on ios and is OS 10.3.XX', () => {
Browser.overrideUserAgent('iPhone OS 10_3_90 safari/2');
it('should return true if device is on ios and is OS 10.3.1', () => {
Browser.overrideUserAgent('iPhone OS 10_3_1 safari/2');
const hasIssue = Browser.isIOSWithFontIssue();
expect(hasIssue).to.be.true;
});

it('should return false if device is on ios and is not OS 10.3.XX', () => {
Browser.overrideUserAgent('iPhone OS 10_5_90 safari/2');
it('should return false if device is on ios and is not OS 10.3.1', () => {
Browser.overrideUserAgent('iPhone OS 10_3_2 safari/2');
const hasIssue = Browser.isIOSWithFontIssue();
expect(hasIssue).to.be.false;
});

it('should return false if device is on ios and is not mobile', () => {
Browser.overrideUserAgent('DesktopDevice OS 10_3_90 safari/18902374701347589235');
Browser.overrideUserAgent('DesktopDevice OS 10_3_1 safari/18902374701347589235');
const hasIssue = Browser.isAndroid();
expect(hasIssue).to.be.false;
});
Expand Down

0 comments on commit b17054a

Please sign in to comment.