Expand all

ve.ce.LinearSelection

Extends

Constructor

new ve.ce.LinearSelection(surface, model) #

Properties

getDirectionality #

Get the block directionality of the selection

Note: This is not the direction of the selection (e.g. ve.Range#isBackwards); it is the computed block-level CSS directionality. The actual directionality at any point within the selection depends on both this and the browser's implementation of BIDI algorithm.

Overrides:
Source:

Get the block directionality of the selection

Note: This is not the direction of the selection (e.g.

getSelectionBoundingRect #

Get the coordinates of the selection's bounding rectangle relative to the surface.

Overrides:
Source:
Get the coordinates of the selection's bounding rectangle relative to the surface.

getSelectionRects #

Get the rectangles of the selection relative to the surface.

Overrides:
Source:
Get the rectangles of the selection relative to the surface.

isFocusedNode #

Check if the selection covers a focused node

Overrides:
Source:
Check if the selection covers a focused node

isNativeCursor #

Check if the selection is a native cursor selection

Overrides:
Source:
Check if the selection is a native cursor selection

Methods

equals(other) → {boolean} #

Check if two selections are equal

Parameters:

Name Type Description
other ve.ce.Selection

Other selection

Inherited from:
Source:

Returns:

Selections are equal

Type
boolean
Check if two selections are equal

getModel() → {ve.dm.Selection} #

Get the selection model

Inherited from:
Source:

Returns:

Selection model

Type
ve.dm.Selection
Get the selection model

getNodeClientRectFromRange(range) → {Object|null}private #

Get a client rect from the range's end node

This function is used internally by getSelectionRects and getSelectionBoundingRect as a fallback when Range.getClientRects fails. The width is hard-coded to 0 as the function is used to locate the selection focus position.

Parameters:

Name Type Description
range Range

Range to get client rect for

Source:

Returns:

ClientRect-like object

Type
Object | null

Get a client rect from the range's end node

This function is used internally by getSelectionRects and getSelectionBoundingRect as a fallback when Range.getClientRects fails.

getSelectionFocusRect() → {Object|null} #

Get the rectangle for the selection's focus end

The default gives the bounding rectangle after using collapseToTo.

Overrides:
Source:

Returns:

Selection rectangle

Type
Object | null

Get the rectangle for the selection's focus end

The default gives the bounding rectangle after using collapseToTo.

getSelectionStartAndEndRects() → {Object.<string, Object>|null} #

Get the start and end rectangles of the selection relative to the surface.

Overrides:
Source:

Returns:

Start and end selection rectangles

Type
Object.<string, Object> | null
Get the start and end rectangles of the selection relative to the surface.

getSurface() → {ve.ce.Surface} #

Get the surface view this selection exists on

Inherited from:
Source:

Returns:

Surface view

Type
ve.ce.Surface
Get the surface view this selection exists on