Class HTMLImageElement

All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class HTMLImageElement extends HTMLElement
The JavaScript object HTMLImageElement.
See Also:
  • Field Details

    • NORMALIZED_ALIGN_VALUES

      private static final Map<String,String> NORMALIZED_ALIGN_VALUES
    • endTagForbidden_

      private boolean endTagForbidden_
  • Constructor Details

    • HTMLImageElement

      public HTMLImageElement()
  • Method Details

    • jsConstructor

      public void jsConstructor()
      JavaScript constructor.
      Overrides:
      jsConstructor in class HTMLElement
    • jsConstructorImage

      public void jsConstructorImage()
      JavaScript constructor.
    • setDomNode

      public void setDomNode(DomNode domNode)
      Sets the DOM node that corresponds to this JavaScript object.
      Overrides:
      setDomNode in class HTMLElement
      Parameters:
      domNode - the DOM node
    • setSrc

      public void setSrc(String src)
      Sets the src attribute.
      Parameters:
      src - the src attribute value
    • getSrc

      public String getSrc()
      Returns the value of the src attribute.
      Returns:
      the value of the src attribute
    • setOnload

      public void setOnload(Object onload)
      Sets the onload event handler for this element.
      Overrides:
      setOnload in class HTMLElement
      Parameters:
      onload - the onload event handler for this element
    • getAlt

      public String getAlt()
      Returns the value of the alt property.
      Returns:
      the value of the alt property
    • setAlt

      public void setAlt(String alt)
      Sets the value of the alt property.
      Parameters:
      alt - the value
    • getBorder

      public String getBorder()
      Gets the border attribute.
      Returns:
      the border attribute
    • setBorder

      public void setBorder(String border)
      Sets the border attribute.
      Parameters:
      border - the border attribute
    • getAlign

      public String getAlign()
      Returns the value of the align property.
      Returns:
      the value of the align property
    • setAlign

      public void setAlign(String align)
      Sets the value of the align property.
      Parameters:
      align - the value of the align property
    • getWidth

      public int getWidth()
      Returns the value of the width property.
      Returns:
      the value of the width property
    • setWidth

      public void setWidth(String width)
      Sets the value of the width property.
      Parameters:
      width - the value of the width property
    • getHeight

      public int getHeight()
      Returns the value of the height property.
      Returns:
      the value of the height property
    • setHeight

      public void setHeight(String height)
      Sets the value of the height property.
      Parameters:
      height - the value of the height property
    • isEndTagForbidden

      protected boolean isEndTagForbidden()
      Returns whether the end tag is forbidden or not.
      Overrides:
      isEndTagForbidden in class HTMLElement
      Returns:
      whether the end tag is forbidden or not
      See Also:
    • isComplete

      public boolean isComplete()
      Support for the image.complete property.
      Returns:
      the value of the complete property
    • getNaturalWidth

      public int getNaturalWidth()
      Returns the value of the naturalWidth property.
      Returns:
      the value of the naturalWidth property
    • getNaturalHeight

      public int getNaturalHeight()
      Returns the value of the naturalHeight property.
      Returns:
      the value of the naturalHeight property
    • getName

      public String getName()
      Returns the name attribute.
      Overrides:
      getName in class HTMLElement
      Returns:
      the name attribute
    • setName

      public void setName(String name)
      Sets the name attribute.
      Overrides:
      setName in class HTMLElement
      Parameters:
      name - the name attribute