Exemple #1
0
 private void executeEventIfBrowserHasFeature(
     final String type, final BrowserVersionFeatures feature) {
   if (getPage().getWebClient().getBrowserVersion().hasFeature(feature)) {
     final HTMLScriptElement script = (HTMLScriptElement) getScriptObject();
     final Event event = new Event(HtmlScript.this, type);
     script.executeEvent(event);
   }
 }
Exemple #2
0
 /**
  * Sets the <tt>readyState</tt> to the specified state and executes the
  * <tt>onreadystatechange</tt> handler when simulating IE.
  *
  * @param state this script ready state
  */
 protected void setAndExecuteReadyState(final String state) {
   if (getPage()
       .getWebClient()
       .getBrowserVersion()
       .hasFeature(BrowserVersionFeatures.EVENT_ONREADY_STATE_CHANGE)) {
     setReadyState(state);
     final HTMLScriptElement script = (HTMLScriptElement) getScriptObject();
     final Event event = new Event(this, Event.TYPE_READY_STATE_CHANGE);
     script.executeEvent(event);
   }
 }