MCPcopy Create free account
hub / github.com/Alphanimble/htmlstream / readRect

Function readRect

src/stream-caret.ts:133–141  ·  view source on GitHub ↗
(
  range: Range,
  fallback: Element,
)

Source from the content-addressed store, hash-verified

131}
132
133function readRect(
134 range: Range,
135 fallback: Element,
136): DOMRect | { width: number; height: number; left: number; top: number; right: number; bottom: number } {
137 if (typeof range.getBoundingClientRect === "function") {
138 return range.getBoundingClientRect();
139 }
140 return fallback.getBoundingClientRect();
141}
142
143function measureCaretPointFromRange(
144 host: HTMLElement,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected