mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-06 23:37:31 +09:00
moebius#195: DOM - PointerEvent - improvements
https://github.com/MoonchildProductions/moebius/pull/195
This commit is contained in:
parent
3d237024d5
commit
a968f1d6c2
10 changed files with 228 additions and 20 deletions
|
|
@ -260,10 +260,23 @@ class ElementClickInterceptedError extends WebDriverError {
|
|||
if (obscuredEl && coords) {
|
||||
const doc = obscuredEl.ownerDocument;
|
||||
const overlayingEl = doc.elementFromPoint(coords.x, coords.y);
|
||||
msg = error.pprint`Element ${obscuredEl} is not clickable ` +
|
||||
`at point (${coords.x},${coords.y}) ` +
|
||||
error.pprint`because another element ${overlayingEl} ` +
|
||||
`obscures it`;
|
||||
|
||||
switch (obscuredEl.style.pointerEvents) {
|
||||
case "none":
|
||||
msg = error.pprint`Element ${obscuredEl} is not clickable ` +
|
||||
`at point (${coords.x},${coords.y}) ` +
|
||||
`because it does not have pointer events enabled, ` +
|
||||
error.pprint`and element ${overlayingEl} ` +
|
||||
`would receive the click instead`;
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = error.pprint`Element ${obscuredEl} is not clickable ` +
|
||||
`at point (${coords.x},${coords.y}) ` +
|
||||
error.pprint`because another element ${overlayingEl} ` +
|
||||
`obscures it`;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
super(msg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue