Return only single element when deepDomScan is not enabled
This commit is contained in:
parent
7dddcb8dca
commit
8b1e4d1c6f
@ -89,8 +89,18 @@ function docImposterCreate(element, isTextarea) {
|
|||||||
return [imposter, container];
|
return [imposter, container];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function docElementsFromPoint(x, y, all) {
|
||||||
|
if (all) {
|
||||||
|
return document.elementsFromPoint(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
const e = document.elementFromPoint(x, y);
|
||||||
|
return e !== null ? [e] : [];
|
||||||
|
}
|
||||||
|
|
||||||
function docRangeFromPoint(x, y, options) {
|
function docRangeFromPoint(x, y, options) {
|
||||||
const elements = document.elementsFromPoint(x, y);
|
const deepDomScan = options.scanning.deepDomScan;
|
||||||
|
const elements = docElementsFromPoint(x, y, deepDomScan);
|
||||||
let imposter = null;
|
let imposter = null;
|
||||||
let imposterContainer = null;
|
let imposterContainer = null;
|
||||||
if (elements.length > 0) {
|
if (elements.length > 0) {
|
||||||
@ -108,7 +118,7 @@ function docRangeFromPoint(x, y, options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const range = caretRangeFromPointExt(x, y, options.scanning.deepDomScan ? elements : []);
|
const range = caretRangeFromPointExt(x, y, deepDomScan ? elements : []);
|
||||||
if (range !== null) {
|
if (range !== null) {
|
||||||
if (imposter !== null) {
|
if (imposter !== null) {
|
||||||
docSetImposterStyle(imposterContainer.style, 'z-index', '-2147483646');
|
docSetImposterStyle(imposterContainer.style, 'z-index', '-2147483646');
|
||||||
|
Loading…
Reference in New Issue
Block a user