From c87d6f0054ef87c3922317e5b1e66e6716c9337c Mon Sep 17 00:00:00 2001 From: avpeery Date: Thu, 17 Mar 2022 13:14:59 -0700 Subject: [PATCH 01/12] disable antialias and add a warning for 15.4 devices, needs to be checked with iPad/iPod? --- src/ui/map.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ui/map.js b/src/ui/map.js index cf98c7087de..93e2a0f2f29 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -451,6 +451,15 @@ class Map extends Camera { throw new Error(`maxPitch must be less than or equal to ${defaultMaxPitch}`); } + // iOS 15.4 introduced a rendering bug with antialias set to `true`. Disables antialias for these devices. + if (!!options.antialias && window.navigator.userAgent && /\b(iPad|iPhone|iPod)\b/.test(window.navigator.userAgent)) { + const iosVersion = window.navigator.userAgent.match(/OS ((\d+_?){2,3})\s/); + if (iosVersion && iosVersion[1] === '15_4') { + options.antialias = false; + console.warn(`Antialias has been disabled for iOS 15.4 devices.`); + } + } + const transform = new Transform(options.minZoom, options.maxZoom, options.minPitch, options.maxPitch, options.renderWorldCopies); super(transform, options); @@ -459,9 +468,9 @@ class Map extends Camera { this._maxTileCacheSize = options.maxTileCacheSize; this._failIfMajorPerformanceCaveat = options.failIfMajorPerformanceCaveat; this._preserveDrawingBuffer = options.preserveDrawingBuffer; - this._antialias = options.antialias; this._trackResize = options.trackResize; this._bearingSnap = options.bearingSnap; + this._antialias = options.antialias; this._refreshExpiredTiles = options.refreshExpiredTiles; this._fadeDuration = options.fadeDuration; this._isInitialLoad = true; From 46f88da38177d1324271ac80e1a70e1082ebfc2e Mon Sep 17 00:00:00 2001 From: avpeery Date: Thu, 17 Mar 2022 13:16:36 -0700 Subject: [PATCH 02/12] move line back for options.antialias --- src/ui/map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/map.js b/src/ui/map.js index 93e2a0f2f29..8dfc29b97bd 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -468,9 +468,9 @@ class Map extends Camera { this._maxTileCacheSize = options.maxTileCacheSize; this._failIfMajorPerformanceCaveat = options.failIfMajorPerformanceCaveat; this._preserveDrawingBuffer = options.preserveDrawingBuffer; + this._antialias = options.antialias; this._trackResize = options.trackResize; this._bearingSnap = options.bearingSnap; - this._antialias = options.antialias; this._refreshExpiredTiles = options.refreshExpiredTiles; this._fadeDuration = options.fadeDuration; this._isInitialLoad = true; From 024182234e62b73901466a140aa26feb84548a45 Mon Sep 17 00:00:00 2001 From: avpeery Date: Thu, 17 Mar 2022 13:23:59 -0700 Subject: [PATCH 03/12] fix lint issue --- src/ui/map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/map.js b/src/ui/map.js index 8dfc29b97bd..9e4de6505b7 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -457,7 +457,7 @@ class Map extends Camera { if (iosVersion && iosVersion[1] === '15_4') { options.antialias = false; console.warn(`Antialias has been disabled for iOS 15.4 devices.`); - } + } } const transform = new Transform(options.minZoom, options.maxZoom, options.minPitch, options.maxPitch, options.renderWorldCopies); From 3a2834569242b8644e8a08fac853c6499b90e060 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 17 Mar 2022 18:47:31 -0400 Subject: [PATCH 04/12] fixup Cherry Pick 8ea2f7eeb70bd804c03433523a0203c5fb4b30f --- src/ui/map.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ui/map.js b/src/ui/map.js index 9e4de6505b7..fb7c4332292 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -1,7 +1,7 @@ // @flow import {version} from '../../package.json'; -import {asyncAll, extend, bindAll, warnOnce, uniqueId} from '../util/util.js'; +import {asyncAll, extend, bindAll, warnOnce, uniqueId, isSafariWithAntialiasingBug} from '../util/util.js'; import browser from '../util/browser.js'; import window from '../util/window.js'; import * as DOM from '../util/dom.js'; @@ -451,13 +451,10 @@ class Map extends Camera { throw new Error(`maxPitch must be less than or equal to ${defaultMaxPitch}`); } - // iOS 15.4 introduced a rendering bug with antialias set to `true`. Disables antialias for these devices. - if (!!options.antialias && window.navigator.userAgent && /\b(iPad|iPhone|iPod)\b/.test(window.navigator.userAgent)) { - const iosVersion = window.navigator.userAgent.match(/OS ((\d+_?){2,3})\s/); - if (iosVersion && iosVersion[1] === '15_4') { - options.antialias = false; - console.warn(`Antialias has been disabled for iOS 15.4 devices.`); - } + // disable antialias with OS/iOS 15.4 and 15.5 due to rendering bug + if (options.antialias && isSafariWithAntialiasingBug(window)) { + options.antialias = false; + warnOnce('Antialiasing disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609'); } const transform = new Transform(options.minZoom, options.maxZoom, options.minPitch, options.maxPitch, options.renderWorldCopies); From 03ce73ccd0da22cceea2834b91248d0a79dbb54e Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 17 Mar 2022 18:24:56 -0400 Subject: [PATCH 05/12] added @ansis change for util function --- src/util/util.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/util.js b/src/util/util.js index ceb1996320e..1fd08502025 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -624,6 +624,12 @@ export function isSafari(scope: any): boolean { return _isSafari; } +export function isSafariWithAntialiasingBug(scope: any): boolean { + const userAgent = scope.navigator ? scope.navigator.userAgent : null; + if (!isSafari(scope)) return false; + return userAgent && (userAgent.match('Version/15.4 ') || userAgent.match('Version/15.5 ')); +} + export function storageAvailable(type: string): boolean { try { const storage = window[type]; From bfae7f2baf7770d6014e2d7fc03605baae8cf8d8 Mon Sep 17 00:00:00 2001 From: avpeery Date: Thu, 17 Mar 2022 20:11:26 -0700 Subject: [PATCH 06/12] fix flow issue --- src/util/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/util.js b/src/util/util.js index 1fd08502025..f321cb29059 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -624,7 +624,7 @@ export function isSafari(scope: any): boolean { return _isSafari; } -export function isSafariWithAntialiasingBug(scope: any): boolean { +export function isSafariWithAntialiasingBug(scope: any): ?boolean { const userAgent = scope.navigator ? scope.navigator.userAgent : null; if (!isSafari(scope)) return false; return userAgent && (userAgent.match('Version/15.4 ') || userAgent.match('Version/15.5 ')); From 9fce87a7acf2a3282ca382c4ce51a614d7c55a93 Mon Sep 17 00:00:00 2001 From: avpeery Date: Thu, 17 Mar 2022 20:12:06 -0700 Subject: [PATCH 07/12] grammar --- src/ui/map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/map.js b/src/ui/map.js index fb7c4332292..23a5b3aa3ca 100755 --- a/src/ui/map.js +++ b/src/ui/map.js @@ -454,7 +454,7 @@ class Map extends Camera { // disable antialias with OS/iOS 15.4 and 15.5 due to rendering bug if (options.antialias && isSafariWithAntialiasingBug(window)) { options.antialias = false; - warnOnce('Antialiasing disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609'); + warnOnce('Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609'); } const transform = new Transform(options.minZoom, options.maxZoom, options.minPitch, options.maxPitch, options.renderWorldCopies); From 33a3893dba8f335a30d2913a494e873fcff06ea8 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 18 Mar 2022 13:18:50 -0400 Subject: [PATCH 08/12] add unit tests --- src/util/util.js | 6 +++++- test/unit/util/util.test.js | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/util/util.js b/src/util/util.js index f321cb29059..3b0094d22d7 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -602,6 +602,10 @@ export function parseCacheControl(cacheControl: string): Object { let _isSafari = null; +export function _resetSafariCheckForTest() { + _isSafari = null; +} + /** * Returns true when run in WebKit derived browsers. * This is used as a workaround for a memory leak in Safari caused by using Transferable objects to @@ -627,7 +631,7 @@ export function isSafari(scope: any): boolean { export function isSafariWithAntialiasingBug(scope: any): ?boolean { const userAgent = scope.navigator ? scope.navigator.userAgent : null; if (!isSafari(scope)) return false; - return userAgent && (userAgent.match('Version/15.4 ') || userAgent.match('Version/15.5 ')); + return userAgent && (userAgent.match('Version/15.4') || userAgent.match('Version/15.5')); } export function storageAvailable(type: string): boolean { diff --git a/test/unit/util/util.test.js b/test/unit/util/util.test.js index 5612d5e5100..5000d3edbef 100644 --- a/test/unit/util/util.test.js +++ b/test/unit/util/util.test.js @@ -2,7 +2,7 @@ import {test} from '../../util/test.js'; -import {degToRad, radToDeg, easeCubicInOut, getAABBPointSquareDist, furthestTileCorner, keysDifference, extend, pick, uniqueId, bindAll, asyncAll, clamp, smoothstep, wrap, bezier, endsWith, mapObject, filterObject, deepEqual, clone, arraysIntersect, isCounterClockwise, parseCacheControl, uuid, validateUuid, nextPowerOfTwo, isPowerOfTwo, bufferConvexPolygon, prevPowerOfTwo, shortestAngle} from '../../../src/util/util.js'; +import {degToRad, radToDeg, easeCubicInOut, getAABBPointSquareDist, furthestTileCorner, keysDifference, extend, pick, uniqueId, bindAll, asyncAll, clamp, smoothstep, wrap, bezier, endsWith, mapObject, filterObject, deepEqual, clone, arraysIntersect, isCounterClockwise, parseCacheControl, uuid, validateUuid, nextPowerOfTwo, isPowerOfTwo, bufferConvexPolygon, prevPowerOfTwo, shortestAngle, _resetSafariCheckForTest, isSafariWithAntialiasingBug} from '../../../src/util/util.js'; import Point from '@mapbox/point-geometry'; @@ -405,5 +405,40 @@ test('util', (t) => { t.end(); }); + t.test('isSafariWithAntialiasingBug', (t) => { + _resetSafariCheckForTest(); + + // mac + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15'}})); + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Safari/605.1.15'}})); + + // iphone + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1'}})); + + // ipad + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1'}})); + + // chrome + _resetSafariCheckForTest(); + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36'}})); + // firefox + _resetSafariCheckForTest(); + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12.3; rv:98.0) Gecko/20100101 Firefox/98.0'}})); + // edge + _resetSafariCheckForTest(); + t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.36'}})); + + _resetSafariCheckForTest(); + t.end(); + }); + t.end(); }); From e510a69750690dc1171eb240391ddd081233fb36 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 18 Mar 2022 13:19:56 -0400 Subject: [PATCH 09/12] add comment --- src/util/util.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/util.js b/src/util/util.js index 3b0094d22d7..a68d2763276 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -631,6 +631,8 @@ export function isSafari(scope: any): boolean { export function isSafariWithAntialiasingBug(scope: any): ?boolean { const userAgent = scope.navigator ? scope.navigator.userAgent : null; if (!isSafari(scope)) return false; + // 15.4 is known to be buggy. + // 15.5 may or may not include the fix. Mark it as buggy to be on the safe side. return userAgent && (userAgent.match('Version/15.4') || userAgent.match('Version/15.5')); } From c1684707587d1ac25b415e244fea8e9405c88e87 Mon Sep 17 00:00:00 2001 From: avpeery Date: Fri, 18 Mar 2022 13:08:21 -0700 Subject: [PATCH 10/12] add check for other iOS app browsers --- src/util/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/util.js b/src/util/util.js index a68d2763276..6bad34252fa 100644 --- a/src/util/util.js +++ b/src/util/util.js @@ -633,7 +633,7 @@ export function isSafariWithAntialiasingBug(scope: any): ?boolean { if (!isSafari(scope)) return false; // 15.4 is known to be buggy. // 15.5 may or may not include the fix. Mark it as buggy to be on the safe side. - return userAgent && (userAgent.match('Version/15.4') || userAgent.match('Version/15.5')); + return userAgent && (userAgent.match('Version/15.4') || userAgent.match('Version/15.5') || userAgent.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/)); } export function storageAvailable(type: string): boolean { From 657601324d0c0542fe6d86eda441541b8f47f943 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 18 Mar 2022 16:18:16 -0400 Subject: [PATCH 11/12] expand unit tests --- test/unit/util/util.test.js | 77 +++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 20 deletions(-) diff --git a/test/unit/util/util.test.js b/test/unit/util/util.test.js index 5000d3edbef..2e9ab72f340 100644 --- a/test/unit/util/util.test.js +++ b/test/unit/util/util.test.js @@ -406,37 +406,74 @@ test('util', (t) => { }); t.test('isSafariWithAntialiasingBug', (t) => { - _resetSafariCheckForTest(); + + const isSafariWithAntialiasingBugReset = (scope) => { + _resetSafariCheckForTest(); + const result = isSafariWithAntialiasingBug(scope); + _resetSafariCheckForTest(); + return result; + }; + // mac - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15'}})); - t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15'}})); - t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15'}})); - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Safari/605.1.15'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Safari/605.1.15'}})); // iphone - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1'}})); - t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1'}})); - t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1'}})); - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1'}})); // ipad - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1'}})); - t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1'}})); - t.ok(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1'}})); - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6 Mobile/15E148 Safari/604.1'}})); // chrome - _resetSafariCheckForTest(); - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36'}})); // firefox - _resetSafariCheckForTest(); - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12.3; rv:98.0) Gecko/20100101 Firefox/98.0'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12.3; rv:98.0) Gecko/20100101 Firefox/98.0'}})); // edge - _resetSafariCheckForTest(); - t.notOk(isSafariWithAntialiasingBug({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.36'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36 Edg/99.0.1150.36'}})); + + // chrome on iOS + // iphone + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + // ipad + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + // ipod + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPod; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPod; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPod; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPod; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/99.0.4844.59 Mobile/15E148 Safari/604.1'}})); + + // firefox on iOS + // iphone + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + // ipad + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPad; CPU OS 15_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + // ipod + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPod touch; CPU iPhone OS 15_3 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPod touch; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPod touch; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); + t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (iPod touch; CPU iPhone OS 15_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) FxiOS/98.0 Mobile/15E148 Safari/605.1.15'}})); - _resetSafariCheckForTest(); t.end(); }); From 68fd25c9f69a907516b3bfd9755e8012be1df596 Mon Sep 17 00:00:00 2001 From: avpeery Date: Fri, 18 Mar 2022 13:32:01 -0700 Subject: [PATCH 12/12] removed blank line --- test/unit/util/util.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/unit/util/util.test.js b/test/unit/util/util.test.js index 2e9ab72f340..0b7c51f7ada 100644 --- a/test/unit/util/util.test.js +++ b/test/unit/util/util.test.js @@ -414,7 +414,6 @@ test('util', (t) => { return result; }; - // mac t.notOk(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15'}})); t.ok(isSafariWithAntialiasingBugReset({navigator: {userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15'}}));