Skip to content

Commit f32430a

Browse files
committed
feature(browser): upgrading to platform.js 1.3.3
properly distinguishing between IE9-11 and Edge12+
1 parent 970d18d commit f32430a

32 files changed

+90
-68
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ally.js change log
22

3+
## master
4+
5+
* Updated to platform.js [1.3.3](https://github.com/bestiejs/platform.js/wiki/Changelog#133)
6+
* Separated Edge 12+ from IE9-11 (Trident)
7+
8+
39
## 1.3.0 - Return Of The Focus
410

511
*September 17th 2016*. We're continuing our journey to *make accessibility simpler*. Version 1.3.0 comes 6 months after the last feature release. We pushed [about 90 commits](https://github.com/medialize/ally.js/compare/1.1.0...1.3.0) in an effort to reduce the bundle's file size, improve startup performance, convert test suites to BDD and add DOM focus utilities.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@
145145
"dependencies": {
146146
"array.prototype.findindex": "^1.0.0",
147147
"css.escape": "^1.5.0",
148-
"platform": "^1.3.1"
148+
"platform": "1.3.3"
149149
}
150150
}

src/is/only-tabbable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function isOnlyTabbableRules({
2323
return false;
2424
}
2525

26-
if (!except.onlyFocusableBrowsingContext && (platform.is.GECKO || platform.is.TRIDENT)) {
26+
if (!except.onlyFocusableBrowsingContext && (platform.is.GECKO || platform.is.TRIDENT || platform.is.EDGE)) {
2727
const frameElement = getFrameElement(element);
2828
if (frameElement) {
2929
if (tabindexValue(frameElement) < 0) {
@@ -42,7 +42,7 @@ function isOnlyTabbableRules({
4242
return tabindex !== null && tabindex >= 0;
4343
}
4444

45-
if (nodeName === 'svg' && platform.is.TRIDENT) {
45+
if (nodeName === 'svg' && (platform.is.TRIDENT || platform.is.EDGE)) {
4646
return element.getAttribute('focusable') !== 'false';
4747
}
4848

@@ -53,11 +53,11 @@ function isOnlyTabbableRules({
5353
if (platform.is.GECKO) {
5454
return true;
5555
}
56-
if (platform.is.TRIDENT) {
56+
if (platform.is.TRIDENT || platform.is.EDGE) {
5757
return element.getAttribute('focusable') !== 'false';
5858
}
5959
}
60-
if (platform.is.TRIDENT) {
60+
if (platform.is.TRIDENT || platform.is.EDGE) {
6161
return element.getAttribute('focusable') === 'true';
6262
}
6363
}

src/is/tabbable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ function isTabbableRules({
101101

102102
if (nodeName === 'video') {
103103
if (!element.hasAttribute('controls')) {
104-
if (platform.is.TRIDENT) {
105-
// In Internet Explorer the <video> element is focusable, but not tabbable, and tabIndex property is wrong
104+
if (platform.is.TRIDENT || platform.is.EDGE) {
105+
// In Internet Explorer and Edge the <video> element is focusable, but not tabbable, and tabIndex property is wrong
106106
return false;
107107
}
108108
} else if (platform.is.BLINK || platform.is.GECKO) {
@@ -153,8 +153,8 @@ function isTabbableRules({
153153
}
154154
}
155155

156-
if (platform.is.TRIDENT) {
157-
// IE degrades <area> to script focusable, if the image
156+
if (platform.is.TRIDENT || platform.is.EDGE) {
157+
// IE and Edge degrade <area> to script focusable, if the image
158158
// using the <map> has been given tabindex="-1"
159159
if (nodeName === 'area') {
160160
const img = getImageOfArea(element);

src/supports/focus-object-swf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import platform from '../util/platform';
33

44
// Every Environment except IE9 considers SWF objects focusable
5-
const result = !platform.is.TRIDENT || !platform.is.IE9;
5+
const result = !platform.is.IE9;
66

77
export default function() {
88
return result;

src/supports/focus-svg-focusable-attribute.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
},
1111
validate: function(element, _document) {
1212
const focus = element.querySelector('text');
13-
if (platform.is.TRIDENT) {
13+
if (platform.is.TRIDENT || platform.is.EDGE) {
1414
// Edge 13 does not allow polyfilling the missing SVGElement.prototype.focus anymore
1515
return true;
1616
}

src/supports/focus-svg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
},
1010
validate: function(element, _document) {
1111
const focus = element.firstChild;
12-
if (platform.is.TRIDENT) {
12+
if (platform.is.TRIDENT || platform.is.EDGE) {
1313
// Edge 13 does not allow polyfilling the missing SVGElement.prototype.focus anymore
1414
return true;
1515
}

src/supports/tabsequence-area-at-img-position.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import platform from '../util/platform';
33

44
// https://jsbin.com/vafaba/3/edit?html,js,console,output
5-
const result = platform.is.GECKO || platform.is.TRIDENT;
5+
const result = platform.is.GECKO || platform.is.TRIDENT || platform.is.EDGE;
66

77
export default function() {
88
return result;

src/util/platform.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const IOS = os === 'iOS';
2020
const BLINK = platform.layout === 'Blink';
2121
const GECKO = platform.layout === 'Gecko';
2222
const TRIDENT = platform.layout === 'Trident';
23+
const EDGE = platform.layout === 'EdgeHTML';
2324
const WEBKIT = platform.layout === 'WebKit';
2425

2526
// browser version (not layout engine version!)
@@ -36,7 +37,8 @@ platform.is = {
3637
// layout
3738
BLINK, // "Chrome", "Chrome Mobile", "Opera"
3839
GECKO, // "Firefox"
39-
TRIDENT, // "Internet Explorer", ("Edge")
40+
TRIDENT, // "Internet Explorer"
41+
EDGE, // "Microsoft Edge"
4042
WEBKIT, // "Safari"
4143
// INTERNET EXPLORERS
4244
IE9: TRIDENT && majorVersion === 9,

test/functional/maintain.tab-focus.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ define(function(require) {
22
'use strict';
33

44
var bdd = require('intern!bdd');
5-
var pollUntil = require('intern/dojo/node!leadfoot/helpers/pollUntil');
65
require('../helper/leadfoot-commands');
76

87
bdd.describe('maintain/tab-focus', function() {
@@ -19,9 +18,6 @@ define(function(require) {
1918
.skipPlatform(this, function(platform) {
2019
return platform.is.IE10;
2120
}, 'This Test will not run on BrowserStack in IE10')
22-
23-
// wait until we're really initialized
24-
.then(pollUntil('return window.platform'));
2521
});
2622

2723
bdd.it('should wrap tab to next element', function() {

0 commit comments

Comments
 (0)