Class HTMLImageElement

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    Serialized Form
    • Field Detail

      • NORMALIZED_ALIGN_VALUES

        private static final java.util.Map<java.lang.String,​java.lang.String> NORMALIZED_ALIGN_VALUES
      • endTagForbidden_

        private boolean endTagForbidden_
    • Constructor Detail

      • HTMLImageElement

        public HTMLImageElement()
    • Method Detail

      • 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​(java.lang.String src)
        Sets the src attribute.
        Parameters:
        src - the src attribute value
      • getSrc

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

        public void setOnload​(java.lang.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 java.lang.String getAlt()
        Returns the value of the alt property.
        Returns:
        the value of the alt property
      • setAlt

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

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

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

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

        public void setAlign​(java.lang.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​(java.lang.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​(java.lang.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:
        HTML 4 specs
      • 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 java.lang.String getName()
        Returns the name attribute.
        Overrides:
        getName in class HTMLElement
        Returns:
        the name attribute
      • setName

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