DomImpl abstract class
abstract class DomImpl { /** * Create instance of [DomImpl] depends on broswer. */ factory DomImpl.browserDependent() { return new DomImplStandard(); } DomImpl(); static bool eventSystemIsInitialized = false; /** * The attribute that is set when an image fires a native load or error event * before it is attached. */ static final String UNHANDLED_EVENT_ATTR = "dwtLastUnhandledEvent"; //************************* // Parent - child relations //************************* bool isOrHasChild(dart_html.Node parent, dart_html.Node child); void insertChild(dart_html.Element parent, dart_html.Element child, int index); dart_html.Element getChild(dart_html.Element elem, int index); int getChildCount(dart_html.Element elem); //******************** // Position of Element //******************** int getAbsoluteLeft(dart_html.Element elem); int getAbsoluteTop(dart_html.Element elem); //********* // Capturte //********* void releaseCapture(dart_html.Element elem); void setCapture(dart_html.Element elem); //****** // Style //****** String getStyleProperty(dart_html.Element elem, String name); void setStyleProperty(dart_html.Element elem, String name, String value); String get cssFloatPropertyName { return "cssFloat"; } //******* // Events //******* void maybeInitializeEventSystem() { if (!eventSystemIsInitialized) { initEventSystem(); eventSystemIsInitialized = true; } } /** * Initializes the event dispatch system. */ void initEventSystem(); void setEventListener(dart_html.Element elem, EventListener listener); void sinkBitlessEvent(dart_html.Element elem, String eventTypeName); void sinkEvents(dart_html.Element elem, int eventBits); int getEventsSunk(dart_html.Element elem) { return _getEventBits(elem); } int _getEventBits(dart_html.Element elem) { assert(elem != null); String eventBits = elem.dataset["eventBits"]; if (eventBits != null) { try { return int.parse(eventBits); } on Exception catch(e) {} } return 0; } void _setEventBits(dart_html.Element elem, int bits) { assert(elem != null); assert(bits != null); elem.dataset["eventBits"] = bits.toRadixString(16); } dart_html.Element eventGetToElement(dart_html.Event evt); int getEventTypeInt(dart_html.Event evt) { return eventGetTypeInt(evt.type); } int eventGetTypeInt(String eventType) { switch (eventType) { case "blur": return 0x01000; case "change": return 0x00400; case "click": return 0x00001; case "dblclick": return 0x00002; case "focus": return 0x00800; case "keydown": return 0x00080; case "keypress": return 0x00100; case "keyup": return 0x00200; case "load": return 0x08000; case "losecapture": return 0x02000; case "mousedown": return 0x00004; case "mousemove": return 0x00040; case "mouseout": return 0x00020; case "mouseover": return 0x00010; case "mouseup": return 0x00008; case "scroll": return 0x04000; case "error": return 0x10000; case "mousewheel": return 0x20000; case "DOMMouseScroll": return 0x20000; case "contextmenu": return 0x40000; case "paste": return 0x80000; case "touchstart": return 0x100000; case "touchmove": return 0x200000; case "touchend": return 0x400000; case "touchcancel": return 0x800000; // case "gesturestart": return 0x1000000; // case "gesturechange": return 0x2000000; // case "gestureend": return 0x4000000; default: return -1; } } dart_html.Event createHtmlEvent(String type, bool canBubble, bool cancelable); EventListener getEventListener(dart_html.Element elem); }
Subclasses
Static Properties
bool eventSystemIsInitialized #
static bool eventSystemIsInitialized = false
final String UNHANDLED_EVENT_ATTR #
The attribute that is set when an image fires a native load or error event before it is attached.
static final String UNHANDLED_EVENT_ATTR = "dwtLastUnhandledEvent"
Constructors
new DomImpl() #
Properties
final String cssFloatPropertyName #
String get cssFloatPropertyName { return "cssFloat"; }
Methods
abstract Event createHtmlEvent(String type, bool canBubble, bool cancelable) #
abstract Element eventGetToElement(Event evt) #
int eventGetTypeInt(String eventType) #
int eventGetTypeInt(String eventType) { switch (eventType) { case "blur": return 0x01000; case "change": return 0x00400; case "click": return 0x00001; case "dblclick": return 0x00002; case "focus": return 0x00800; case "keydown": return 0x00080; case "keypress": return 0x00100; case "keyup": return 0x00200; case "load": return 0x08000; case "losecapture": return 0x02000; case "mousedown": return 0x00004; case "mousemove": return 0x00040; case "mouseout": return 0x00020; case "mouseover": return 0x00010; case "mouseup": return 0x00008; case "scroll": return 0x04000; case "error": return 0x10000; case "mousewheel": return 0x20000; case "DOMMouseScroll": return 0x20000; case "contextmenu": return 0x40000; case "paste": return 0x80000; case "touchstart": return 0x100000; case "touchmove": return 0x200000; case "touchend": return 0x400000; case "touchcancel": return 0x800000; // case "gesturestart": return 0x1000000; // case "gesturechange": return 0x2000000; // case "gestureend": return 0x4000000; default: return -1; } }
abstract int getAbsoluteLeft(Element elem) #
abstract int getAbsoluteTop(Element elem) #
abstract Element getChild(Element elem, int index) #
abstract int getChildCount(Element elem) #
abstract EventListener getEventListener(Element elem) #
int getEventsSunk(Element elem) #
int getEventsSunk(dart_html.Element elem) { return _getEventBits(elem); }
int getEventTypeInt(Event evt) #
int getEventTypeInt(dart_html.Event evt) { return eventGetTypeInt(evt.type); }
abstract String getStyleProperty(Element elem, String name) #
abstract void initEventSystem() #
Initializes the event dispatch system.
abstract void insertChild(Element parent, Element child, int index) #
abstract bool isOrHasChild(Node parent, Node child) #
void maybeInitializeEventSystem() #
void maybeInitializeEventSystem() { if (!eventSystemIsInitialized) { initEventSystem(); eventSystemIsInitialized = true; } }