From 073420a121a0b615989e4b240ca910e7f10d84f3 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 15 Sep 2019 16:09:46 -0400 Subject: Normalize XHTML document node.nodeNode to upper case --- ext/fg/js/document.js | 2 +- ext/fg/js/source.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js index 079a5034..9afc44f0 100644 --- a/ext/fg/js/document.js +++ b/ext/fg/js/document.js @@ -105,7 +105,7 @@ function docRangeFromPoint(x, y, options) { let imposterContainer = null; if (elements.length > 0) { const element = elements[0]; - switch (element.nodeName) { + switch (element.nodeName.toUpperCase()) { case 'IMG': case 'BUTTON': return new TextSourceElement(element); diff --git a/ext/fg/js/source.js b/ext/fg/js/source.js index 18a1a976..4642de50 100644 --- a/ext/fg/js/source.js +++ b/ext/fg/js/source.js @@ -88,7 +88,7 @@ class TextSourceRange { } const skip = ['RT', 'SCRIPT', 'STYLE']; - if (skip.includes(node.nodeName)) { + if (skip.includes(node.nodeName.toUpperCase())) { return false; } @@ -285,7 +285,7 @@ class TextSourceElement { } setEndOffset(length) { - switch (this.element.nodeName) { + switch (this.element.nodeName.toUpperCase()) { case 'BUTTON': this.content = this.element.innerHTML; break; -- cgit v1.2.3