Interface

ElementAttributeValue (engine/view)

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

interface

Common interface for a TokenList 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 DowncastWriter while down-casting an AttributeElement to merge it with other AttributeElement.

    Parameters

    other : ElementAttributeValue

    Returns

    boolean
  • _clone() → ElementAttributeValue

    Clones the attribute value.

    Returns

    ElementAttributeValue
  • _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 DowncastWriter while down-casting an AttributeElement to unwrap the AttributeElement.

    Parameters

    other : ElementAttributeValue

    Returns

    boolean
  • _mergeFrom( other ) → void

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

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

    Parameters

    other : ElementAttributeValue

    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 : ElementAttributeValue

    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 : ArrayOrItem<string> | Styles

    Returns

    void
  • set( name, value ) → void

    Sets a given style property and value.

    Parameters

    name : string
    value : StyleValue

    Returns

    void
  • setTo( value ) → ElementAttributeValue

    Resets the value to the given one.

    Parameters

    value : string

    Returns

    ElementAttributeValue
  • toString() → string

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

    Returns

    string