Interface

ViewElementAttributeValue (engine/view)

@ckeditor/ckeditor5-engine/src/view/element

interface

Common interface for a ViewTokenList and StylesMap.

Filtering

Properties

  • readonly

    isEmpty : boolean

    Returns true if attribute has no value set.

  • readonly

    size : number

    Number of tokens (styles, classes or other tokens) defined.

Methods

  • _canMergeFrom( other ) → boolean

    Used by _canMergeAttributesFrom to verify if the given attribute can be merged without conflicts into the attribute.

    This method is indirectly used by the ViewDowncastWriter while down-casting an ViewAttributeElement to merge it with other ViewAttributeElement.

    Parameters

    other : this

    Returns

    boolean
  • _clone() → this

    Clones the attribute value.

    Returns

    this
  • _getConsumables( [ name ] ) → Array<string>

    Returns a list of consumables for the attribute. This includes related tokens (for example other forms of notation of the same style property).

    Could be filtered by the given token name (class name, style property, etc.).

    Parameters

    [ name ] : string

    Returns

    Array<string>
  • _getTokensMatch( tokenPattern, [ valuePattern ] ) → undefined | Array<string>

    Used by the Matcher to collect matching attribute tokens.

    Parameters

    tokenPattern : string | true | RegExp

    The matched token name pattern.

    [ valuePattern ] : string | true | RegExp

    The matched token value pattern.

    Returns

    undefined | Array<string>

    An array of matching tokens.

  • _isMatching( other ) → boolean

    Used by _canSubtractAttributesOf to verify if the given attribute can be fully subtracted from the attribute.

    This method is indirectly used by the ViewDowncastWriter while down-casting an ViewAttributeElement to unwrap the ViewAttributeElement.

    Parameters

    other : this

    Returns

    boolean
  • _mergeFrom( other ) → void

    Used by _mergeAttributesFrom to merge a given attribute into the attribute.

    This method is indirectly used by the ViewDowncastWriter while down-casting an ViewAttributeElement to merge it with other ViewAttributeElement.

    Parameters

    other : this

    Returns

    void
  • clear() → void

    Removes all tokens.

    Returns

    void
  • has( name ) → boolean

    Checks if a given token (style, class, token) is set.

    Parameters

    name : string

    Returns

    boolean
  • isSimilar( other ) → boolean

    Returns true if both attributes have the same content.

    Parameters

    other : this

    Returns

    boolean
  • keys() → Array<string>

    Returns all tokens (styles, classes, other tokens).

    Returns

    Array<string>
  • remove( tokens ) → void

    Removes given token (style, class, other token).

    Parameters

    tokens : ArrayOrItem<string>

    Returns

    void
  • set( stylesOrTokens ) → void

    Sets a given token (for style also a record of properties).

    Parameters

    stylesOrTokens : Styles | ArrayOrItem<string>

    Returns

    void
  • set( name, value ) → void

    Sets a given style property and value.

    Parameters

    name : string
    value : StyleValue

    Returns

    void
  • setTo( value ) → this

    Resets the value to the given one.

    Parameters

    value : string

    Returns

    this
  • toString() → string

    Returns a normalized tokens string (styles, classes, etc.).

    Returns

    string