未验证 提交 9933dff1 编写于 作者: A Alex Dima

Fixes #86696: Tweak hit testing on Firefox for pseudo elements

上级 03d5e98a
......@@ -925,6 +925,23 @@ export class MouseTargetFactory {
}
}
// For inline decorations, Gecko returns the `<span>` of the line and the offset is the `<span>` with the inline decoration
if (hitResult.offsetNode.nodeType === hitResult.offsetNode.ELEMENT_NODE) {
const parent1 = hitResult.offsetNode.parentNode; // expected to be the view line div
const parent1ClassName = parent1 && parent1.nodeType === parent1.ELEMENT_NODE ? (<HTMLElement>parent1).className : null;
if (parent1ClassName === ViewLine.CLASS_NAME) {
const tokenSpan = hitResult.offsetNode.childNodes[Math.min(hitResult.offset, hitResult.offsetNode.childNodes.length - 1)];
if (tokenSpan) {
const p = ctx.getPositionFromDOMInfo(<HTMLElement>tokenSpan, 0);
return {
position: p,
hitTarget: null
};
}
}
}
return {
position: null,
hitTarget: <HTMLElement>hitResult.offsetNode
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册