# minimap/utils

module

<a id="functions">

## Functions

<a id="function-cloneEditingViewDomRoot">

### `cloneEditingViewDomRoot( editor, rootName? ) → HTMLElement` _(internal)_

Clones the editing view DOM root by using a dedicated pair of [`ViewRenderer`](module_engine_view_renderer-ViewRenderer.md) and [`ViewDomConverter`](module_engine_view_domconverter-ViewDomConverter.md). The DOM root clone updates incrementally to stay in sync with the source root.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-minimap/src/utils.ts#L24)

#### Parameters

* `editor: Editor`

  The editor instance the original editing root belongs to.

* `rootName?: string`

  The name of the root to clone.

#### Returns

* `HTMLElement`

  The editing root DOM clone element.

<a id="function-getClientHeight">

### `getClientHeight( domElement ) → number` _(internal)_

Gets client height according to passed DOM element. Returns window's height for `body` element.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-minimap/src/utils.ts#L101)

#### Parameters

* `domElement: HTMLElement`

#### Returns

* `number`

<a id="function-getDomElementRect">

### `getDomElementRect( domElement ) → Rect` _(internal)_

Gets dimensions rectangle according to passed DOM element. Returns whole window's size for `body` element.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-minimap/src/utils.ts#L92)

#### Parameters

* `domElement: HTMLElement`

#### Returns

* `Rect`

<a id="function-getPageStyles">

### `getPageStyles() → Array<string | object>` _(internal)_

Harvests all web page styles, for instance, to allow re-using them in an `<iframe>` preserving the look of the content.

The returned data format is as follows:

```typescript
[
	'p { color: red; ... } h2 { font-size: 2em; ... } ...',
	'.spacing { padding: 1em; ... }; ...',
	'...',
	{ href: 'http://link.to.external.stylesheet' },
	{ href: '...' }
]
```

**Note**: For stylesheets with `href` different than window origin, an object is returned because accessing rules of these styles may cause CORS errors (depending on the configuration of the web page).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-minimap/src/utils.ts#L72)

#### Returns

* `Array<string | object>`

<a id="function-getScrollable">

### `getScrollable( domElement ) → Window | HTMLElement` _(internal)_

Returns the DOM element itself if it's not a `body` element, whole window otherwise.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-minimap/src/utils.ts#L110)

#### Parameters

* `domElement: HTMLElement`

#### Returns

* `Window | HTMLElement`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
