Package pyjamas :: Module DOM
[hide private]
[frames] | no frames]

Module DOM

source code

DOM implements the core of Pjamas-Desktop, providing access to and management of the DOM model of the PyWebkitGtk window.

Classes [hide private]
  IterChildrenClass
  IterWalkChildren
Functions [hide private]
 
get_listener(item) source code
 
set_listener(item, listener) source code
 
init() source code
 
_init_testing() source code
 
_dispatchWindowEvent(sender, evt, useCap) source code
 
_dispatchEvent(sender, evt, useCap) source code
 
_dispatchCapturedMouseEvent(evt) source code
 
_dispatchCapturedMouseoutEvent(evt) source code
 
browser_event_cb(view, event, from_window) source code
 
_dispatchCapturedEvent(event) source code
 
addEventPreview(preview) source code
 
appendChild(parent, child) source code
 
removeChild(parent, child) source code
 
replaceChild(parent, newChild, oldChild) source code
 
buttonClick(element) source code
 
compare(elem1, elem2) source code
 
createAnchor() source code
 
createButton() source code
 
createCol() source code
 
createDiv() source code
 
createElement(tag) source code
 
createFieldSet() source code
 
createForm() source code
 
createIFrame() source code
 
createImg() source code
 
createInputCheck() source code
 
createInputElement(elementType) source code
 
createInputPassword() source code
 
createInputRadio(group) source code
 
createInputText() source code
 
createLabel() source code
 
createLegend() source code
 
createOptions() source code
 
createSelect() source code
 
createSpan() source code
 
createTable() source code
 
createTBody() source code
 
createTD() source code
 
createTextArea() source code
 
createTH() source code
 
createTR() source code
 
eventStopPropagation(evt) source code
 
eventCancelBubble(evt, cancel) source code
 
eventGetAltKey(evt) source code
 
eventGetButton(evt) source code
 
eventGetClientX(evt) source code
 
eventGetClientY(evt) source code
 
eventGetCtrlKey(evt) source code
 
eventGetFromElement(evt) source code
 
eventGetKeyCode(evt) source code
 
eventGetRepeat(evt) source code
 
eventGetScreenX(evt) source code
 
eventGetScreenY(evt) source code
 
eventGetShiftKey(evt) source code
 
eventGetCurrentTarget(event) source code
 
eventGetTarget(event) source code
 
eventGetToElement(evt) source code
 
eventGetType(event) source code
 
eventGetTypeInt(event) source code
 
eventGetTypeString(event) source code
 
eventPreventDefault(evt) source code
 
eventSetKeyCode(evt, key) source code
 
eventToString(evt) source code
 
iframeGetSrc(elem) source code
 
getAbsoluteLeft(elem) source code
 
getAbsoluteTop(elem) source code
 
getAttribute(elem, attr) source code
 
getElemAttribute(elem, attr) source code
 
getBooleanAttribute(elem, attr) source code
 
getBooleanElemAttribute(elem, attr) source code
 
getCaptureElement() source code
 
getChild(elem, index)
Get a child of the DOM element by specifying an index.
source code
 
getChildCount(elem)
Calculate the number of children the given element has.
source code
 
getChildIndex(parent, toFind)
Return the index of the given child in the given parent.
source code
 
getElementById(id)
Return the element in the document's DOM tree with the given id.
source code
 
getEventListener(element)
See setEventListener() for more information.
source code
 
getEventsSunk(element)
Return which events are currently "sunk" for a given DOM node.
source code
 
getFirstChild(elem) source code
 
getLastChild(elem) source code
 
getInnerHTML(element) source code
 
getInnerText(element) source code
 
getIntAttribute(elem, attr) source code
 
getIntElemAttribute(elem, attr) source code
 
getIntStyleAttribute(elem, attr) source code
 
getPrevSibling(elem) source code
 
getNextSibling(elem) source code
 
getNodeType(elem) source code
 
getParent(elem) source code
 
getStyleAttribute(elem, attr) source code
 
insertChild(parent, toAdd, index) source code
 
iterChildren(elem)
Returns an iterator over all the children of the given DOM node.
source code
 
walkChildren(elem)
Walk an entire subtree of the DOM.
source code
 
isOrHasChild(parent, child) source code
 
releaseCapture(elem) source code
 
releaseCapture_impl(elem) source code
 
removeEventPreview(preview) source code
 
getOffsetHeight(elem) source code
 
getOffsetWidth(elem) source code
 
scrollIntoView(elem) source code
 
mash_name_for_glib(name, joiner='-') source code
 
removeAttribute(element, attribute) source code
 
setAttribute(element, attribute, value) source code
 
setElemAttribute(element, attribute, value) source code
 
setBooleanAttribute(elem, attr, value) source code
 
setCapture(elem) source code
 
setCapture_impl(elem) source code
 
setEventListener(element, listener)
Register an object to receive event notifications for the given element.
source code
 
createTextNode(txt) source code
 
setInnerHTML(element, html) source code
 
setInnerText(elem, text) source code
 
setIntElemAttribute(elem, attr, value) source code
 
setIntAttribute(elem, attr, value) source code
 
setIntStyleAttribute(elem, attr, value) source code
 
setOptionText(select, text, index) source code
 
setStyleAttribute(element, name, value) source code
 
setStyleAttributes(element, **kwargs)
multi attr: setStyleAttributes(self, {attr1:val1, attr2:val2, ...
source code
 
sinkEvents(element, bits)
Set which events should be captured on a given element and passed to the registered listener.
source code
 
sinkEventsMozilla(element, bits) source code
 
toString(elem) source code
 
dispatchEvent(event, element, listener) source code
 
previewEvent(evt) source code
 
dispatchEventAndCatch(evt, elem, listener, handler) source code
 
dispatchEventImpl(event, element, listener) source code
 
eventGetCurrentEvent() source code
 
insertListItem(select, item, value, index) source code
 
getBodyOffsetTop() source code
 
getBodyOffsetLeft() source code
 
eventGetMouseWheelVelocityY(evt)
these are all different, across all platforms!
source code
Variables [hide private]
  sCaptureElem = None
hash(x)
  sEventPreviewStack = []
  listeners = {}
  ELEMENT_NODE = 1
  TEXT_NODE = 3
  DOCUMENT_NODE = 9
  hack_timer_workaround_bug_button = None
hash(x)
  eventbitsmap = {}
  currentEvent = None
hash(x)
Function Details [hide private]

getChildCount(elem)

source code 

Calculate the number of children the given element has. This loops over all the children of that element and counts them.

getChildIndex(parent, toFind)

source code 

Return the index of the given child in the given parent.

This performs a linear search.

getEventsSunk(element)

source code 

Return which events are currently "sunk" for a given DOM node. See sinkEvents() for more information.

walkChildren(elem)

source code 

Walk an entire subtree of the DOM. This returns an iterator/iterable which performs a pre-order traversal of all the children of the given element.

setEventListener(element, listener)

source code 

Register an object to receive event notifications for the given element. The listener's onBrowserEvent() method will be called when a captured event occurs. To set which events are captured, use sinkEvents().

setStyleAttributes(element, **kwargs)

source code 

multi attr: setStyleAttributes(self, {attr1:val1, attr2:val2, ...})

sinkEvents(element, bits)

source code 

Set which events should be captured on a given element and passed to the registered listener. To set the listener, use setEventListener().

Parameters:
  • bits - A combination of bits; see ui.Event for bit values