@ckeditor/ckeditor5-utils 47.6.1 → 48.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/LICENSE.md +1 -1
  2. package/{src → dist}/dom/global.d.ts +1 -1
  3. package/{src → dist}/dom/rect.d.ts +8 -0
  4. package/dist/index.css +3 -0
  5. package/dist/index.css.map +1 -0
  6. package/dist/index.js +24 -5
  7. package/dist/index.js.map +1 -1
  8. package/{src → dist}/version.d.ts +1 -1
  9. package/package.json +20 -38
  10. package/src/abortabledebounce.js +0 -22
  11. package/src/areconnectedthroughproperties.js +0 -71
  12. package/src/ckeditorerror.js +0 -187
  13. package/src/collection.js +0 -620
  14. package/src/collectstylesheets.js +0 -52
  15. package/src/comparearrays.js +0 -47
  16. package/src/config.js +0 -167
  17. package/src/count.js +0 -25
  18. package/src/crc32.js +0 -61
  19. package/src/decodelicensekey.js +0 -30
  20. package/src/delay.js +0 -25
  21. package/src/diff.js +0 -115
  22. package/src/difftochanges.js +0 -79
  23. package/src/dom/createelement.js +0 -40
  24. package/src/dom/emittermixin.js +0 -237
  25. package/src/dom/findclosestscrollableancestor.js +0 -31
  26. package/src/dom/getancestors.js +0 -26
  27. package/src/dom/getborderwidths.js +0 -24
  28. package/src/dom/getcommonancestor.js +0 -25
  29. package/src/dom/getdatafromelement.js +0 -19
  30. package/src/dom/getpositionedancestor.js +0 -22
  31. package/src/dom/getrangefrommouseevent.js +0 -33
  32. package/src/dom/getvisualviewportoffset.js +0 -21
  33. package/src/dom/global.js +0 -35
  34. package/src/dom/indexof.js +0 -21
  35. package/src/dom/insertat.js +0 -17
  36. package/src/dom/iscomment.js +0 -13
  37. package/src/dom/isnode.js +0 -21
  38. package/src/dom/isrange.js +0 -13
  39. package/src/dom/istext.js +0 -13
  40. package/src/dom/isvalidattributename.js +0 -22
  41. package/src/dom/isvisible.js +0 -30
  42. package/src/dom/iswindow.js +0 -22
  43. package/src/dom/position.js +0 -322
  44. package/src/dom/rect.js +0 -498
  45. package/src/dom/remove.js +0 -18
  46. package/src/dom/resizeobserver.js +0 -134
  47. package/src/dom/scroll.js +0 -406
  48. package/src/dom/setdatainelement.js +0 -19
  49. package/src/dom/tounit.js +0 -16
  50. package/src/elementreplacer.js +0 -47
  51. package/src/emittermixin.js +0 -443
  52. package/src/env.js +0 -158
  53. package/src/eventinfo.js +0 -63
  54. package/src/fastdiff.js +0 -248
  55. package/src/first.js +0 -17
  56. package/src/focustracker.js +0 -329
  57. package/src/formathtml.js +0 -164
  58. package/src/index.js +0 -78
  59. package/src/inserttopriorityarray.js +0 -28
  60. package/src/isfeatureblockedbylicensekey.js +0 -17
  61. package/src/isiterable.js +0 -16
  62. package/src/keyboard.js +0 -256
  63. package/src/keystrokehandler.js +0 -126
  64. package/src/language.js +0 -21
  65. package/src/legacyerrors.js +0 -18
  66. package/src/locale.js +0 -135
  67. package/src/mapsequal.js +0 -27
  68. package/src/mix.js +0 -5
  69. package/src/nth.js +0 -24
  70. package/src/objecttomap.js +0 -27
  71. package/src/observablemixin.js +0 -575
  72. package/src/parsebase64encodedobject.js +0 -22
  73. package/src/priorities.js +0 -22
  74. package/src/retry.js +0 -48
  75. package/src/splicearray.js +0 -37
  76. package/src/spy.js +0 -21
  77. package/src/toarray.js +0 -7
  78. package/src/tomap.js +0 -29
  79. package/src/translation-service.js +0 -209
  80. package/src/uid.js +0 -45
  81. package/src/unicode.js +0 -85
  82. package/src/version.js +0 -177
  83. package/src/wait.js +0 -29
  84. /package/{src → dist}/abortabledebounce.d.ts +0 -0
  85. /package/{src → dist}/areconnectedthroughproperties.d.ts +0 -0
  86. /package/{src → dist}/ckeditorerror.d.ts +0 -0
  87. /package/{src → dist}/collection.d.ts +0 -0
  88. /package/{src → dist}/collectstylesheets.d.ts +0 -0
  89. /package/{src → dist}/comparearrays.d.ts +0 -0
  90. /package/{src → dist}/config.d.ts +0 -0
  91. /package/{src → dist}/count.d.ts +0 -0
  92. /package/{src → dist}/crc32.d.ts +0 -0
  93. /package/{src → dist}/decodelicensekey.d.ts +0 -0
  94. /package/{src → dist}/delay.d.ts +0 -0
  95. /package/{src → dist}/diff.d.ts +0 -0
  96. /package/{src → dist}/difftochanges.d.ts +0 -0
  97. /package/{src → dist}/dom/createelement.d.ts +0 -0
  98. /package/{src → dist}/dom/emittermixin.d.ts +0 -0
  99. /package/{src → dist}/dom/findclosestscrollableancestor.d.ts +0 -0
  100. /package/{src → dist}/dom/getancestors.d.ts +0 -0
  101. /package/{src → dist}/dom/getborderwidths.d.ts +0 -0
  102. /package/{src → dist}/dom/getcommonancestor.d.ts +0 -0
  103. /package/{src → dist}/dom/getdatafromelement.d.ts +0 -0
  104. /package/{src → dist}/dom/getpositionedancestor.d.ts +0 -0
  105. /package/{src → dist}/dom/getrangefrommouseevent.d.ts +0 -0
  106. /package/{src → dist}/dom/getvisualviewportoffset.d.ts +0 -0
  107. /package/{src → dist}/dom/indexof.d.ts +0 -0
  108. /package/{src → dist}/dom/insertat.d.ts +0 -0
  109. /package/{src → dist}/dom/iscomment.d.ts +0 -0
  110. /package/{src → dist}/dom/isnode.d.ts +0 -0
  111. /package/{src → dist}/dom/isrange.d.ts +0 -0
  112. /package/{src → dist}/dom/istext.d.ts +0 -0
  113. /package/{src → dist}/dom/isvalidattributename.d.ts +0 -0
  114. /package/{src → dist}/dom/isvisible.d.ts +0 -0
  115. /package/{src → dist}/dom/iswindow.d.ts +0 -0
  116. /package/{src → dist}/dom/position.d.ts +0 -0
  117. /package/{src → dist}/dom/remove.d.ts +0 -0
  118. /package/{src → dist}/dom/resizeobserver.d.ts +0 -0
  119. /package/{src → dist}/dom/scroll.d.ts +0 -0
  120. /package/{src → dist}/dom/setdatainelement.d.ts +0 -0
  121. /package/{src → dist}/dom/tounit.d.ts +0 -0
  122. /package/{src → dist}/elementreplacer.d.ts +0 -0
  123. /package/{src → dist}/emittermixin.d.ts +0 -0
  124. /package/{src → dist}/env.d.ts +0 -0
  125. /package/{src → dist}/eventinfo.d.ts +0 -0
  126. /package/{src → dist}/fastdiff.d.ts +0 -0
  127. /package/{src → dist}/first.d.ts +0 -0
  128. /package/{src → dist}/focustracker.d.ts +0 -0
  129. /package/{src → dist}/formathtml.d.ts +0 -0
  130. /package/{src → dist}/index.d.ts +0 -0
  131. /package/{src → dist}/inserttopriorityarray.d.ts +0 -0
  132. /package/{src → dist}/isfeatureblockedbylicensekey.d.ts +0 -0
  133. /package/{src → dist}/isiterable.d.ts +0 -0
  134. /package/{src → dist}/keyboard.d.ts +0 -0
  135. /package/{src → dist}/keystrokehandler.d.ts +0 -0
  136. /package/{src → dist}/language.d.ts +0 -0
  137. /package/{src → dist}/legacyerrors.d.ts +0 -0
  138. /package/{src → dist}/locale.d.ts +0 -0
  139. /package/{src → dist}/mapsequal.d.ts +0 -0
  140. /package/{src → dist}/mix.d.ts +0 -0
  141. /package/{src → dist}/nth.d.ts +0 -0
  142. /package/{src → dist}/objecttomap.d.ts +0 -0
  143. /package/{src → dist}/observablemixin.d.ts +0 -0
  144. /package/{src → dist}/parsebase64encodedobject.d.ts +0 -0
  145. /package/{src → dist}/priorities.d.ts +0 -0
  146. /package/{src → dist}/retry.d.ts +0 -0
  147. /package/{src → dist}/splicearray.d.ts +0 -0
  148. /package/{src → dist}/spy.d.ts +0 -0
  149. /package/{src → dist}/toarray.d.ts +0 -0
  150. /package/{src → dist}/tomap.d.ts +0 -0
  151. /package/{src → dist}/translation-service.d.ts +0 -0
  152. /package/{src → dist}/uid.d.ts +0 -0
  153. /package/{src → dist}/unicode.d.ts +0 -0
  154. /package/{src → dist}/wait.d.ts +0 -0
