Skip to content

Commit b1a6a33

Browse files
committedSep 12, 2014
Change "HTML5 not supported" conditions to exclude IE8 *and lower*, instead of just IE8.
(And similarly for other browsers, for the sake of consistency.) This makes sure the tests are excluded even in compatibility mode, where IE8 advertises itself as IE7, but still exposes APIs for certain features, even though those features are broken, because ... IE8, ladies and gentlemen. On behalf of juangj.
1 parent 6a34eac commit b1a6a33

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed
 

Diff for: ‎javascript/atoms/html5/html5_browser.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -47,30 +47,30 @@ bot.html5.API = {
4747

4848

4949
/**
50-
* True if the current browser is IE8.
50+
* True if the current browser is IE version 8 or earlier.
5151
* @private {boolean}
5252
* @const
5353
*/
54-
bot.html5.IS_IE8_ = goog.userAgent.IE &&
55-
bot.userAgent.isEngineVersion(8) && !bot.userAgent.isEngineVersion(9);
54+
bot.html5.IS_IE8_OR_EARLIER_ = goog.userAgent.IE &&
55+
!bot.userAgent.isEngineVersion(9);
5656

5757

5858
/**
59-
* True if the current browser is Safari 4.
59+
* True if the current browser is Safari version 4 or earlier.
6060
* @private {boolean}
6161
* @const
6262
*/
63-
bot.html5.IS_SAFARI4_ = goog.userAgent.product.SAFARI &&
64-
bot.userAgent.isProductVersion(4) && !bot.userAgent.isProductVersion(5);
63+
bot.html5.IS_SAFARI4_OR_EARLIER_ = goog.userAgent.product.SAFARI &&
64+
!bot.userAgent.isProductVersion(5);
6565

6666

6767
/**
68-
* True if the browser is Android 2.2 (Froyo).
68+
* True if the browser is Android version 2.2 (Froyo) or earlier.
6969
* @private {boolean}
7070
* @const
7171
*/
72-
bot.html5.IS_ANDROID_FROYO_ = goog.userAgent.product.ANDROID &&
73-
bot.userAgent.isProductVersion(2.2) && !bot.userAgent.isProductVersion(2.3);
72+
bot.html5.IS_ANDROID_FROYO_OR_EARLIER_ = goog.userAgent.product.ANDROID &&
73+
!bot.userAgent.isProductVersion(2.3);
7474

7575

7676
/**
@@ -98,7 +98,7 @@ bot.html5.isSupported = function(api, opt_window) {
9898
switch (api) {
9999
case bot.html5.API.APPCACHE:
100100
// IE8 does not support application cache, though the APIs exist.
101-
if (bot.html5.IS_IE8_) {
101+
if (bot.html5.IS_IE8_OR_EARLIER_) {
102102
return false;
103103
}
104104
return goog.isDefAndNotNull(win.applicationCache);
@@ -109,11 +109,11 @@ bot.html5.isSupported = function(api, opt_window) {
109109

110110
case bot.html5.API.DATABASE:
111111
// Safari4 database API does not allow writes.
112-
if (bot.html5.IS_SAFARI4_) {
112+
if (bot.html5.IS_SAFARI4_OR_EARLIER_) {
113113
return false;
114114
}
115115
// Android Froyo does not support database, though the APIs exist.
116-
if (bot.html5.IS_ANDROID_FROYO_) {
116+
if (bot.html5.IS_ANDROID_FROYO_OR_EARLIER_) {
117117
return false;
118118
}
119119
return goog.isDefAndNotNull(win.openDatabase);
@@ -129,14 +129,14 @@ bot.html5.isSupported = function(api, opt_window) {
129129

130130
case bot.html5.API.LOCAL_STORAGE:
131131
// IE8 does not support local storage, though the APIs exist.
132-
if (bot.html5.IS_IE8_) {
132+
if (bot.html5.IS_IE8_OR_EARLIER_) {
133133
return false;
134134
}
135135
return goog.isDefAndNotNull(win.localStorage);
136136

137137
case bot.html5.API.SESSION_STORAGE:
138138
// IE8 does not support session storage, though the APIs exist.
139-
if (bot.html5.IS_IE8_) {
139+
if (bot.html5.IS_IE8_OR_EARLIER_) {
140140
return false;
141141
}
142142
return goog.isDefAndNotNull(win.sessionStorage) &&

0 commit comments

Comments
 (0)
Please sign in to comment.