htmlunit-2.7

dChildIfNoneExists("tbody");
      return ((RowContainer)getScriptableFor(tBody)).insertRow(0);
    }
    return super.insertRow(index);
  }
  
  public String jsxGet_width()
  {
    return getDomNodeOrDie().getAttribute("width");
  }
  
  public void jsxSet_width(String width)
  {
    getDomNodeOrDie().setAttribute("width", width);
  }
  
  public String jsxGet_cellSpacing()
  {
    return getDomNodeOrDie().getAttribute("cellspacing");
  }
  
  public void jsxSet_cellSpacing(String cellSpacing)
  {
    getDomNodeOrDie().setAttribute("cellspacing", cellSpacing);
  }
  
  public String jsxGet_cellPadding()
  {
    return getDomNodeOrDie().getAttribute("cellpadding");
  }
  
  public void jsxSet_cellPadding(String cellPadding)
  {
    getDomNodeOrDie().setAttribute("cellpadding", cellPadding);
  }
  
  public String jsxGet_border()
  {
    String border = getDomNodeOrDie().getAttribute("border");
    if (border == NOT_FOUND) {
      border = "";
    }
    return border;
  }
  
  public void jsxSet_border(String border)
  {
    getDomNodeOrDie().setAttribute("border", border);
  }
  
  public String jsxGet_bgColor()
  {
    return getDomNodeOrDie().getAttribute("bgColor");
  }
  
  public void jsxSet_bgColor(String bgColor)
  {
    setColorAttribute("bgColor", bgColor);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLTableElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.html.HtmlElement;
import net.sourceforge.htmlunit.corejs.javascript.Context;

public class HTMLFontElement
  extends HTMLElement
{
  private static final long serialVersionUID = 2438742206022221826L;
  
  public String jsxGet_color()
  {
    return getDomNodeOrDie().getAttribute("color");
  }
  
  public void jsxSet_color(String color)
  {
    getDomNodeOrDie().setAttribute("color", color);
  }
  
  public String jsxGet_face()
  {
    return getDomNodeOrDie().getAttribute("face");
  }
  
  public void jsxSet_face(String face)
  {
    getDomNodeOrDie().setAttribute("face", face);
  }
  
  public int jsxGet_size()
  {
    return (int)Context.toNumber(getDomNodeOrDie().getAttribute("size"));
  }
  
  public void jsxSet_size(int size)
  {
    getDomNodeOrDie().setAttribute("size", Context.toString(Integer.valueOf(size)));
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLFontElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.html.HtmlElement;

public class HTMLInsElement
  extends HTMLElement
{
  private static final long serialVersionUID = -650948293847730361L;
  
  public String jsxGet_cite()
  {
    String cite = getDomNodeOrDie().getAttribute("cite");
    if (cite == NOT_FOUND) {
      cite = "";
    }
    return cite;
  }
  
  public void jsxSet_cite(String cite)
  {
    getDomNodeOrDie().setAttribute("cite", cite);
  }
  
  public String jsxGet_dateTime()
  {
    String cite = getDomNodeOrDie().getAttribute("datetime");
    if (cite == NOT_FOUND) {
      cite = "";
    }
    return cite;
  }
  
  public void jsxSet_dateTime(String dateTime)
  {
    getDomNodeOrDie().setAttribute("datetime", dateTime);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLInsElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.html.HtmlElement;

public class HTMLBaseElement
  extends HTMLElement
{
  private static final long serialVersionUID = 1869359649341296910L;
  
  public String jsxGet_href()
  {
    return getDomNodeOrDie().getAttribute("href");
  }
  
  public void jsxSet_href(String href)
  {
    getDomNodeOrDie().setAttribute("href", href);
  }
  
  public String jsxGet_target()
  {
    return getDomNodeOrDie().getAttribute("target");
  }
  
  public void jsxSet_target(String target)
  {
    getDomNodeOrDie().setAttribute("target", target);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLBaseElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
import com.gargoylesoftware.htmlunit.html.InputElementFactory;
import com.gargoylesoftware.htmlunit.html.impl.SelectableTextInput;
import com.gargoylesoftware.htmlunit.javascript.host.FormField;
import org.apache.commons.lang.math.NumberUtils;
import org.xml.sax.helpers.AttributesImpl;

public class HTMLInputElement
  extends FormField
{
  private static final long serialVersionUID = 3712016051364495710L;
  
  public void jsConstructor() {}
  
  public void jsxSet_type(String newType)
  {
    HtmlInput input = getHtmlInputOrDie();
    if (!input.getTypeAttribute().equalsIgnoreCase(newType))
    {
      AttributesImpl attributes = readAttributes(input);
      int index = attributes.getIndex("type");
      attributes.setValue(index, newType);
      
      HtmlInput newInput = (HtmlInput)InputElementFactory.instance.createElement(input.getPage(), "input", attributes);
      if (input.getParentNode() != null) {
        input.getParentNode().replaceChild(newInput, input);
      } else {
        input = newInput;
      }
      input.setScriptObject(null);
      setDomNode(newInput, true);
    }
  }
  
  public void jsxSet_checked(boolean checked)
  {
    ((HtmlInput)getDomNodeOrDie()).setChecked(checked);
  }
  
  protected HtmlInput getHtmlInputOrDie()
  {
    return (HtmlInput)getDomNodeOrDie();
  }
  
  public boolean jsxGet_checked()
  {
    return ((HtmlInput)getDomNodeOrDie()).isChecked();
  }
  
  public void jsxFunction_select()
  {
    HtmlInput input = getHtmlInputOrDie();
    if ((input instanceof HtmlTextInput)) {
      ((HtmlTextInput)getDomNodeOrDie()).select();
    }
  }
  
  public void jsxFunction_setAttribute(String name, String value)
  {
    if ("type".equals(name)) {
      jsxSet_type(value);
    } else {
      super.jsxFunction_setAttribute(name, value);
    }
  }
  
  public String jsxGet_defaultValue()
  {
    return ((HtmlInput)getDomNodeOrDie()).getDefaultValue();
  }
  
  public void jsxSet_defaultValue(String defaultValue)
  {
    ((HtmlInput)getDomNodeOrDie()).setDefaultValue(defaultValue);
  }
  
  public boolean jsxGet_defaultChecked()
  {
    return ((HtmlInput)getDomNodeOrDie()).isDefaultChecked();
  }
  
  public void jsxSet_defaultChecked(boolean defaultChecked)
  {
    ((HtmlInput)getDomNodeOrDie()).setDefaultChecked(defaultChecked);
  }
  
  public int jsxGet_textLength()
  {
    return jsxGet_value().length();
  }
  
  public int jsxGet_selectionStart()
  {
    return ((SelectableTextInput)getDomNodeOrDie()).getSelectionStart();
  }
  
  public void jsxSet_selectionStart(int start)
  {
    ((SelectableTextInput)getDomNodeOrDie()).setSelectionStart(start);
  }
  
  public int jsxGet_selectionEnd()
  {
    return ((SelectableTextInput)getDomNodeOrDie()).getSelectionEnd();
  }
  
  public void jsxSet_selectionEnd(int end)
  {
    ((SelectableTextInput)getDomNodeOrDie()).setSelectionEnd(end);
  }
  
  protected boolean isAttributeName(String name)
  {
    if ("maxlength".equals(name.toLowerCase())) {
      return "maxLength".equals(name);
    }
    if ("readOnly".equals(name.toLowerCase())) {
      return "readOnly".equals(name);
    }
    return super.isAttributeName(name);
  }
  
  public int jsxGet_maxLength()
  {
    String attrValue = getDomNodeOrDie().getAttribute("maxLength");
    return NumberUtils.toInt(attrValue, -1);
  }
  
  public void jsxSet_maxLength(int length)
  {
    getDomNodeOrDie().setAttribute("maxLength", String.valueOf(length));
  }
  
  public boolean jsxGet_readOnly()
  {
    return ((HtmlInput)getDomNodeOrDie()).isReadOnly();
  }
  
  public void jsxSet_readOnly(boolean readOnly)
  {
    ((HtmlInput)getDomNodeOrDie()).setReadOnly(readOnly);
  }
  
  public void jsxFunction_setSelectionRange(int start, int end)
  {
    jsxSet_selectionStart(start);
    jsxSet_selectionEnd(end);
  }
  
  public String jsxGet_alt()
  {
    String alt = getDomNodeOrDie().getAttribute("alt");
    if (alt == NOT_FOUND) {
      alt = "";
    }
    return alt;
  }
  
  public void jsxSet_alt(String alt)
  {
    getDomNodeOrDie().setAttribute("alt", alt);
  }
  
  public String jsxGet_border()
  {
    String border = getDomNodeOrDie().getAttribute("border");
    if (border == NOT_FOUND) {
      border = "";
    }
    return border;
  }
  
  public void jsxSet_border(String border)
  {
    getDomNodeOrDie().setAttribute("border", border);
  }
  
  public String jsxGet_align()
  {
    return getAlign(true);
  }
  
  public void jsxSet_align(String align)
  {
    boolean ignoreIfNoError = getBrowserVersion().isIE();
    setAlign(align, ignoreIfNoError);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLInputElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

public class HTMLOListElement
  extends HTMLListElement
{
  private static final long serialVersionUID = 5919593872580325038L;
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLOListElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.javascript.host.Window;

public class HTMLHtmlElement
  extends HTMLElement
{
  private static final long serialVersionUID = 4942983761903195465L;
  
  public int jsxGet_clientWidth()
  {
    return getWindow().jsxGet_innerWidth();
  }
  
  public int jsxGet_clientHeight()
  {
    return getWindow().jsxGet_innerHeight();
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLHtmlElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import java.applet.Applet;
import java.lang.reflect.Method;
import net.sourceforge.htmlunit.corejs.javascript.BaseFunction;
import net.sourceforge.htmlunit.corejs.javascript.Context;
import net.sourceforge.htmlunit.corejs.javascript.Scriptable;

class HTMLAppletElement$1
  extends BaseFunction
{
  private static final long serialVersionUID = 1748611972272176674L;
  
  HTMLAppletElement$1(HTMLAppletElement paramHTMLAppletElement, Method paramMethod, Applet paramApplet) {}
  
  public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
  {
    Object[] realArgs = new Object[val$method.getParameterTypes().length];
    for (int i = 0; i < realArgs.length; i++)
    {
      Object arg;
      Object arg;
      if (i > args.length) {
        arg = null;
      } else {
        arg = Context.jsToJava(args[i], val$method.getParameterTypes()[i]);
      }
      realArgs[i] = arg;
    }
    try
    {
      return val$method.invoke(val$applet, realArgs);
    }
    catch (Exception e)
    {
      throw Context.throwAsScriptRuntimeEx(e);
    }
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLAppletElement.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.SgmlPage;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlApplet;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import java.applet.Applet;
import java.lang.reflect.Method;
import net.sourceforge.htmlunit.corejs.javascript.BaseFunction;
import net.sourceforge.htmlunit.corejs.javascript.Context;
import net.sourceforge.htmlunit.corejs.javascript.Function;
import net.sourceforge.htmlunit.corejs.javascript.Scriptable;
import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject;

public class HTMLAppletElement
  extends HTMLElement
{
  private static final long serialVersionUID = 1869359649341296910L;
  
  public void setDomNode(DomNode domNode)
  {
    super.setDomNode(domNode);
    if (domNode.getPage().getWebClient().isAppletEnabled()) {
      try
      {
        createAppletMethodAndProperties();
      }
      catch (Exception e)
      {
        throw new RuntimeException(e);
      }
    }
  }
  
  private void createAppletMethodAndProperties()
    throws Exception
  {
    HtmlApplet appletNode = (HtmlApplet)getDomNodeOrDie();
    final Applet applet = appletNode.getApplet();
    if (applet == null) {
      return;
    }
    for (final Method method : applet.getClass().getMethods())
    {
      Function f = new BaseFunction()
      {
        private static final long serialVersionUID = 1748611972272176674L;
        
        public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
        {
          Object[] realArgs = new Object[method.getParameterTypes().length];
          for (int i = 0; i < realArgs.length; i++)
          {
            Object arg;
            Object arg;
            if (i > args.length) {
              arg = null;
            } else {
              arg = Context.jsToJava(args[i], method.getParameterTypes()[i]);
            }
            realArgs[i] = arg;
          }
          try
          {
            return method.invoke(applet, realArgs);
          }
          catch (Exception e)
          {
            throw Context.throwAsScriptRuntimeEx(e);
          }
        }
      };
      ScriptableObject.defineProperty(this, method.getName(), f, 1);
    }
  }
  
  public String jsxGet_alt()
  {
    String alt = getDomNodeOrDie().getAttribute("alt");
    if (alt == NOT_FOUND) {
      alt = "";
    }
    return alt;
  }
  
  public void jsxSet_alt(String alt)
  {
    getDomNodeOrDie().setAttribute("alt", alt);
  }
  
  public String jsxGet_border()
  {
    String border = getDomNodeOrDie().getAttribute("border");
    if (border == NOT_FOUND) {
      border = "";
    }
    return border;
  }
  
  public void jsxSet_border(String border)
  {
    getDomNodeOrDie().setAttribute("border", border);
  }
  
  public String jsxGet_align()
  {
    return getAlign(true);
  }
  
  public void jsxSet_align(String align)
  {
    setAlign(align, false);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLAppletElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.javascript.host.canvas.CanvasRenderingContext2D;

public class HTMLCanvasElement
  extends HTMLElement
{
  private static final long serialVersionUID = 2198667710163712419L;
  
  public String jsxGet_width()
  {
    String width = getDomNodeOrDie().getAttribute("width");
    if (width == DomElement.ATTRIBUTE_NOT_DEFINED) {
      width = "300";
    }
    return width;
  }
  
  public void jsxSet_width(String width)
  {
    getDomNodeOrDie().setAttribute("width", width);
  }
  
  public String jsxGet_height()
  {
    String height = getDomNodeOrDie().getAttribute("height");
    if (height == DomElement.ATTRIBUTE_NOT_DEFINED) {
      height = "150";
    }
    return height;
  }
  
  public void jsxSet_height(String height)
  {
    getDomNodeOrDie().setAttribute("height", height);
  }
  
  public Object jsxFunction_getContext(String contextId)
  {
    if (contextId.equals("2d"))
    {
      CanvasRenderingContext2D context = new CanvasRenderingContext2D();
      context.setParentScope(getParentScope());
      context.setPrototype(getPrototype(context.getClass()));
      return context;
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLCanvasElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.html.HtmlElement;
import net.sourceforge.htmlunit.corejs.javascript.Context;

public class HTMLBaseFontElement
  extends HTMLElement
{
  private static final long serialVersionUID = 2694990716654235565L;
  
  public String jsxGet_color()
  {
    return getDomNodeOrDie().getAttribute("color");
  }
  
  public void jsxSet_color(String color)
  {
    getDomNodeOrDie().setAttribute("color", color);
  }
  
  public String jsxGet_face()
  {
    return getDomNodeOrDie().getAttribute("face");
  }
  
  public void jsxSet_face(String face)
  {
    getDomNodeOrDie().setAttribute("face", face);
  }
  
  public int jsxGet_size()
  {
    return (int)Context.toNumber(getDomNodeOrDie().getAttribute("size"));
  }
  
  public void jsxSet_size(int size)
  {
    getDomNodeOrDie().setAttribute("size", Context.toString(Integer.valueOf(size)));
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLBaseFontElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.DomText;
import com.gargoylesoftware.htmlunit.html.HtmlElement;

public class HTMLTitleElement
  extends HTMLElement
{
  private static final long serialVersionUID = -6345342494766370848L;
  
  public String jsxGet_text()
  {
    DomNode firstChild = getDomNodeOrDie().getFirstChild();
    if (firstChild != null) {
      return firstChild.getNodeValue();
    }
    return "";
  }
  
  public void jsxSet_text(String text)
  {
    DomNode htmlElement = getDomNodeOrDie();
    DomNode firstChild = htmlElement.getFirstChild();
    if (firstChild == null)
    {
      firstChild = new DomText(htmlElement.getPage(), text);
      htmlElement.appendChild(firstChild);
    }
    else
    {
      firstChild.setNodeValue(text);
    }
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLTitleElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.html.HtmlLabel;
import com.gargoylesoftware.htmlunit.javascript.host.FormChild;

public class HTMLLabelElement
  extends FormChild
{
  private static final long serialVersionUID = -7412506443200373632L;
  
  public String jsxGet_htmlFor()
  {
    return ((HtmlLabel)getDomNodeOrDie()).getForAttribute();
  }
  
  public void jsxSet_htmlFor(String id)
  {
    ((HtmlLabel)getDomNodeOrDie()).setAttribute("for", id);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLabelElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;

public class HTMLTableCaptionElement
  extends HTMLElement
{
  private static final long serialVersionUID = 5646224918517395242L;
  private static final String[] VALIGN_VALID_VALUES_IE = { "top", "bottom" };
  private static final String VALIGN_DEFAULT_VALUE = "";
  
  public String jsxGet_align()
  {
    boolean returnInvalidValues = getBrowserVersion().isFirefox();
    return getAlign(returnInvalidValues);
  }
  
  public void jsxSet_align(String align)
  {
    setAlign(align, false);
  }
  
  public String jsxGet_vAlign()
  {
    return getVAlign(getValidVAlignValues(), "");
  }
  
  public void jsxSet_vAlign(Object vAlign)
  {
    setVAlign(vAlign, getValidVAlignValues());
  }
  
  private String[] getValidVAlignValues()
  {
    String[] valid;
    String[] valid;
    if (getBrowserVersion().isIE()) {
      valid = VALIGN_VALID_VALUES_IE;
    } else {
      valid = null;
    }
    return valid;
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLTableCaptionElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

public class HTMLHRElement
  extends HTMLElement
{
  private static final long serialVersionUID = 2438742206022221826L;
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLHRElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

public class HTMLHeadingElement
  extends HTMLElement
{
  private static final long serialVersionUID = -24041435932881504L;
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLHeadingElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.javascript.host.RowContainer;

public class HTMLTableSectionElement
  extends RowContainer
{
  private static final long serialVersionUID = -3564660687852337070L;
  private static final String[] VALIGN_VALID_VALUES_IE = { "top", "bottom", "middle", "baseline" };
  private static final String VALIGN_DEFAULT_VALUE = "top";
  
  public String jsxGet_vAlign()
  {
    return getVAlign(getValidVAlignValues(), "top");
  }
  
  public void jsxSet_vAlign(Object vAlign)
  {
    setVAlign(vAlign, getValidVAlignValues());
  }
  
  private String[] getValidVAlignValues()
  {
    String[] valid;
    String[] valid;
    if (getBrowserVersion().isIE()) {
      valid = VALIGN_VALID_VALUES_IE;
    } else {
      valid = null;
    }
    return valid;
  }
  
  public String jsxGet_ch()
  {
    return getCh();
  }
  
  public void jsxSet_ch(String ch)
  {
    setCh(ch);
  }
  
  public String jsxGet_chOff()
  {
    return getChOff();
  }
  
  public void jsxSet_chOff(String chOff)
  {
    setChOff(chOff);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLTableSectionElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.HtmlAbbreviated;
import com.gargoylesoftware.htmlunit.html.HtmlAcronym;
import com.gargoylesoftware.htmlunit.html.HtmlAddress;
import com.gargoylesoftware.htmlunit.html.HtmlBidirectionalOverride;
import com.gargoylesoftware.htmlunit.html.HtmlBig;
import com.gargoylesoftware.htmlunit.html.HtmlBlink;
import com.gargoylesoftware.htmlunit.html.HtmlBold;
import com.gargoylesoftware.htmlunit.html.HtmlCenter;
import com.gargoylesoftware.htmlunit.html.HtmlCitation;
import com.gargoylesoftware.htmlunit.html.HtmlCode;
import com.gargoylesoftware.htmlunit.html.HtmlDefinition;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlEmphasis;
import com.gargoylesoftware.htmlunit.html.HtmlExample;
import com.gargoylesoftware.htmlunit.html.HtmlItalic;
import com.gargoylesoftware.htmlunit.html.HtmlKeyboard;
import com.gargoylesoftware.htmlunit.html.HtmlListing;
import com.gargoylesoftware.htmlunit.html.HtmlNoBreak;
import com.gargoylesoftware.htmlunit.html.HtmlPlainText;
import com.gargoylesoftware.htmlunit.html.HtmlS;
import com.gargoylesoftware.htmlunit.html.HtmlSample;
import com.gargoylesoftware.htmlunit.html.HtmlSmall;
import com.gargoylesoftware.htmlunit.html.HtmlStrike;
import com.gargoylesoftware.htmlunit.html.HtmlStrong;
import com.gargoylesoftware.htmlunit.html.HtmlSubscript;
import com.gargoylesoftware.htmlunit.html.HtmlSuperscript;
import com.gargoylesoftware.htmlunit.html.HtmlTeletype;
import com.gargoylesoftware.htmlunit.html.HtmlUnderlined;
import com.gargoylesoftware.htmlunit.html.HtmlVariable;
import com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject;

public class HTMLSpanElement
  extends HTMLElement
{
  private static final long serialVersionUID = -1837052392526933150L;
  
  public void setDomNode(DomNode domNode)
  {
    super.setDomNode(domNode);
    HtmlElement element = (HtmlElement)domNode;
    BrowserVersion browserVersion = getBrowserVersion();
    if (browserVersion.isIE())
    {
      if ((((element instanceof HtmlAbbreviated)) && (browserVersion.getBrowserVersionNumeric() > 6.0F)) || ((element instanceof HtmlAcronym)) || ((element instanceof HtmlAddress)) || ((element instanceof HtmlBidirectionalOverride)) || ((element instanceof HtmlBig)) || ((element instanceof HtmlBold)) || ((element instanceof HtmlBlink)) || ((element instanceof HtmlCenter)) || ((element instanceof HtmlCitation)) || ((element instanceof HtmlCode)) || ((element instanceof HtmlDefinition)) || ((element instanceof HtmlExample)) || ((element instanceof HtmlEmphasis)) || ((element instanceof HtmlItalic)) || ((element instanceof HtmlKeyboard)) || ((element instanceof HtmlListing)) || ((element instanceof HtmlNoBreak)) || ((element instanceof HtmlPlainText)) || ((element instanceof HtmlS)) || ((element instanceof HtmlSample)) || ((element instanceof HtmlSmall)) || ((element instanceof HtmlStrike)) || ((element instanceof HtmlStrong)) || ((element instanceof HtmlSubscript)) || ((element instanceof HtmlSuperscript)) || ((element instanceof HtmlTeletype)) || ((element instanceof HtmlUnderlined)) || ((element instanceof HtmlVariable))) {
        ActiveXObject.addProperty(this, "cite", true, true);
      }
      if ((((element instanceof HtmlAbbreviated)) && (browserVersion.getBrowserVersionNumeric() > 6.0F)) || ((element instanceof HtmlAcronym)) || ((element instanceof HtmlBold)) || ((element instanceof HtmlBidirectionalOverride)) || ((element instanceof HtmlBig)) || ((element instanceof HtmlBlink)) || ((element instanceof HtmlCitation)) || ((element instanceof HtmlCode)) || ((element instanceof HtmlDefinition)) || ((element instanceof HtmlEmphasis)) || ((element instanceof HtmlItalic)) || ((element instanceof HtmlKeyboard)) || ((element instanceof HtmlNoBreak)) || ((element instanceof HtmlS)) || ((element instanceof HtmlSample)) || ((element instanceof HtmlSmall)) || ((element instanceof HtmlStrike)) || ((element instanceof HtmlStrong)) || ((element instanceof HtmlSubscript)) || ((element instanceof HtmlSuperscript)) || ((element instanceof HtmlTeletype)) || ((element instanceof HtmlUnderlined)) || ((element instanceof HtmlVariable))) {
        ActiveXObject.addProperty(this, "dateTime", true, true);
      }
    }
  }
  
  public String jsxGet_cite()
  {
    String cite = getDomNodeOrDie().getAttribute("cite");
    if (cite == NOT_FOUND) {
      cite = "";
    }
    return cite;
  }
  
  public void jsxSet_cite(String cite)
  {
    getDomNodeOrDie().setAttribute("cite", cite);
  }
  
  public String jsxGet_dateTime()
  {
    String dateTime = getDomNodeOrDie().getAttribute("datetime");
    if (dateTime == NOT_FOUND) {
      dateTime = "";
    }
    return dateTime;
  }
  
  public void jsxSet_dateTime(String dateTime)
  {
    getDomNodeOrDie().setAttribute("datetime", dateTime);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLSpanElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.javascript.host.css.ComputedCSSStyleDeclaration;
import java.net.MalformedURLException;
import java.net.URL;
import net.sourceforge.htmlunit.corejs.javascript.Context;

public class HTMLBodyElement
  extends HTMLElement
{
  private static final long serialVersionUID = -915040139319661419L;
  
  public void createEventHandlerFromAttribute(String attributeName, String value)
  {
    if (attributeName.toLowerCase().startsWith("on")) {
      createEventHandler(attributeName, value);
    }
  }
  
  public void setDefaults(ComputedCSSStyleDeclaration style)
  {
    if (getBrowserVersion().isIE())
    {
      style.setDefaultLocalStyleAttribute("margin", "15px 10px");
      style.setDefaultLocalStyleAttribute("padding", "0px");
    }
    else
    {
      style.setDefaultLocalStyleAttribute("margin-left", "8px");
      style.setDefaultLocalStyleAttribute("margin-right", "8px");
      style.setDefaultLocalStyleAttribute("margin-top", "8px");
      style.setDefaultLocalStyleAttribute("margin-bottom", "8px");
    }
  }
  
  public HTMLElement jsxGet_offsetParent()
  {
    return null;
  }
  
  public String jsxGet_aLink()
  {
    String aLink = getDomNodeOrDie().getAttribute("aLink");
    if ((aLink == DomElement.ATTRIBUTE_NOT_DEFINED) && (getBrowserVersion().isFirefox())) {
      aLink = "#ee0000";
    }
    return aLink;
  }
  
  public void jsxSet_aLink(String aLink)
  {
    setColorAttribute("aLink", aLink);
  }
  
  public String jsxGet_background()
  {
    HtmlElement node = getDomNodeOrDie();
    String background = node.getAttribute("background");
    if ((background != DomElement.ATTRIBUTE_NOT_DEFINED) && (getBrowserVersion().isFirefox())) {
      try
      {
        HtmlPage page = (HtmlPage)node.getPage();
        background = page.getFullyQualifiedUrl(background).toExternalForm();
      }
      catch (MalformedURLException e)
      {
        Context.throwAsScriptRuntimeEx(e);
      }
    }
    return background;
  }
  
  public void jsxSet_background(String background)
  {
    getDomNodeOrDie().setAttribute("background", background);
  }
  
  public String jsxGet_bgColor()
  {
    String bgColor = getDomNodeOrDie().getAttribute("bgColor");
    if ((bgColor == DomElement.ATTRIBUTE_NOT_DEFINED) && (getBrowserVersion().isFirefox())) {
      bgColor = "#ffffff";
    }
    return bgColor;
  }
  
  public void jsxSet_bgColor(String bgColor)
  {
    setColorAttribute("bgColor", bgColor);
  }
  
  public String jsxGet_link()
  {
    String link = getDomNodeOrDie().getAttribute("link");
    if ((link == DomElement.ATTRIBUTE_NOT_DEFINED) && (getBrowserVersion().isFirefox())) {
      link = "#0000ee";
    }
    return link;
  }
  
  public void jsxSet_link(String link)
  {
    setColorAttribute("link", link);
  }
  
  public String jsxGet_text()
  {
    String text = getDomNodeOrDie().getAttribute("text");
    if ((text == DomElement.ATTRIBUTE_NOT_DEFINED) && (getBrowserVersion().isFirefox())) {
      text = "#000000";
    }
    return text;
  }
  
  public void jsxSet_text(String text)
  {
    setColorAttribute("text", text);
  }
  
  public String jsxGet_vLink()
  {
    String vLink = getDomNodeOrDie().getAttribute("vLink");
    if ((vLink == DomElement.ATTRIBUTE_NOT_DEFINED) && (getBrowserVersion().isFirefox())) {
      vLink = "#551a8b";
    }
    return vLink;
  }
  
  public void jsxSet_vLink(String vLink)
  {
    setColorAttribute("vLink", vLink);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLBodyElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

public class HTMLUListElement
  extends HTMLListElement
{
  private static final long serialVersionUID = 5693185995604704981L;
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLUListElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.javascript.host.FormChild;

public class HTMLLegendElement
  extends FormChild
{
  private static final long serialVersionUID = -6536306776315347201L;
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLegendElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

public class HTMLEmbedElement
  extends HTMLElement
{
  private static final long serialVersionUID = 2885295550292333233L;
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLEmbedElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.WebWindow;
import com.gargoylesoftware.htmlunit.html.BaseFrame;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.javascript.host.Window;
import com.gargoylesoftware.htmlunit.javascript.host.WindowProxy;
import net.sourceforge.htmlunit.corejs.javascript.Scriptable;

public class HTMLFrameElement
  extends HTMLElement
{
  private static final long serialVersionUID = 3761121622400448304L;
  
  public String jsxGet_src()
  {
    return getFrame().getSrcAttribute();
  }
  
  public HTMLDocument jsxGet_contentDocument()
  {
    return ((Window)getFrame().getEnclosedWindow().getScriptObject()).jsxGet_document();
  }
  
  public Scriptable jsxGet_contentWindow()
  {
    return new WindowProxy(getFrame().getEnclosedWindow());
  }
  
  public void jsxSet_src(String src)
  {
    getFrame().setSrcAttribute(src);
  }
  
  public String jsxGet_name()
  {
    return getFrame().getNameAttribute();
  }
  
  public void jsxSet_name(String name)
  {
    getFrame().setNameAttribute(name);
  }
  
  private BaseFrame getFrame()
  {
    return (BaseFrame)getDomNodeOrDie();
  }
  
  public void jsxSet_onload(Object eventHandler)
  {
    setEventHandlerProp("onload", eventHandler);
  }
  
  public Object jsxGet_onload()
  {
    return getEventHandlerProp("onload");
  }
  
  public String jsxGet_border()
  {
    String border = getDomNodeOrDie().getAttribute("border");
    if (border == NOT_FOUND) {
      border = "";
    }
    return border;
  }
  
  public void jsxSet_border(String border)
  {
    getDomNodeOrDie().setAttribute("border", border);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLFrameElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

public class HTMLParagraphElement
  extends HTMLElement
{
  private static final long serialVersionUID = 5587606872788054898L;
  
  public String jsxGet_align()
  {
    return getAlign(true);
  }
  
  public void jsxSet_align(String align)
  {
    setAlign(align, false);
  }
}

/* Location:
 * Qualified Name:     com.gargoylesoftware.htmlunit.javascript.host.html.HTMLParagraphElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package com.gargoylesoftware.htmlunit.javascript.host.html;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.html.HTMLParser;
import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlOption;
import com.gargoylesoftware.htmlunit.html.HtmlSelect;
import com.gargoylesoftware.htmlunit.html.IElementFactory;
import com.gargoylesoftware.htmlunit.javascript.host.FormField;
import java.util.List;
import net.sourceforge.htmlunit.corejs.javascript.Context;
import net.sourceforge.htmlunit.corejs.javascript.Scriptable;

public class HTMLSelectElement
  extends FormField
{
  private static final long serialVersionUID = 4332789476842114628L;
  private HTMLOptionsCollection optionsArray_;
  
  public void jsConstructor() {}
  
  public void initialize()
  {
    HtmlSelect htmlSelect = getHtmlSelect();
    htmlSelect.setScriptObject(this);
    if (optionsArray_ == null)
    {
      optionsArray_ = new HTMLOptionsCollection(this);
      optionsArray_.initialize(htmlSelect);
    }
  }
  
  public void jsxFunction_remove(int index)
  {
    put(index, null, null);
  }
  
  public void jsxFunction_add(HTMLOptionElement newOptionObject, Object arg2)
  {
    if (getBrowserVersion().isIE()) {
      add_IE(newOptionObject, arg2);
    } else {
      add(newOptionObject, arg2);
    }
    ensureSelectedIndex();
  }
  
  public Object jsxFunction_appendChild(Object childObject)
  {
    Object object = super.jsxFunction_appendChild(childObject);
    ensureSelectedIndex();
    return object;
  }
  
  public Object jsxFunction_insertBefore(Object[] args)
  {
    Object object = super.jsxFunction_insertBefore(args);
    ensureSelectedIndex();
    return object;
  }
  
  protected void add_IE(HTMLOptionElement newOptionObject, Object index)
  {
    HtmlSelect select = getHtmlSelect();
    HtmlOption beforeOption;
    HtmlOption beforeOption;
    if (Context.getUndefinedValue().equals(index))
    {
      beforeOption = null;
    }
    else
    {
      int intIndex = ((Integer)Context.jsToJava(index, Integer.class)).intValue();
      HtmlOption beforeOption;
      if (intIndex >= select.getOptionSize()) {
        beforeOption = null;
      } else {
        beforeOption = select.getOption(intIndex);
      }
    }
    addBefore(newOptionObject, beforeOption);
  }
  
  protected void add(HTMLOptionElement newOptionObject, Object beforeOptionObject)
  {
    HtmlOption beforeOption;
    HtmlOption beforeOption;
    if (beforeOptionObject == null)
    {
      beforeOption = null;
    }
    else
    {
      if (Context.getUndefinedValue().equals(beforeOptionObject)) {
        throw Context.reportRuntimeError("Not enough arguments [SelectElement.add]");
      }
      beforeOption = (HtmlOption)((HTMLOptionElement)beforeOptionObject).getDomNodeOrDie();
    }
    addBefore(newOptionObject, beforeOption);
  }
  
  protected void addBefore(HTMLOptionElement newOptionObject, HtmlOption beforeOption)
  {
    HtmlSelect select = getHtmlSelect();
    
    HtmlOption htmlOption = newOptionObject.getDomNodeOrNull();
    if (htmlOption == null) {
      htmlOption = (HtmlOption)HTMLParser.getFactory("option").createElement(select.getPage(), "option", null);
    }
    if (beforeOption == null) {
      select.appendChild(htmlOption);
    } else {
      beforeOption.insertBefore(htmlOption);
    }
  }
  
  public String jsxGet_type()
  {
    String type;
    String type;
    if (getHtmlSelect().isMultipleSelectEnabled()) {
      type = "select-multiple";
    } else {
      type = "select-one";
    }
    return type;
  }
  
  public HTMLOptionsCollection jsxGet_options()
  {
    if (optionsArray_ == null) {
      initialize();
    }
    return optionsArray_;
  }
  
  public int jsxGet_selectedIndex()
  {
    HtmlSelect htmlSelect = getHtmlSelect();
    List<HtmlOption> selectedOptions = htmlSelect.getSelectedOptions();
    if (selectedOptions.isEmpty()) {
      return -1;
    }
    List<HtmlOption> allOptions = htmlSelect.getOptions();
    return allOptions.indexOf(selectedOptions.get(0));
  }
  
  public void jsxSet_selectedIndex(int index)
  {
    HtmlSelect htmlSelect = getHtmlSelect();
    if ((index != 0) && (getBrowserVersion().isFirefox()) && ((index < -1) || (index >= htmlSelect.getOptionSize()))) {
      throw Context.reportRuntimeError("Invalid index for select node: " + index);
    }
    for (HtmlOption itemToUnSelect : htmlSelect.getSelectedOptions()) {
      htmlSelect.setSelectedAttribute(itemToUnSelect, false);
    }
    if (index < 0) {
      return;
    }
    List<HtmlOption> allOptions = htmlSelect.getOptions();
    if (index < allOptions.size())
    {
      HtmlOption itemToSelect = (HtmlOption)allOptions.get(index);
      htmlSelect.setSelectedAttribute(itemToSelect, true, false);
    }
  }
  
  public String jsxGet_value()
  {
    HtmlSelect
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd