diff --git a/src/focus-visible.js b/src/focus-visible.js
index aa752cf..83cd8c7 100644
--- a/src/focus-visible.js
+++ b/src/focus-visible.js
@@ -24,7 +24,7 @@ function init() {
/**
* Helper function for legacy browsers and iframes which sometimes focus
- * elements like document and body.
+ * elements like document, body, and non-interactive SVG.
* @param {Element} el
*/
function isValidFocusTarget(el) {
@@ -32,7 +32,9 @@ function init() {
el &&
el !== document &&
el.nodeName !== 'HTML' &&
- el.nodeName !== 'BODY'
+ el.nodeName !== 'BODY' &&
+ 'classList' in el &&
+ 'contains' in el.classList
) {
return true;
}
diff --git a/test/fixtures/svg.html b/test/fixtures/svg.html
new file mode 100644
index 0000000..3976b91
--- /dev/null
+++ b/test/fixtures/svg.html
@@ -0,0 +1,26 @@
+
+
+
+ svg focus fixture
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/specs/svg.js b/test/specs/svg.js
new file mode 100644
index 0000000..ba10a03
--- /dev/null
+++ b/test/specs/svg.js
@@ -0,0 +1,63 @@
+const { fixture, FOCUS_RING_STYLE } = require('./helpers');
+const { Key, By } = require('selenium-webdriver');
+const expect = require('expect');
+const driver = global.__driver;
+
+// IE11 has a strange behavior where it will always focus an