The rectangle representing a line box or an element. Coordinates are in application viewport coordinate space.
Any transform applied to the ReaderView, such as the user pinch-zooming, will make this rectangle out of date.
Note that the height of this clientRect is not necessarily the same as the lineHeight.
The height calculation is publication format specific, for example in EPUB, the height of the box is
determined by the font ascent and descent.
ExperimentalclippedThe part of clientRect that remains after the publication elements in
IVisibleContentAreaRectsResult.clippingRects clip it, or undefined when they clip it away entirely.
It is clientRect intersected with every clipping rect along the chain that starts at clippingRectIndex.
Clipping rects with clipsX clip it horizontally, and those with clipsY clip it vertically. Only elements
inside the publication content clip. The page boundary, the content display area and the reading area do
not, so this rectangle may extend beyond them.
Content and clipping elements are measured separately, so an edge they share can differ by a tiny fraction of a pixel. A cut that small is ignored, so this rectangle can extend that far past a clipping rect. When clipping cuts a width or height down to that much or less, it is undefined.
Use clippedState to tell clipped content from unclipped content, and to learn whether clipping was computed.
Coordinates are in application viewport coordinate space. Any transform applied to the ReaderView, such as the user pinch-zooming, will make this rectangle out of date.
This API is experimental and might be subject to changes in future releases.
ExperimentalclippedHow publication elements clip this content, or UNKNOWN when clipping was not computed.
clippedClientRect for each state:
NOT_CLIPPED: equals clientRect.PARTIALLY_CLIPPED: a smaller part of clientRect.FULLY_CLIPPED: undefined.UNKNOWN: equals clientRect, whether or not the content is clipped.Only elements inside the publication content clip: elements whose overflow is not visible, and elements
with paint containment. The page boundary, the content display area and the reading area do not, so a
NOT_CLIPPED rect can still lie outside them. Clipping by body or the root element is not detected, and
neither are clip-path, mask and rounded corners.
Content and clipping elements are measured separately, so an edge they share can differ by a tiny fraction of a
pixel. Content inside a clipping element that extends past its edge by only that much is NOT_CLIPPED. Content
outside a clipping element that extends into it by only that much is FULLY_CLIPPED.
A line of text whose line box ends at the edge of a clipping element can be PARTIALLY_CLIPPED although none of
its glyphs are cut. The rect of a line spans the font's ascent and descent. When the line height is smaller than
that span, the rect reaches past the line box. Firefox makes these rects taller than Chromium does, so in Firefox
this also happens at common line heights.
Only IReaderViewVisibleContent.getContentRectsContainedInArea and
IReaderViewVisibleContent.getContentRectsIntersectingArea compute clipping, and only for EPUB
content. Rects from IVisiblePage.fetchContentRects and rects from other publication formats are
UNKNOWN.
This API is experimental and might be subject to changes in future releases.
ExperimentalclippingIndex into IVisibleContentAreaRectsResult.clippingRects of the nearest ancestor element that can clip
this content, or null when there is no such ancestor. The index is set whether or not that element clips this
rect. Use clippedState to learn whether the content is clipped.
Only the area-based visible-content APIs report clipping, so this is always null from IVisiblePage.fetchContentRects — see IVisibleContentRectsResult.clippingRects.
Indices are only valid against the clippingRects list of the IVisibleContentAreaRectsResult this
rect belongs to.
This API is experimental and might be subject to changes in future releases.
The content location that most closely matches the rectangle.
A JSON compatible data structure representing the underlying node from where the rectangle was generated, like for example an HTML Element in an HTML content-document.
You must pass IVisibleContentRectsOptions.includeNodeData = true to IVisiblePage.fetchContentRects
for this field to be set.
It is always undefined in PDF content, and in rects from IReaderViewVisibleContent.getContentRectsContainedInArea and IReaderViewVisibleContent.getContentRectsIntersectingArea.
Describes if this object represents a LINE_BOX or an ELEMENT.
Use nodeData to get more information about the type of Element.
Get this instance as a JSON Serializable object.
Contains the rectangle and content location of a line box or of an element, such as an
<img>.