BlueprintPosition

Type: Class

How to get BlueprintPosition?

JavaScript

import BlueprintPosition from 'fontoxml-blueprints/src/BlueprintPosition.js'

A blueprintPosition represents a position under a Node, in the DOM. Unlike ranges, it is not updated by dom changes: an offset which is out of range for the containing node is accepted.

Use the static from* functions to create an instance of a BlueprintPosition.

Constructor arguments

  1. parentNode

    (Required)

    Type: Node

  2. offset

    (Required)

    Type: Number

  3. blueprint

    (Required)

    Type: Blueprint

Properties

container

Type: Node

The container of this position

Returns

data

Type: String

The data of the container of this position, if it is inside a data node

Returns

nextSibling

Type: Node | NULL

The node after this position

Returns

offset

Type: Number

The offset of this position

Returns

parentNode

Type: Node

The container of this position

Returns

previousSibling

Type: Node | NULL

The node before this position

Returns

Methods

clone

Type: Function

Clone this position

Returns

setAfter

Type: Function

Move this position to be after the given node

Arguments

Returns

setAtBegin

Type: Function

Move this position to be at the begin of the given node

Arguments

Returns

setAtEnd

Type: Function

Move this position to be at the end of the given node

Arguments

Returns

setAtOffset

Type: Function

Move this position to be at the given offset

Arguments

Returns

setBefore

Type: Function

Move this position to be before the given node

Arguments

Returns

setRelativeToNodes

Type: Function

Move this position to be before the given reference node

Arguments

Returns

Static properties

fromOffset

Type: Function

Create a BlueprintPosition from an offset

Arguments

Returns

fromRangeEnd

Type: Function

Create a BlueprintPosition positioned at the end of the given range

Arguments

Returns

fromRangeStart

Type: Function

Create a BlueprintPosition positioned at the start of the given range

Arguments

Returns

fromReferenceNode

Type: Function

Create a BlueprintPosition from a reference node.

Arguments

Returns