ace2_inner: Get computed style of first Element, not first Node

`window.getComputedStyle()` throws if passed a non-Element Node.
rhansen-sendkeys
Richard Hansen 2021-08-20 23:51:14 -04:00 committed by SamTV12345
parent 216f5af6a9
commit bd5fae97b5
1 changed files with 1 additions and 1 deletions

View File

@ -3466,7 +3466,7 @@ function Ace2Inner(editorInfo, cssManagers) {
// use that for displaying the side div line number inline with the first line // use that for displaying the side div line number inline with the first line
// of content -- This is used in ep_headings, ep_font_size etc. where the line // of content -- This is used in ep_headings, ep_font_size etc. where the line
// height is increased. // height is increased.
const elementStyle = window.getComputedStyle(docLine.firstChild); const elementStyle = window.getComputedStyle(docLine.firstElementChild);
const lineHeight = parseInt(elementStyle.getPropertyValue('line-height')); const lineHeight = parseInt(elementStyle.getPropertyValue('line-height'));
const marginBottom = parseInt(elementStyle.getPropertyValue('margin-bottom')); const marginBottom = parseInt(elementStyle.getPropertyValue('margin-bottom'));
lineHeights.push(lineHeight + marginBottom); lineHeights.push(lineHeight + marginBottom);