Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/vs/editor/browser/controller/mouseTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,8 +1033,14 @@ function shadowCaretRangeFromPoint(shadowRoot: ShadowRoot, x: number, y: number)
// Grab its rect
const rect = el.getBoundingClientRect();

// And its font
const font = window.getComputedStyle(el, null).getPropertyValue('font');
// And its font (the computed shorthand font property might be empty, see #3217)
const fontStyle = window.getComputedStyle(el, null).getPropertyValue('font-style');
const fontVariant = window.getComputedStyle(el, null).getPropertyValue('font-variant');
const fontWeight = window.getComputedStyle(el, null).getPropertyValue('font-weight');
const fontSize = window.getComputedStyle(el, null).getPropertyValue('font-size');
const lineHeight = window.getComputedStyle(el, null).getPropertyValue('line-height');
const fontFamily = window.getComputedStyle(el, null).getPropertyValue('font-family');
const font = `${fontStyle} ${fontVariant} ${fontWeight} ${fontSize}/${lineHeight} ${fontFamily}`;

// And also its txt content
const text = (el as any).innerText;
Expand Down