From 2d1c35caca4750960e778d536f0faf7dd1a09ac0 Mon Sep 17 00:00:00 2001 From: DannyS712 Date: Tue, 21 Sep 2021 21:56:49 +0000 Subject: [PATCH] resourceloader: drop some unneeded startup compatibility checks Remove check for window.JSON, redundant to check for es5 strict mode. Remove check for window.addEventListener, we also check for querySelector which is a newer part of the same API. Bug: T290293 Change-Id: I95e62c7c1ed8f98f9df9e94fef86dda9aa77326b --- resources/src/startup/startup.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/src/startup/startup.js b/resources/src/startup/startup.js index da4ea680cc2..ed2a76f2ecd 100644 --- a/resources/src/startup/startup.js +++ b/resources/src/startup/startup.js @@ -11,9 +11,8 @@ * * Capabilities required for modern run-time: * - ECMAScript 5 - * - DOM Level 4 & Selectors API Level 1 - * - HTML5 & Web Storage - * - DOM Level 2 Events + * - DOM Level 4 (including Selectors API) + * - HTML5 (including Web Storage API) * * Browsers we support in our modern run-time (Grade A): * - Chrome 13+ @@ -52,10 +51,9 @@ function isCompatible( ua ) { return !!( // https://caniuse.com/#feat=es5 // https://caniuse.com/#feat=use-strict - // https://caniuse.com/#feat=json / https://phabricator.wikimedia.org/T141344#2784065 ( function () { 'use strict'; - return !this && Function.prototype.bind && window.JSON; + return !this && Function.prototype.bind; }() ) && // https://caniuse.com/#feat=queryselector @@ -66,9 +64,6 @@ function isCompatible( ua ) { // https://blog.whatwg.org/this-week-in-html-5-episode-30 'localStorage' in window && - // https://caniuse.com/#feat=addeventlistener - 'addEventListener' in window && - // Hardcoded exceptions for browsers that pass the requirement but we don't // want to support in the modern run-time. //