Merge pull request #216 from toasted-nutbread/normalize-xhtml-node-names
Normalize XHTML document node.nodeNode to upper case
This commit is contained in:
commit
ae696c32eb
@ -105,7 +105,7 @@ function docRangeFromPoint(x, y, options) {
|
|||||||
let imposterContainer = null;
|
let imposterContainer = null;
|
||||||
if (elements.length > 0) {
|
if (elements.length > 0) {
|
||||||
const element = elements[0];
|
const element = elements[0];
|
||||||
switch (element.nodeName) {
|
switch (element.nodeName.toUpperCase()) {
|
||||||
case 'IMG':
|
case 'IMG':
|
||||||
case 'BUTTON':
|
case 'BUTTON':
|
||||||
return new TextSourceElement(element);
|
return new TextSourceElement(element);
|
||||||
|
@ -88,7 +88,7 @@ class TextSourceRange {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const skip = ['RT', 'SCRIPT', 'STYLE'];
|
const skip = ['RT', 'SCRIPT', 'STYLE'];
|
||||||
if (skip.includes(node.nodeName)) {
|
if (skip.includes(node.nodeName.toUpperCase())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ class TextSourceElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setEndOffset(length) {
|
setEndOffset(length) {
|
||||||
switch (this.element.nodeName) {
|
switch (this.element.nodeName.toUpperCase()) {
|
||||||
case 'BUTTON':
|
case 'BUTTON':
|
||||||
this.content = this.element.innerHTML;
|
this.content = this.element.innerHTML;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user