Interface DocumentCSSStyleSheet

All Superinterfaces:
CSSStyleSheet<AbstractCSSRule>, CSSStyleSheet, StyleSheet
All Known Implementing Classes:
BaseDocumentCSSStyleSheet, DOMDocumentCSSStyleSheet

public interface DocumentCSSStyleSheet extends CSSStyleSheet<AbstractCSSRule>
A style sheet that is able to take the responsibility to compute the styles associated to document elements.

Accordingly, it has a target medium (which can be null) and has abilities that 'normal' style sheets do not have, like dealing with rules that have different origins (author, user, etc).

  • Method Details

    • getTargetMedium

      String getTargetMedium()
      Gets the target medium for this sheet.
      Returns:
      the target medium, or null if has not been set.
    • getComputedStyle

      CSSComputedProperties getComputedStyle(CSSElement elm, Condition pseudoElt)
      Gets the computed style for the given Element and pseudo-element in the DOM Document associated to this style sheet.
      Parameters:
      elm - the element.
      pseudoElt - the pseudo-element condition.
      Returns:
      the computed style declaration.
    • registerProperty

      void registerProperty(CSSPropertyDefinition definition)
      Registers the definition of a custom property.
      Parameters:
      definition - the definition.
    • clone

      Clone this style sheet.
      Specified by:
      clone in interface CSSStyleSheet<AbstractCSSRule>
      Returns:
      the cloned style sheet.
    • clone

      DocumentCSSStyleSheet clone(String targetMedium)
      Clone this style sheet, but only preserving rules targeting the given medium.
      Parameters:
      targetMedium - the medium.
      Returns:
      a medium-specific pseudo-clone of this sheet.