1 38 package com.gargoylesoftware.htmlunit.javascript.host; 39 40 import org.mozilla.javascript.Function; 41 42 import com.gargoylesoftware.htmlunit.html.BaseFrame; 43 44 51 public class Frame extends HTMLElement { 52 private static final long serialVersionUID = 3761121622400448304L; 53 54 57 public Frame() { } 58 59 60 64 public final void jsConstructor() { 65 } 66 67 68 72 public String jsxGet_src() { 73 return getFrame().getSrcAttribute(); 74 } 75 76 77 83 public Document jsxGet_contentDocument() { 84 return ((Window) getFrame().getEnclosedWindow().getScriptObject()).jsxGet_document(); 85 } 86 87 91 public void jsxSet_src(final String src) { 92 getFrame().setSrcAttribute(src); 93 } 94 95 private BaseFrame getFrame() { 96 return (BaseFrame) getHtmlElementOrDie(); 97 } 98 99 100 104 public void jsxSet_onload(final Function eventHandler) { 105 getHtmlElementOrDie().setEventHandler("onload", eventHandler); 106 } 107 108 109 113 public Function jsxGet_onload() { 114 return getHtmlElementOrDie().getEventHandler("onload"); 115 } 116 } 117 | Popular Tags |