Module org.htmlunit

Class HtmlStyle

All Implemented Interfaces:
Serializable, Cloneable, Element, Node

public class HtmlStyle extends HtmlElement
Wrapper for the HTML element "style".
Author:
Mike Bowler, Christian Sell, Marc Guillemot, Ahmed Ashour, Frank Danek, Ronald Brill
See Also:
  • Field Details

  • Method Details

    • getTypeAttribute

      public final String getTypeAttribute()
      Returns the value of the attribute type. Refer to the HTML 4.01 documentation for details on the use of this attribute.
      Returns:
      the value of the attribute type or an empty string if that attribute isn't defined
    • setTypeAttribute

      public final void setTypeAttribute(String type)
      Sets the value of the attribute type.
      Parameters:
      type - the new type
    • getMediaAttribute

      public final String getMediaAttribute()
      Returns the value of the attribute media. Refer to the HTML 4.01 documentation for details on the use of this attribute.
      Returns:
      the value of the attribute media or an empty string if that attribute isn't defined
    • getTitleAttribute

      public final String getTitleAttribute()
      Returns the value of the attribute title. Refer to the HTML 4.01 documentation for details on the use of this attribute.
      Returns:
      the value of the attribute title or an empty string if that attribute isn't defined
    • onAllChildrenAddedToPage

      public void onAllChildrenAddedToPage(boolean postponed)
      Lifecycle method invoked after a node and all its children have been added to a page, during parsing of the HTML. Intended to be overridden by nodes which need to perform custom logic after they and all their child nodes have been processed by the HTML parser. This method is not recursive, and the default implementation is empty, so there is no need to call super.onAllChildrenAddedToPage() if you implement this method. Like the browsers, the content is checked against the Content-Security-Policy when the style element is added to the page.
      Overrides:
      onAllChildrenAddedToPage in class DomNode
      Parameters:
      postponed - whether to use PostponedAction or no
    • getDefaultStyleDisplay

      public HtmlElement.DisplayStyle getDefaultStyleDisplay()
      INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
      Returns the default display style.
      Overrides:
      getDefaultStyleDisplay in class HtmlElement
      Returns:
      the default display style
    • mayBeDisplayed

      public boolean mayBeDisplayed()
      Returns true if nodes of this type can ever be displayed, false otherwise. Examples of nodes that can never be displayed are <head>, <meta>, <script>, etc.
      Overrides:
      mayBeDisplayed in class DomNode
      Returns:
      true if nodes of this type can ever be displayed, false otherwise
      See Also:
    • getSheet

      public CssStyleSheet getSheet()
      Return the referenced style sheet.
      Returns:
      the referenced style sheet