Class HtmlBody

All Implemented Interfaces:
Serializable, Cloneable, Element, Node

public class HtmlBody extends HtmlElement
Wrapper for the HTML element "body".
See Also:
  • Field Details

  • Constructor Details

    • HtmlBody

      public HtmlBody(String qualifiedName, SgmlPage page, Map<String,DomAttr> attributes, boolean temporary)
      Creates a new instance.
      Parameters:
      qualifiedName - the qualified name of the element type to instantiate
      page - the page that contains this element
      attributes - the initial attributes
      temporary - whether or not this body is temporary (created because the body tag does not exist or has not yet been parsed)
  • Method Details

    • getOnLoadAttribute

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

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

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

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

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

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

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

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

      public final boolean isTemporary()
      Returns true if this body is temporary (created because the body tag has not yet been parsed).
      Returns:
      true if this body is temporary (created because the body tag has not yet been parsed)
    • handles

      public boolean handles(org.htmlunit.javascript.host.event.Event event)
      Indicates if the provided event can be applied to this node. Overwrite this.
      Overrides:
      handles in class HtmlElement
      Parameters:
      event - the event
      Returns:
      false if the event can't be applied
    • setDefaults

      public void setDefaults(org.htmlunit.css.ComputedCssStyleDeclaration style)
      Callback method which allows different HTML element types to perform custom initialization of computed styles. For example, body elements in most browsers have default values for their margins.
      Overrides:
      setDefaults in class DomElement
      Parameters:
      style - the style to initialize