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
This commit is contained in:
DannyS712 2021-09-21 21:56:49 +00:00 committed by Krinkle
parent e532630b11
commit 2d1c35caca

View file

@ -11,9 +11,8 @@
* *
* Capabilities required for modern run-time: * Capabilities required for modern run-time:
* - ECMAScript 5 * - ECMAScript 5
* - DOM Level 4 & Selectors API Level 1 * - DOM Level 4 (including Selectors API)
* - HTML5 & Web Storage * - HTML5 (including Web Storage API)
* - DOM Level 2 Events
* *
* Browsers we support in our modern run-time (Grade A): * Browsers we support in our modern run-time (Grade A):
* - Chrome 13+ * - Chrome 13+
@ -52,10 +51,9 @@ function isCompatible( ua ) {
return !!( return !!(
// https://caniuse.com/#feat=es5 // https://caniuse.com/#feat=es5
// https://caniuse.com/#feat=use-strict // https://caniuse.com/#feat=use-strict
// https://caniuse.com/#feat=json / https://phabricator.wikimedia.org/T141344#2784065
( function () { ( function () {
'use strict'; 'use strict';
return !this && Function.prototype.bind && window.JSON; return !this && Function.prototype.bind;
}() ) && }() ) &&
// https://caniuse.com/#feat=queryselector // https://caniuse.com/#feat=queryselector
@ -66,9 +64,6 @@ function isCompatible( ua ) {
// https://blog.whatwg.org/this-week-in-html-5-episode-30 // https://blog.whatwg.org/this-week-in-html-5-episode-30
'localStorage' in window && 'localStorage' in window &&
// https://caniuse.com/#feat=addeventlistener
'addEventListener' in window &&
// Hardcoded exceptions for browsers that pass the requirement but we don't // Hardcoded exceptions for browsers that pass the requirement but we don't
// want to support in the modern run-time. // want to support in the modern run-time.
// //