Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2009 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.gwt.dom.client;
abstract class DOMImplTrident extends DOMImpl {
/**
* This field *must* be filled in from JSNI code before dispatching an event
* on IE. It should be set to the 'this' context of the handler that receives
* the event, then restored to its initial value when the dispatcher is done.
* See
* {@link com.google.gwt.user.client.impl.DOMImplTrident#initEventSystem()}
* for an example of how this should be done.
*/
private static EventTarget currentEventTarget;
@Override
public native ButtonElement createButtonElement(Document doc, String type) /*-{
return doc.createElement("");
}-*/;
@Override
public Element createElement(Document doc, String tagName) {
if (tagName.contains(":")) {
// Special implementation for tag names with namespace-prefixes. The only
// way to get IE to reliably create namespace-prefixed elements is
// through innerHTML.
Element container = ensureContainer(doc);
container.setInnerHTML("<" + tagName + "/>");
// Remove the element before returning it, so that there's no chance of
// it getting clobbered later.
Element elem = container.getFirstChildElement();
container.removeChild(elem);
return elem;
}
// No prefix. Just use the default implementation (don't use super impl
// here in case it changes at some point in the future).
return createElementInternal(doc, tagName);
}
@Override
public native NativeEvent createHtmlEvent(Document doc, String type,
boolean canBubble, boolean cancelable) /*-{
// NOTE: IE doesn't support changing bubbling and canceling behavior (this
// is documented publicly in Document.createHtmlEvent()).
var evt = doc.createEventObject();
evt.type = type;
return evt;
}-*/;
@Override
public native InputElement createInputRadioElement(Document doc, String name) /*-{
return doc.createElement("");
}-*/;
@Override
public native NativeEvent createKeyCodeEvent(Document doc, String type,
boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey,
int keyCode) /*-{
var evt = doc.createEventObject();
evt.type = type;
evt.ctrlKey = ctrlKey;
evt.altKey = altKey;
evt.shiftKey = shiftKey;
evt.metaKey = metaKey;
evt.keyCode = keyCode;
return evt;
}-*/;
@Override
@Deprecated
public native NativeEvent createKeyEvent(Document doc, String type,
boolean canBubble, boolean cancelable, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey, int keyCode, int charCode) /*-{
// NOTE: IE doesn't support changing bubbling and canceling behavior (this
// is documented publicly in Document.createKeyEvent()).
var evt = [email protected]::createKeyCodeEvent(Lcom/google/gwt/dom/client/Document;Ljava/lang/String;ZZZZI)(doc, type, ctrlKey, altKey, shiftKey, metaKey, charCode);
evt.charCode = charCode;
return evt;
}-*/;
@Override
public NativeEvent createKeyPressEvent(Document doc, boolean ctrlKey,
boolean altKey, boolean shiftKey, boolean metaKey, int charCode) {
// NOTE: in IE, keyCode is used in both keydown/keyup and keypress, so we
// delegate to createKeyCodeEvent instead of duplicating code.
return createKeyCodeEvent(doc, "keypress", ctrlKey, altKey, shiftKey,
metaKey, charCode);
}
@Override
public native NativeEvent createMouseEvent(Document doc, String type,
boolean canBubble, boolean cancelable, int detail, int screenX,
int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey,
boolean shiftKey, boolean metaKey, int button, Element relatedTarget) /*-{
// NOTE: IE doesn't support changing bubbling and canceling behavior (this
// is documented publicly in Document.createMouseEvent()).
var evt = doc.createEventObject();
evt.type = type;
evt.detail = detail;
evt.screenX = screenX;
evt.screenY = screenY;
evt.clientX = clientX;
evt.clientY = clientY;
evt.ctrlKey = ctrlKey;
evt.altKey = altKey;
evt.shiftKey = shiftKey;
evt.metaKey = metaKey;
evt.button = button;
// It would make sense to set evt.[fromElement | toElement] here, because
// that's what IE uses. However, setting these properties has no effect for
// some reason. So instead we set releatedTarget, and explicitly check for
// its existence in eventGetFromElement() and eventGetToElement().
evt.relatedTarget = relatedTarget;
return evt;
}-*/;
/**
* Supports creating a select control with the multiple attribute to work
* around a bug in IE6 where changing the multiple attribute in a setAttribute
* call can cause subsequent setSelected calls to misbehave. Although this bug
* is fixed in IE7, this DOMImpl specialization is used for both IE6 and IE7,
* but it should be harmless.
*/
@Override
public native SelectElement createSelectElement(Document doc, boolean multiple) /*-{
var html = multiple ? "