@@ -1,322 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- /**
6
- * @module utils/dom/position
7
- */
8
- import { global } from './global.js';
9
- import { Rect } from './rect.js';
10
- import { getPositionedAncestor } from './getpositionedancestor.js';
11
- import { isFunction } from 'es-toolkit/compat';
12
- // @if CK_DEBUG_POSITION // const {
13
- // @if CK_DEBUG_POSITION // default: RectDrawer,
14
- // @if CK_DEBUG_POSITION // diagonalStylesBlack,
15
- // @if CK_DEBUG_POSITION // diagonalStylesGreen,
16
- // @if CK_DEBUG_POSITION // diagonalStylesRed
17
- // @if CK_DEBUG_POSITION // } = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' );
18
- // @if CK_DEBUG_POSITION // const TARGET_RECT_STYLE = {
19
- // @if CK_DEBUG_POSITION // outlineWidth: '2px', outlineStyle: 'dashed', outlineColor: 'blue', outlineOffset: '2px'
20
- // @if CK_DEBUG_POSITION // };
21
- // @if CK_DEBUG_POSITION // const VISIBLE_TARGET_RECT_STYLE = {
22
- // @if CK_DEBUG_POSITION // ...diagonalStylesBlack,
23
- // @if CK_DEBUG_POSITION // opacity: '1',
24
- // @if CK_DEBUG_POSITION // backgroundColor: '#00000033',
25
- // @if CK_DEBUG_POSITION // outlineWidth: '2px'
26
- // @if CK_DEBUG_POSITION // };
27
- // @if CK_DEBUG_POSITION // const VIEWPORT_RECT_STYLE = {
28
- // @if CK_DEBUG_POSITION // outlineWidth: '2px',
29
- // @if CK_DEBUG_POSITION // outlineOffset: '-2px',
30
- // @if CK_DEBUG_POSITION // outlineStyle: 'solid',
31
- // @if CK_DEBUG_POSITION // outlineColor: 'red'
32
- // @if CK_DEBUG_POSITION // };
33
- // @if CK_DEBUG_POSITION // const VISIBLE_LIMITER_RECT_STYLE = {
34
- // @if CK_DEBUG_POSITION // ...diagonalStylesGreen,
35
- // @if CK_DEBUG_POSITION // outlineWidth: '2px',
36
- // @if CK_DEBUG_POSITION // outlineOffset: '-2px'
37
- // @if CK_DEBUG_POSITION // };
38
- // @if CK_DEBUG_POSITION // const ELEMENT_RECT_STYLE = {
39
- // @if CK_DEBUG_POSITION // outlineWidth: '2px', outlineColor: 'orange', outlineOffset: '-2px'
40
- // @if CK_DEBUG_POSITION // };
41
- // @if CK_DEBUG_POSITION // const CHOSEN_POSITION_RECT_STYLE = {
42
- // @if CK_DEBUG_POSITION // opacity: .5, outlineColor: 'magenta', backgroundColor: 'magenta'
43
- // @if CK_DEBUG_POSITION // };
44
- /**
45
- * Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the
46
- * target in the visually most efficient way, taking various restrictions like viewport or limiter geometry
47
- * into consideration.
48
- *
49
- * **Note**: If there are no position coordinates found that meet the requirements (arguments of this helper),
50
- * `null` is returned.
51
- *
52
- * ```ts
53
- * // The element which is to be positioned.
54
- * const element = document.body.querySelector( '#toolbar' );
55
- *
56
- * // A target to which the element is positioned relatively.
57
- * const target = document.body.querySelector( '#container' );
58
- *
59
- * // Finding the optimal coordinates for the positioning.
60
- * const { left, top, name } = getOptimalPosition( {
61
- * element: element,
62
- * target: target,
63
- *
64
- * // The algorithm will chose among these positions to meet the requirements such
65
- * // as "limiter" element or "fitInViewport", set below. The positions are considered
66
- * // in the order of the array.
67
- * positions: [
68
- * //
69
- * // [ Target ]
70
- * // +-----------------+
71
- * // | Element |
72
- * // +-----------------+
73
- * //
74
- * targetRect => ( {
75
- * top: targetRect.bottom,
76
- * left: targetRect.left,
77
- * name: 'mySouthEastPosition'
78
- * } ),
79
- *
80
- * //
81
- * // +-----------------+
82
- * // | Element |
83
- * // +-----------------+
84
- * // [ Target ]
85
- * //
86
- * ( targetRect, elementRect ) => ( {
87
- * top: targetRect.top - elementRect.height,
88
- * left: targetRect.left,
89
- * name: 'myNorthEastPosition'
90
- * } )
91
- * ],
92
- *
93
- * // Find a position such guarantees the element remains within visible boundaries of <body>.
94
- * limiter: document.body,
95
- *
96
- * // Find a position such guarantees the element remains within visible boundaries of the browser viewport.
97
- * fitInViewport: true
98
- * } );
99
- *
100
- * // The best position which fits into document.body and the viewport. May be useful
101
- * // to set proper class on the `element`.
102
- * console.log( name ); // -> "myNorthEastPosition"
103
- *
104
- * // Using the absolute coordinates which has been found to position the element
105
- * // as in the diagram depicting the "myNorthEastPosition" position.
106
- * element.style.top = top;
107
- * element.style.left = left;
108
- * ```
109
- *
110
- * @param options The input data and configuration of the helper.
111
- */
112
- export function getOptimalPosition({ element, target, positions, limiter, fitInViewport, viewportOffsetConfig }) {
113
- // If the {@link module:utils/dom/position~Options#target} is a function, use what it returns.
114
- // https://github.com/ckeditor/ckeditor5-utils/issues/157
115
- if (isFunction(target)) {
116
- target = target();
117
- }
118
- // If the {@link module:utils/dom/position~Options#limiter} is a function, use what it returns.
119
- // https://github.com/ckeditor/ckeditor5-ui/issues/260
120
- if (isFunction(limiter)) {
121
- limiter = limiter();
122
- }
123
- const positionedElementAncestor = getPositionedAncestor(element);
124
- const constrainedViewportRect = getConstrainedViewportRect(viewportOffsetConfig);
125
- const elementRect = new Rect(element);
126
- const visibleTargetRect = getVisibleViewportIntersectionRect(target, constrainedViewportRect);
127
- let bestPosition;
128
- // @if CK_DEBUG_POSITION // const targetRect = new Rect( target );
129
- // @if CK_DEBUG_POSITION // RectDrawer.clear();
130
- // @if CK_DEBUG_POSITION // RectDrawer.draw( targetRect, TARGET_RECT_STYLE, 'Target' );
131
- // @if CK_DEBUG_POSITION // if ( constrainedViewportRect ) {
132
- // @if CK_DEBUG_POSITION // RectDrawer.draw( constrainedViewportRect, VIEWPORT_RECT_STYLE, 'Viewport' );
133
- // @if CK_DEBUG_POSITION // }
134
- // If the target got cropped by ancestors or went off the screen, positioning does not make any sense.
135
- if (!visibleTargetRect || !constrainedViewportRect.getIntersection(visibleTargetRect)) {
136
- return null;
137
- }
138
- // @if CK_DEBUG_POSITION // RectDrawer.draw( visibleTargetRect, VISIBLE_TARGET_RECT_STYLE, 'VisTgt' );
139
- const positionOptions = {
140
- targetRect: visibleTargetRect,
141
- elementRect,
142
- positionedElementAncestor,
143
- viewportRect: constrainedViewportRect
144
- };
145
- // If there are no limits, just grab the very first position and be done with that drama.
146
- if (!limiter && !fitInViewport) {
147
- bestPosition = new PositionObject(positions[0], positionOptions);
148
- }
149
- else {
150
- if (limiter) {
151
- const visibleLimiterRect = getVisibleViewportIntersectionRect(limiter, constrainedViewportRect);
152
- if (visibleLimiterRect) {
153
- positionOptions.limiterRect = visibleLimiterRect;
154
- // @if CK_DEBUG_POSITION // RectDrawer.draw( visibleLimiterRect, VISIBLE_LIMITER_RECT_STYLE, 'VisLim' );
155
- }
156
- }
157
- // If there's no best position found, i.e. when all intersections have no area because
158
- // rects have no width or height, then just return `null`
159
- bestPosition = getBestPosition(positions, positionOptions);
160
- }
161
- return bestPosition;
162
- }
163
- /**
164
- * Returns intersection of visible source `Rect` with Viewport `Rect`. In case when source `Rect` is not visible
165
- * or there is no intersection between source `Rect` and Viewport `Rect`, `null` will be returned.
166
- */
167
- function getVisibleViewportIntersectionRect(source, viewportRect) {
168
- const visibleSourceRect = new Rect(source).getVisible();
169
- if (!visibleSourceRect) {
170
- return null;
171
- }
172
- return visibleSourceRect.getIntersection(viewportRect);
173
- }
174
- /**
175
- * Returns a viewport `Rect` shrunk by the viewport offset config from all sides.
176
- */
177
- export function getConstrainedViewportRect(viewportOffsetConfig) {
178
- viewportOffsetConfig = Object.assign({ top: 0, bottom: 0, left: 0, right: 0 }, viewportOffsetConfig);
179
- const viewportRect = new Rect(global.window);
180
- viewportRect.top += viewportOffsetConfig.top;
181
- viewportRect.height -= viewportOffsetConfig.top;
182
- viewportRect.bottom -= viewportOffsetConfig.bottom;
183
- viewportRect.height -= viewportOffsetConfig.bottom;
184
- viewportRect.left += viewportOffsetConfig.left;
185
- viewportRect.right -= viewportOffsetConfig.right;
186
- viewportRect.width -= viewportOffsetConfig.left + viewportOffsetConfig.right;
187
- return viewportRect;
188
- }
189
- /**
190
- * For a given array of positioning functions, returns such that provides the best
191
- * fit of the `elementRect` into the `limiterRect` and `viewportRect`.
192
- */
193
- function getBestPosition(positions, options) {
194
- const { elementRect } = options;
195
- // This is when element is fully visible.
196
- const elementRectArea = elementRect.getArea();
197
- const positionInstances = positions
198
- .map(positioningFunction => new PositionObject(positioningFunction, options))
199
- // Some positioning functions may return `null` if they don't want to participate.
200
- .filter(position => !!position.name);
201
- let maxFitFactor = 0;
202
- let bestPosition = null;
203
- for (const position of positionInstances) {
204
- const { limiterIntersectionArea, viewportIntersectionArea } = position;
205
- // If a such position is found that element is fully contained by the limiter then, obviously,
206
- // there will be no better one, so finishing.
207
- if (limiterIntersectionArea === elementRectArea) {
208
- // @if CK_DEBUG_POSITION // RectDrawer.draw( position._rect, CHOSEN_POSITION_RECT_STYLE, [
209
- // @if CK_DEBUG_POSITION // position.name,
210
- // @if CK_DEBUG_POSITION // '100% fit',
211
- // @if CK_DEBUG_POSITION // ].join( '\n' ) );
212
- return position;
213
- }
214
- // To maximize both viewport and limiter intersection areas we use distance on _viewportIntersectionArea
215
- // and _limiterIntersectionArea plane (without sqrt because we are looking for max value).
216
- const fitFactor = viewportIntersectionArea ** 2 + limiterIntersectionArea ** 2;
217
- // @if CK_DEBUG_POSITION // RectDrawer.draw( position._rect, { opacity: .4 }, [
218
- // @if CK_DEBUG_POSITION // position.name,
219
- // @if CK_DEBUG_POSITION // 'Vi=' + Math.round( viewportIntersectionArea ),
220
- // @if CK_DEBUG_POSITION // 'Li=' + Math.round( limiterIntersectionArea )
221
- // @if CK_DEBUG_POSITION // ].join( '\n' ) );
222
- if (fitFactor > maxFitFactor) {
223
- maxFitFactor = fitFactor;
224
- bestPosition = position;
225
- }
226
- }
227
- // @if CK_DEBUG_POSITION // if ( bestPosition ) {
228
- // @if CK_DEBUG_POSITION // RectDrawer.draw( bestPosition._rect, CHOSEN_POSITION_RECT_STYLE );
229
- // @if CK_DEBUG_POSITION // }
230
- return bestPosition;
231
- }
232
- /**
233
- * A position class which instances are created and used by the {@link module:utils/dom/position~getOptimalPosition} helper.
234
- *
235
- * {@link module:utils/dom/position~Position#top} and {@link module:utils/dom/position~Position#left} properties of the position instance
236
- * translate directly to the `top` and `left` properties in CSS "`position: absolute` coordinate system". If set on the positioned element
237
- * in DOM, they will make it display it in the right place in the viewport.
238
- */
239
- class PositionObject {
240
- name;
241
- config;
242
- _positioningFunctionCoordinates;
243
- _options;
244
- _cachedRect;
245
- _cachedAbsoluteRect;
246
- /**
247
- * Creates an instance of the {@link module:utils/dom/position~PositionObject} class.
248
- *
249
- * @param positioningFunction function The function that defines the expected
250
- * coordinates the positioned element should move to.
251
- * @param options options object.
252
- * @param options.elementRect The positioned element rect.
253
- * @param options.targetRect The target element rect.
254
- * @param options.viewportRect The viewport rect.
255
- * @param options.limiterRect The limiter rect.
256
- * @param options.positionedElementAncestor Nearest element ancestor element which CSS position is not "static".
257
- */
258
- constructor(positioningFunction, options) {
259
- const positioningFunctionOutput = positioningFunction(options.targetRect, options.elementRect, options.viewportRect, options.limiterRect);
260
- // Nameless position for a function that didn't participate.
261
- if (!positioningFunctionOutput) {
262
- return;
263
- }
264
- const { left, top, name, config } = positioningFunctionOutput;
265
- this.name = name;
266
- this.config = config;
267
- this._positioningFunctionCoordinates = { left, top };
268
- this._options = options;
269
- }
270
- /**
271
- * The left value in pixels in the CSS `position: absolute` coordinate system.
272
- * Set it on the positioned element in DOM to move it to the position.
273
- */
274
- get left() {
275
- return this._absoluteRect.left;
276
- }
277
- /**
278
- * The top value in pixels in the CSS `position: absolute` coordinate system.
279
- * Set it on the positioned element in DOM to move it to the position.
280
- */
281
- get top() {
282
- return this._absoluteRect.top;
283
- }
284
- /**
285
- * An intersection area between positioned element and limiter within viewport constraints.
286
- */
287
- get limiterIntersectionArea() {
288
- const limiterRect = this._options.limiterRect;
289
- if (limiterRect) {
290
- return limiterRect.getIntersectionArea(this._rect);
291
- }
292
- return 0;
293
- }
294
- /**
295
- * An intersection area between positioned element and viewport.
296
- */
297
- get viewportIntersectionArea() {
298
- const viewportRect = this._options.viewportRect;
299
- return viewportRect.getIntersectionArea(this._rect);
300
- }
301
- /**
302
- * An already positioned element rect. A clone of the element rect passed to the constructor
303
- * but placed in the viewport according to the positioning function.
304
- */
305
- get _rect() {
306
- if (this._cachedRect) {
307
- return this._cachedRect;
308
- }
309
- this._cachedRect = this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left, this._positioningFunctionCoordinates.top);
310
- return this._cachedRect;
311
- }
312
- /**
313
- * An already absolutely positioned element rect. See ({@link #_rect}).
314
- */
315
- get _absoluteRect() {
316
- if (this._cachedAbsoluteRect) {
317
- return this._cachedAbsoluteRect;
318
- }
319
- this._cachedAbsoluteRect = this._rect.toAbsoluteRect();
320
- return this._cachedAbsoluteRect;
321
- }
322
- }