src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts/NotebookCellList/updateElementHeight2
class NotebookCellList:	updateElementHeight2(element: ICellViewModel, size: number): void {
		const index = this._getViewIndexUpperBound(element);
		if (index === undefined || index < 0 || index >= this.length) {
			return;
		}

		if (this.isElementAboveViewport(index)) {
			// update element above viewport
			const oldHeight = this.elementHeight(element);
			const delta = oldHeight - size;
			if (this._webviewElement) {
				Event.once(this.view.onWillScroll)(() => {
					const webviewTop = parseInt(this._webviewElement!.domNode.style.top, 10);
					if (validateWebviewBoundary(this._webviewElement!.domNode)) {
						this._webviewElement!.setTop(webviewTop - delta);
					} else {
						// When the webview top boundary is below the list view scrollable element top boundary, then we can't insert a markdown cell at the top
						// or when its bottom boundary is above the list view bottom boundary, then we can't insert a markdown cell at the end
						// thus we have to revert the webview element position to initial state `-NOTEBOOK_WEBVIEW_BOUNDARY`.
						// this will trigger one visual flicker (as we need to update element offsets in the webview)
						// but as long as NOTEBOOK_WEBVIEW_BOUNDARY is large enough, it will happen less often
						this._webviewElement!.setTop(-NOTEBOOK_WEBVIEW_BOUNDARY);
					}
				});
			}
			this.view.updateElementHeight(index, size, null);
			return;
		}

		const focused = this.getFocus();
		if (!focused.length) {
			this.view.updateElementHeight(index, size, null);
			return;
		}

		const focus = focused[0];

		if (focus <= index) {
			this.view.updateElementHeight(index, size, focus);
			return;
		}

		// the `element` is in the viewport, it's very often that the height update is triggerred by user interaction (collapse, run cell)
		// then we should make sure that the `element`'s visual view position doesn't change.

		if (this.view.elementTop(index) >= this.view.scrollTop) {
			this.view.updateElementHeight(index, size, index);
			return;
		}

		this.view.updateElementHeight(index, size, focus);
	}