EditorInlineHtmlPane getRendererComponent(@NotNull Editor editor, int width, @Nullable Color backgroundColor) {
    boolean newInstance = false;
    EditorInlineHtmlPane pane = myPane;
    if (pane == null || myContentUpdateNeeded) {
      myContentUpdateNeeded = false;
      clearCachedComponent();
      if (myItem.getTextToRender() == null) {
        pane = getLoadingPane(editor);
      }
      else {
        myPane = pane = createEditorPane(editor, myItem.getTextToRender(), backgroundColor, false);
        newInstance = true;
      }
    }
    AppUIUtil.targetToDevice(pane, editor.getContentComponent());
    pane.setSize(width, 10_000_000 /* Arbitrary large value, that doesn't lead to overflows and precision loss */);
    if (newInstance) {
      // trigger internal layout, so that image elements are created
      // this is done after 'targetToDevice' call to take correct graphics context into account
      pane.getPreferredSize();
      pane.startImageTracking();
    }
    else if (backgroundColor != null && pane.getBackground().getRGB() != backgroundColor.getRGB()) {
      pane.setBackground(backgroundColor);
      // trigger CSS styles update
      pane.getPreferredSize();
    }
    return pane;
  }
EditorInlineHtmlPane getRendererComponent(@NotNull Editor editor, int width, @Nullable Color backgroundColor)