Detailed Description

Represents a HTML Document. UI.document is the main UI document. Use UI.document.innerHTML to set its content.

Handles functionality for when an element wants to go fullscreen.

Manages the currently focused element for this document.

Represents a HTML Document. UI.document is the main UI document. Use PowerUI.Document.innerHTML to set it's content.

Inheritance diagram for PowerUI.HtmlDocument:
Css.ReflowDocument Dom.Document Dom.Node Dom.EventTarget Dom.IParentNode Dom.IEventTarget

Public Member Functions

void ClearCode ()
 Clears all code. More...
 
ScriptEngine GetScriptEngine (string type)
 Gets or creates a script engine of the given type. More...
 
bool TryCompile ()
 Attempts to compile all code. More...
 
object getJsVariable (string global)
 Gets or sets script variable values. More...
 
void setJsVariable (string global, object value)
 Gets or sets script variable values. More...
 
object Run (string name, params object[] args)
 Runs a nitro function by name with optional arguments. More...
 
object RunLiteral (string name, object[] args)
 Runs a nitro function by name with a set of arguments. More...
 
object RunLiteral (string name, object context, object[] args)
 Runs a nitro function by name with a set of arguments. More...
 
object RunLiteral (string name, object[] args, bool optional)
 Runs a nitro function by name with a set of arguments only if the method exists. More...
 
object RunLiteral (string name, object context, object[] args, bool optional)
 Runs a nitro function by name with a set of arguments only if the method exists. More...
 
object RunOptionally (string name, object context, params object[] args)
 Runs a nitro function by name with a set of arguments only if the method exists. More...
 
object RunOptionally (string name, params object[] args)
 Runs a nitro function by name with a set of arguments only if the method exists. More...
 
void set_location (string href)
 The JS shortcut for setting location as a string. More...
 
 HtmlDocument ()
 Creates a new document which will be rendered with a new renderer. More...
 
 HtmlDocument (Renderman renderer)
 Creates a new document which will be rendered with the given renderer. More...
 
 HtmlDocument (Renderman renderer, Window parentWindow)
 Creates a new document which will be rendered with the given renderer. More...
 
 HtmlDocument (Renderman renderer, Window parentWindow, bool aot)
 Creates a new document which will be rendered with the given renderer. More...
 
void write (string text)
 Writes the given html to the end of the document. More...
 
void writeln (string text)
 Writes the given line to the end of the document. More...
 
void close ()
 Closes the document. More...
 
void open ()
 Opens the document for writing. More...
 
override void clear ()
 Clears the document of all its content, including scripts and styles. More...
 
override string ToString ()
 
Event createEvent (string type)
 
Event createEvent (string type, string evtType, object init)
 
void MoveFocusUp ()
 If there is an element focused, this will move focus to the nearest focusable element above. You can define 'focusable' on any element, or use a tag that is focusable anyway (input, textarea, a etc). You can also define focus-up="anElementID" to override which element will be focused next. More...
 
void MoveFocusDown ()
 If there is an element focused, this will move focus to the nearest focusable element below. You can define 'focusable' on any element, or use a tag that is focusable anyway (input, textarea, a etc). You can also define focus-down="anElementID" to override which element will be focused next. More...
 
void MoveFocusLeft ()
 If there is an element focused, this will move focus to the nearest focusable element to the left. You can define 'focusable' on any element, or use a tag that is focusable anyway (input, textarea, a etc). You can also define focus-left="anElementID" to override which element will be focused next. More...
 
void MoveFocusRight ()
 If there is an element focused, this will move focus to the nearest focusable element to the right. You can define 'focusable' on any element, or use a tag that is focusable anyway (input, textarea, a etc). You can also define focus-right="anElementID" to override which element will be focused next. More...
 
void ClickFocused ()
 If there is an element focused, this will click it (mouse down and up are triggered). More...
 
void TabNext ()
 Moves the focus to the next element as defined by tabindex. If there is no currently focused element, a tabindex of 0 will be searched for. If that's not found, then the first focusable element in the DOM will be used. More...
 
void exitFullscreen ()
 Exits a fullscreen viewing. More...
 
void startDialogue (string startPath, string template)
 Starts the dialogue at the given path. It's relative to resources://Dialogue/ by default and ".json" is appended if it contains no dot. E.g. "joey" => "resources://Dialogue/joey.json". "Hello/joey" => "resources://Dialogue/Hello/joey.json". "cdn://...joey.json" => as is. Use {language} in your path to localise the file. Kills any already running dialogue in the document. More...
 
void startDialogue (string startPath, string template, bool killRunning)
 Starts the dialogue at the given path. It's relative to resources://Dialogue/ by default and ".json" is appended if it contains no dot. E.g. "joey" => "resources://Dialogue/joey.json". "Hello/joey" => "resources://Dialogue/Hello/joey.json". "cdn://...joey.json" => as is. Use {language} in your path to localise the file. More...
 
override void LoadLanguageVariable (string groupName, string variableName, LanguageTextEvent onResolved)
 Loads a variable value from the language set. Note that this occurs after checking 'diverted' variables and after custom ones too - it only looks for languages. This is essentially handled by the document.languages API. More...
 
Range createRange ()
 Creates a range. More...
 
Selection getSelection ()
 The current selection. More...
 
- Public Member Functions inherited from Css.ReflowDocument
KeyframesRule GetAnimation (string name)
 Gets an animation by name. Any case. More...
 
void RequireMediaType ()
 Creates the media type if it's not already been set. More...
 
MediaQueryList matchMedia (string mediaQuery)
 Matches the given CSS media string. More...
 
void AddStyle (Css.StyleSheet sheet, string css)
 Adds the given css style to the document. Used by style tags. More...
 
Css.StyleSheet GetStyle (string href)
 Gets a stylesheet by its href. More...
 
void ClearStyle ()
 Clears all css style definitions from this document. More...
 
Css.StyleSheet AddStyle (Node ele, string css)
 Adds the given css style to the document. Used by style tags. More...
 
Css.Style getStyleBySelector (string selectorText)
 Gets a style definition by css selector from the StyleSheet. If it's not found in the style sheet, the default stylesheet is checked. More...
 
List< Css.StylegetStylesBySelector (string selectorText)
 Gets a style definition by css selector from the StyleSheet. If it's not found in the style sheet, the default stylesheet is checked. More...
 
Element querySelector (string selector)
 Selects the first element from this document that matches the given CSS selector. Do note that this is not designed to be used in high-performance situations and you should cache the results as much as possible. More...
 
Dom.NodeList querySelectorAll (string selector)
 Selects elements from this document using the given CSS selector. Do note that this is not designed to be used in high-performance situations and you should cache the results as much as possible. More...
 
Dom.NodeList querySelectorAll (string selector, bool one)
 Selects elements from this document using the given CSS selector. Do note that this is not designed to be used in high-performance situations and you should cache the results as much as possible. More...
 
Css.Style getStyleBySelector (Css.Selector selector)
 Attempts to get a style from this sheet by selector. More...
 
List< Css.StylegetStylesBySelector (Css.Selector selector)
 Attempts to get one or more styles from this sheet by selector. More...
 
 ReflowDocument (WorldUI world)
 
Css.ComputedStyle getComputedStyle (HtmlElement element)
 Gives the values of all the CSS properties of an element after applying the active stylesheets and resolving any basic computation those values may contain. More...
 
void RequireStyleSheet (Element e)
 Checks if the stylesheet for the namespace the given namespace is in is included in the document. More...
 
Element elementFromPoint (float x, float y)
 Gets the element at the given coordinates. It first checks if the point is on screen (within Viewport). If it is then a fast lookup occurs. Otherwise, all elements in the DOM are tested. More...
 
DynamicFont GetOrCreateFont (string fontName)
 Gets the font with the given name. May load it from the cache or generate a new one. More...
 
DynamicFont GetFont (string fontName)
 Gets the font with the given name. More...
 
void FontLoaded (DynamicFont font)
 Called when an -face font loads. More...
 
void RequestLayout ()
 Requests the document to re-layout. More...
 
- Public Member Functions inherited from Dom.Document
 Document ()
 
void LoadHtml (string html, int mode)
 A simple loader which uses a HTML5 parser to load the given string. More...
 
void LoadHtml (string html)
 A simple loader which uses a HTML5 parser to load the given string. More...
 
override bool isEqualNode (Node other)
 Tests whether two nodes are the same by attribute comparison. More...
 
override string ToString ()
 
TextNode createTextNode ()
 Creates a text node. More...
 
Comment createComment ()
 Creates a comment node. More...
 
Element createElementNS (string namespaceName, string tag)
 Creates a new element in this document with the given namespace. You'll need to parent it to something. More...
 
Element createElement (string tag)
 Creates a new element in this document. You'll need to parent it to something. E.g. with thisDocument.body.appendChild(...). Alternative to innerHTML and appendInnerHTML. More...
 
DocumentFragment createDocumentFragment ()
 Creates a new document fragment in this document. More...
 
void RemoveCachedElement (Element ele)
 Removes the given element from any attribute caches. You must check AttributesCached first. More...
 
void IndexAttribute (string attrib)
 Request that the given attribute will be indexed. More...
 
void StartAttributeIndex (string attrib)
 Starts indexing the given attribute right now. More...
 
- Public Member Functions inherited from Dom.Node
HtmlElement getByTagName (string tag)
 Casts getElementByTagName to a HtmlElement for you (exists because of SVG and MathML). More...
 
HtmlElement getById (string id)
 Casts getElementById to a HtmlElement for you (exists because of SVG and MathML). More...
 
HtmlElement getByAttribute (string property, string value)
 Casts getElementByAttribute to a HtmlElement for you (exists because of SVG and MathML). More...
 
bool isBefore (Node other)
 True if this element is before the other one in the DOM. More...
 
void insertAfter (Node toInsert, Node after)
 Inserts the given element after the given one. More...
 
Node prependChild (Node child)
 Prepends the given element as a child. More...
 
Node insertBefore (Node toInsert, Node before)
 Inserts the given element before the given one. More...
 
Node replaceChild (Node with, Node element)
 Replaces the given child with another. More...
 
Node appendChild (Node element)
 Adds the given element to the children of this element. More...
 
Node moveChild (Node toMove, int index)
 Moves the given node to the given new index. More...
 
Node removeChildAt (int index)
 Removes the child at the given index from this element. More...
 
Node removeChild (Node element)
 Removes the given child from this element. More...
 
bool hasChildNodes ()
 True if this element has any child nodes. More...
 
virtual bool OnLexerAddNode (HtmlLexer lexer, int mode)
 Called when this node has been created and is being added to the given lexer. Closely related to Element.OnLexerCloseNode. More...
 
virtual Node cloneNode (bool deep)
 Clones this node. More...
 
void normalize ()
 Normalises this node. More...
 
bool isSupported (string feature, string version)
 Is the given feature supported? More...
 
bool hasAttributes ()
 Does this node have any attributes? More...
 
ushort compareDocumentPosition (Node other)
 Compare document position (two elements only here). More...
 
bool isParentOf (Node node)
 True if this is a parent of the given node. More...
 
bool contains (Node node)
 True if the given node is a descendant of this or not. More...
 
string lookupNamespaceURI (string nsUri)
 Looks up a namespace URI, returning the prefix. More...
 
HTMLCollection getElementsByClassName (string className)
 Gets all elements with the given class name(s), seperated by spaces. May include this element or any of it's kids. More...
 
Element getElementByTagNameNS (string namespaceURI, string tag)
 Gets the first child element with the given tag. More...
 
HTMLCollection getElementsByTagNameNS (string namespaceURI, string tag)
 Gets all child elements with the given tag. More...
 
HTMLCollection getElementsByTagNameNS (MLNamespace ns, string tag, bool stopWithOne)
 Gets all child elements with the given tag. More...
 
bool getElementsByTagNameNS (MLNamespace ns, string tag, bool stopWithOne, INodeList results)
 Gets all child elements with the given tag. More...
 
Element getElementByTagName (string tag)
 Gets the first child element with the given tag. More...
 
HTMLCollection getElementsByTagName (string tag)
 Gets all child elements with the given tag. More...
 
HTMLCollection getElementsByTagName (string tag, bool stopWithOne)
 Gets all child elements with the given tag. More...
 
bool getElementsByTagName (string tag, bool stopWithOne, INodeList results)
 Gets all child elements with the given tag. More...
 
Element getElementByName (string name)
 Gets the first child element with the given name. More...
 
HTMLCollection getElementsByName (string name)
 Gets all child elements with the given name. More...
 
HTMLCollection getElementsByName (string name, bool stopWithOne)
 Gets all child elements with the given name. More...
 
bool getElementsByName (string name, bool stopWithOne, INodeList results)
 Gets all child elements with the given name. More...
 
Element getElementById (string value)
 Gets a child element by ID. More...
 
NodeList getElementsByAttribute (string property, string value)
 Gets all elements with the given attribute. May include this element or any of it's kids. More...
 
NodeList getElementsWithProperty (string property, string value)
 Gets all elements with the given attribute. May include this element or any of it's kids. More...
 
void getElementsByAttribute (string property, string value, INodeList results)
 Gets all elements with the given property. May include this element or any of it's kids. More...
 
void getElementsByClassName (string[] classes, INodeList results)
 Gets all elements with the given class name(s). May include this element or any of it's kids. More...
 
Element getElementByAttribute (string property, string value)
 Gets an element with the given attribute. May be this element or any of it's kids. More...
 
bool isSameNode (Node other)
 Tests whether two nodes are the same, that is if they reference the same object More...
 
bool isDefaultNamespace (string nsUri)
 Tests if this elements default namespace is the same as the given one. More...
 
string lookupPrefix (string prefix)
 Looks up a namespace prefix, returning the namespace URI. More...
 
Node remove ()
 Removes this node from the tree it belongs to. More...
 
virtual void ToString (System.Text.StringBuilder result)
 
override string ToString ()
 
Node insertChild (int index, Node child)
 Inserts a child into this element at the given index. Pushes any elements at the given index over. More...
 
Node replaceWith (Node element)
 Replaces this element with the given element. More...
 
virtual bool OnAttributeChange (string attribute)
 Called on an instance of this handler when an attribute on the element it's attached to changes. It's also called when the tag is being loaded. More...
 
- Public Member Functions inherited from Dom.EventTarget
void ClearEvents ()
 Clears all events on this document. More...
 
bool dispatchEvent (Event e)
 Runs an event of the given name. More...
 
void addEventListener (string name, EventListener listener)
 Adds an event listener to this document. More...
 
void addEventListener (string name, EventListener listener, bool useCapture)
 Adds an event listener to this document. More...
 
void removeEventListener (string name, object evtHandlerInternal)
 Removes an event listener from this document. More...
 
void addEventListener (string name, AnimationEventDelegate method)
 
void addEventListener (string name, AudioProcessingEventDelegate method)
 
void addEventListener (string name, BeforeInputEventDelegate method)
 
void addEventListener (string name, BeforeUnloadEventDelegate method)
 
void addEventListener (string name, BlobEventDelegate method)
 
void addEventListener (string name, ClipboardEventDelegate method)
 
void addEventListener (string name, CloseEventDelegate method)
 
void addEventListener (string name, CompositionEventDelegate method)
 
void addEventListener (string name, CustomEventDelegate method)
 
void addEventListener (string name, CSSFontFaceLoadEventDelegate method)
 
void addEventListener (string name, DeviceLightEventDelegate method)
 
void addEventListener (string name, DeviceMotionEventDelegate method)
 
void addEventListener (string name, DeviceOrientationEventDelegate method)
 
void addEventListener (string name, DeviceProximityEventDelegate method)
 
void addEventListener (string name, DomEventDelegate method)
 
void addEventListener (string name, DOMTransactionEventDelegate method)
 
void addEventListener (string name, DragEventDelegate method)
 
void addEventListener (string name, EditingBeforeInputEventDelegate method)
 
void addEventListener (string name, ErrorEventDelegate method)
 
void addEventListener (string name, FetchEventDelegate method)
 
void addEventListener (string name, FocusEventDelegate method)
 
void addEventListener (string name, GamepadEventDelegate method)
 
void addEventListener (string name, HashChangeEventDelegate method)
 
void addEventListener (string name, IDBVersionChangeEventDelegate method)
 
void addEventListener (string name, InputEventDelegate method)
 
void addEventListener (string name, KeyboardEventDelegate method)
 
void addEventListener (string name, MediaStreamEventDelegate method)
 
void addEventListener (string name, MessageEventDelegate method)
 
void addEventListener (string name, MouseEventDelegate method)
 
void addEventListener (string name, MutationEventDelegate method)
 
void addEventListener (string name, OfflineAudioCompletionEventDelegate method)
 
void addEventListener (string name, PageTransitionEventDelegate method)
 
void addEventListener (string name, PointerEventDelegate method)
 
void addEventListener (string name, PopStateEventDelegate method)
 
void addEventListener (string name, ProgressEventDelegate method)
 
void addEventListener (string name, RelatedEventDelegate method)
 
void addEventListener (string name, RTCDataChannelEventDelegate method)
 
void addEventListener (string name, RTCIdentityErrorEventDelegate method)
 
void addEventListener (string name, RTCIdentityEventDelegate method)
 
void addEventListener (string name, RTCPeerConnectionIceEventDelegate method)
 
void addEventListener (string name, SensorEventDelegate method)
 
void addEventListener (string name, StorageEventDelegate method)
 
void addEventListener (string name, TextEventDelegate method)
 
void addEventListener (string name, TimeEventDelegate method)
 
void addEventListener (string name, TouchEventDelegate method)
 
void addEventListener (string name, TrackEventDelegate method)
 
void addEventListener (string name, TransitionEventDelegate method)
 
void addEventListener (string name, UIEventDelegate method)
 
void addEventListener (string name, UserProximityEventDelegate method)
 
void addEventListener (string name, WebGLContextEventDelegate method)
 
void addEventListener (string name, WheelEventDelegate method)
 
void addEventListener (string name, Nitro.DynamicMethod< Nitro.Void > listener)
 
void addEventListener (string name, Nitro.DynamicMethod< Nitro.Void > listener, bool capture)
 
void addEventListener (string name, ContextEventDelegate method)
 
void addEventListener (string name, SlideEventDelegate method)
 
void addEventListener (string name, PowerUI.SpriteEventDelegate method)
 
void addEventListener (string name, SVGEventDelegate method)
 Adds an event listener to this document. More...
 
void addEventListener (string name, SVGZoomEventDelegate method)
 

Public Attributes

bool AotDocument
 True if this is a Nitro AOT compilation document. More...
 
string ScriptLocation
 Only used by Nitro AOT. The location of the html file for error reporting. More...
 
Dictionary< string, ScriptEngineEngines
 The available script engines for this document, indexed by script type. More...
 
HtmlHtmlElement html
 The HTML element of the document. This is the outermost tag of the document. More...
 
HtmlBodyElement body
 The body element of the document. It's contained within the html element. More...
 
Window window
 The window that this document belongs to. More...
 
DomEventDelegate AfterClearBeforeSet
 An event called after clear but before the new content is set. Allows hooking up of various events. More...
 
string domain_
 A custom set domain value. More...
 
bool FinishedParsing
 True if we're done parsing and setting the innerHTML of the body tag. Used to guage when the code should be compiled. More...
 
string baseTarget
 An overriding base target which any links will use if they have no target defined. See the HTML 'base' tag. More...
 
HtmlElement fullscreenElement
 The current fullscreen element, if any. More...
 
- Public Attributes inherited from Css.ReflowDocument
Dictionary< string,
Css.AtRules.CounterStyleRule
CssCounters
 The available counter-style rules. More...
 
Dictionary< string,
Css.AtRules.FontFeatureValuesRule
FontFeatures
 A fast lookup of the media rules on this document. More...
 
Dictionary< string, KeyframesRuleAnimations
 The set of animations on this document. More...
 
List< MediaRuleMediaRules
 A fast lookup of the media rules on this document. More...
 
List< Css.StyleRuleAnySelectors =new List<Css.StyleRule>()
 The set of all * rules. It's a set because there may be some being specific, like *[type]. More...
 
Dictionary< string, int > SelectorAttributes =new Dictionary<string,int>()
 A set of attributes used by any selectors. (e.g. input[type=..] is a "type" attrib). More...
 
Dictionary< string, List
< Css.StyleRule > > 
SelectorStubs =new Dictionary<string,List<Css.StyleRule>>()
 A lookup of the selector "stubs". For example, ul li{} has a "stub" of ul. Always a id, .class or tag. Usually the most leftward component of a selector. More...
 
List< Css.StyleSheetstyleSheets =new List<Css.StyleSheet>()
 The style sheets on the document. More...
 
Dictionary< string, Css.ValueCssVariables =new Dictionary<string,Css.Value>()
 The CSS variables within this document. More...
 
WorldUI worldUI
 The worldUI this document is in. More...
 
Viewport Viewport
 This documents viewport. Defaults to the info from ScreenInfo. More...
 
float Zoom =1f
 Base zoom value. Applies whenever CSS zoom is 'auto'. More...
 
Element activeElement
 The currently focused element. More...
 
Dictionary< string, DynamicFontActiveFonts
 A set of all fonts available to this renderer, indexed by font name. More...
 
Renderman Renderer
 The renderer which will render this document. More...
 
- Public Attributes inherited from Dom.Document
DocumentType doctype
 The document type of this document. More...
 
Dictionary< string,
AttributeLookup
AttributeIndex
 An attribute index, used to dramatically speed up frequently used unique attributes (like id). More...
 
- Public Attributes inherited from Dom.Node
MLNamespace Namespace
 The namespace this node belongs to. More...
 
Dictionary< string, string > Properties =new Dictionary<string,string>()
 The set of attributes on this tag. An attribute is e.g. style="display:none;". More...
 
const ushort ELEMENT_NODE =1
 
const ushort ATTRIBUTE_NODE =2
 
const ushort TEXT_NODE =3
 
const ushort CDATA_SECTION_NODE =4
 
const ushort ENTITY_REFERENCE_NODE =5
 
const ushort ENTITY_NODE =6
 
const ushort PROCESSING_INSTRUCTION_NODE =7
 
const ushort COMMENT_NODE =8
 
const ushort DOCUMENT_NODE =9
 
const ushort DOCUMENT_TYPE_NODE =10
 
const ushort DOCUMENT_FRAGMENT_NODE =11
 
const ushort DOCUMENT_NOTATION_NODE =12
 
const ushort DOCUMENT_POSITION_DISCONNECTED =1
 
const ushort DOCUMENT_POSITION_PRECEDING =2
 
const ushort DOCUMENT_POSITION_FOLLOWING =4
 
const ushort DOCUMENT_POSITION_CONTAINS =8
 
const ushort DOCUMENT_POSITION_CONTAINED_BY =16
 
const ushort DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC =32
 
- Public Attributes inherited from Dom.EventTarget
EventsSet Events
 A set of events for this document. See addEventListener. More...
 

Package Functions

override void SetLocation (Location value, bool addHistory)
 Don't use this directly; use location instead. More...
 
void SetRawLocation (Location path)
 Sets location without navigating to it. More...
 
void GotDocumentContent (string html, int status, bool openClose)
 Sets the document content with a status code. Displays error info if html is blank or ErrorHandlers.CatchAll is set. More...
 
override bool ResourceStatus (EventTarget package, int status)
 Called when a resource for this document is loading. More...
 
void LanguageChanged ()
 Called when the language has been changed. More...
 
void clearSelection ()
 Clears any selection. More...
 
- Package Functions inherited from Css.ReflowDocument
Element elementFromPointOnScreen (float x, float y)
 Gets the element at the given coordinates when the point is known to be on screen. This is a lot faster than OffScreen, particularly if there are large parts of hidden scrollable content (most web pages). More...
 
Element elementFromPointOffScreen (float x, float y)
 Expected to almost never occur - this performs a full DOM scan in order to find the element at the given offscreen location. More...
 

Package Attributes

bool IsOpen
 True if the doc is currently open. More...
 
Languages languages_
 The document.languages API. Use languages instead. More...
 

Properties

DomEventDelegate ontitlechange [get, set]
 Called when the title of this document changes. More...
 
DomEventDelegate ontooltipchange [get, set]
 Called when the tooltip for this document changes. More...
 
DomEventDelegate onresize [get, set]
 Called when the document resizes. More...
 
KeyboardEventDelegate onkeyup [get, set]
 Called when a key goes up. More...
 
KeyboardEventDelegate onkeydown [get, set]
 Called when a key goes down. More...
 
MouseEventDelegate onmousemove [get, set]
 Called when the mouse moves. More...
 
BeforeUnloadEventDelegate onbeforeunload [get, set]
 Called when the document is about to be unloaded. More...
 
NitroScriptEngine NitroEngine [get]
 Gets the existing JS engine for this document. More...
 
override object GlobalScope [get]
 The global scope. More...
 
override string Target [get]
 The documents current target. It's the same as location.hash. More...
 
override Dom.Element documentElement [get]
 The root style node. More...
 
HtmlElement head [get]
 The head element if there is one. More...
 
int innerWidth [get]
 Available width. More...
 
int innerHeight [get]
 Available height. More...
 
string domain [get, set]
 Document domain. More...
 
string origin [get]
 The document origin. More...
 
override EventTarget windowTarget [get]
 A window event target if there is one. More...
 
override EventTarget eventTargetParentNode [get]
 The parent node as used by EventTarget during capture. Can be null. More...
 
string characterSet [get]
 The character set this document is using. More...
 
string charset [get]
 The character set this document is using. More...
 
string inputEncoding [get]
 The input encoding set this document is using. More...
 
string bgColor [get, set]
 The document background color. More...
 
string ggColor [get, set]
 The document foreground (font) color. More...
 
HTMLCollection forms [get]
 All forms on the document. More...
 
Window defaultView [get]
 A reference to the window object. More...
 
HTMLCollection embeds [get]
 All embeds on the document. More...
 
HTMLCollection applets [get]
 All applets on the document. More...
 
HTMLCollection images [get]
 All images on the document. More...
 
HTMLCollection links [get]
 All links on the document. More...
 
HTMLCollection scripts [get]
 All scripts on the document. More...
 
string dir [get, set]
 Document directionality. More...
 
bool designMode [get, set]
 Gets or sets design mode (content editable) on the whole document. More...
 
HTMLCollection anchors [get]
 All the links on a page. More...
 
HTMLCollection plugins [get]
 The plugins on the page. More...
 
string URL [get]
 The location as a string. More...
 
override string title [get, set]
 The title of the document. This originates from <title> tags. More...
 
string tooltip [get, set]
 The tooltip of the document. This originates from <.. title="tooltip">. Note that this is set internally. More...
 
override string innerML [get, set]
 Gets or sets the innerHTML of this document. More...
 
string innerHTML [get, set]
 Gets or sets the innerHTML of this document. More...
 
string cookie [get, set]
 
HtmlElement htmlActiveElement [get]
 Current focused element casted to a HtmlElement (generally you should use activeElement instead). More...
 
bool fullscreen [get]
 Is something currently fullscreen? More...
 
bool fullscreenEnabled [get]
 Is full screen available for this document? More...
 
Windows.Manager sparkWindows [get]
 The document.windows API. Read only. More...
 
Languages languages [get]
 The document.languages API. More...
 
- Properties inherited from Css.ReflowDocument
MediaType MediaIfExists [get]
 'Media' is created on first use if you access it. This is the cached media object. I.e. this can be null. More...
 
MediaType Media [get, set]
 The media type of this document. Created on first use. More...
 
bool hasFocus [get]
 True if an element in the document has focus. More...
 
- Properties inherited from Dom.Document
DOMImplementation implementation [get]
 
string readyState [get]
 The current document ready state. More...
 
Location location [get, set]
 The current location of this document. Originates from the src attribute of iframes or is 'resources://' by default. More...
 
Location basepath [get, set]
 The path that this document is relative to (if any). Set to null to use document.location. More...
 
override string baseURI [get]
 The path that this document is relative to (if any). More...
 
virtual Element documentElement [get]
 The root document element. It must also subscribe to IRenderableNode. More...
 
override string nodeName [get]
 The name for this type of node. More...
 
NodeIterator allNodes [get]
 An iteratable set of all nodes from this document. Whilst iterating you can actively skip nodes, so it's often useful to cache this first. More...
 
virtual string title [get, set]
 Document title. More...
 
virtual object GlobalScope [get]
 The global scripting scope. More...
 
override ushort nodeType [get]
 The type of element that this is. More...
 
virtual string Target [get]
 The documents current target. It's the same as location.hash. More...
 
override Document ownerDocument [get]
 The owning document. More...
 
virtual string innerML [get, set]
 Gets or sets the inner markup of this document. More...
 
virtual EventTarget windowTarget [get]
 A window event target if there is one. More...
 
bool AttributesCached [get]
 True if more than one attribute is cached. More...
 
- Properties inherited from Dom.Node
HtmlElement htmlParentNode [get]
 The parent as a HtmlElement (convenience method). More...
 
HtmlDocument htmlDocument [get]
 The ownerDocument as a Html document. More...
 
string this[string property] [get, set]
 Gets or sets the named attribute of this tag. An attribute is e.g. style="display:none;". More...
 
virtual bool ClearBackground [get]
 True if this node should clear the background state of the renderer. The background state essentially declares if this nodes background-color or background-image represents the viewports background. In HTML, both the body tag and root html tag can represent the background, so the root HTML node doesn't clear the state to allow body to set it if needed. So, only the root html element overrides this (and this is better than checking for .Tag=="html"). More...
 
override EventTarget eventTargetParentNode [get]
 The parent node as used by EventTarget during capture. Can be null. More...
 
Document document [get]
 The document that this node belongs to. More...
 
virtual string nodeName [get]
 The name for this type of node. More...
 
virtual string nodeValue [get, set]
 The value of this node. More...
 
virtual ushort nodeType [get]
 The type of element that this is. More...
 
Node firstChild [get]
 The first child of this element. More...
 
Node lastChild [get]
 The last child of this element. More...
 
Node previousSibling [get]
 The sibling before this one under this elements parent. Null if this is the first child. More...
 
Node nextSibling [get]
 The sibling following this one under this elements parent. Null if this is the last child. More...
 
Element previousElementSibling [get]
 The next non-text node sibling. More...
 
Element nextElementSibling [get]
 The next non-text node sibling. More...
 
virtual Document ownerDocument [get]
 The owner document. More...
 
virtual string localName [get]
 The local name of this node. More...
 
virtual string baseURI [get]
 The base URI. More...
 
string namespaceURI [get]
 The namespace this node is in. More...
 
string innerText [get, set]
 Gets or sets the text content of this element (i.e. the content without any html.). Setting this is good for preventing any html injection as it will be taken literally. More...
 
bool isRooted [get]
 True if this element is in any document and is rooted. More...
 
string outerText [get, set]
 Gets or sets the text content of this element (i.e. the content without any html.). Setting this is good for preventing any html injection as it will be taken literally. More...
 
virtual string textContent [get, set]
 Gets or sets the text content of this element (i.e. the content without any html.). Setting this is good for preventing any html injection as it will be taken literally. More...
 
Element parentElement [get]
 Gets the parent html element of this element. More...
 
string prefix [get]
 The prefix (namespace). More...
 
Node rootNode [get]
 The root node. More...
 
NodeList childNodes [get]
 The set of children of this element. More...
 
HTMLCollection children [get]
 The set of children elements. More...
 
int sameNameIndex [get]
 Gets the index of this element in it's parents childNodes in terms of child elements that have the same name (tag) as this one. More...
 
int childIndex [get]
 Gets the index of this element in it's parents childNodes. More...
 
int childElementCount [get]
 The number of child elements of this element. More...
 
int childCount [get]
 The number of children of this element. More...
 
Element firstElementChild [get]
 The first non-text child of this element. More...
 
Element lastElementChild [get]
 The last non-text child of this element. More...
 
string id [get, set]
 The ID of this element. Won't ever be null. More...
 
string className [get, set]
 The css class attribute of this element. Won't ever be null. Note that it can potentially hold multiple names, e.g. "red button". Use classList for those. More...
 
Node parentNode [get]
 This nodes parent node. More...
 
DOMTokenList classList [get]
 The set of class names. More...
 
- Properties inherited from Dom.EventTarget
static DispatchStack dispatchStackRef [get]
 The active dispatch stack. Use event.deepPath to access it (available during dispatch only). More...
 
virtual EventTarget eventTargetParentNode [get]
 The parent node as used by EventTarget during capture. Can be null. More...
 
virtual NodeList eventTargetChildren [get]
 The childNode set as used by EventTarget during capture. Can be null. More...
 
- Properties inherited from Dom.IParentNode
NodeList childNodes [get]
 The kids of this node. More...
 
Node parentNode [get]
 The parent node. More...
 
Element parentElement [get]
 The parent element. More...
 
int childCount [get]
 The number of kids of this node. More...
 
int childElementCount [get]
 The number of child elements of this parent. More...
 
HTMLCollection children [get]
 The kids of this node. More...
 
Element firstElementChild [get]
 The first element child of this node. More...
 
Element lastElementChild [get]
 The last element child of this node. More...
 

Private Attributes

string CurrentTitle
 The title of the document. This originates from <title> tags. More...
 
string CurrentTooltip
 The tooltip of the document. This originates from <.. title="tooltip">. See Document.tooltip. More...
 
Windows.Manager windows_
 Instance of a window manager. May be null. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Dom.Node
static bool PropertiesEqual (Dictionary< string, string > a, Dictionary< string, string > b)
 True if two args sets are equal. More...
 
- Static Public Attributes inherited from Dom.Document
static bool AllowScripts =true
 Turn this off to block scripts. More...
 
- Protected Member Functions inherited from Dom.Document
void ReadyStateChange (int state)
 Changes the ready state of this document.</summrry> More...
 
void ContentLoadedEvent ()
 Dispatches the DOMContentLoaded event. More...
 
- Static Package Attributes inherited from Dom.EventTarget
static DispatchStack PooledStack
 The current head of the pooled dispatched stacks. More...
 

Constructor & Destructor Documentation

PowerUI.HtmlDocument.HtmlDocument ( )
inline

Creates a new document which will be rendered with a new renderer.

PowerUI.HtmlDocument.HtmlDocument ( Renderman  renderer)
inline

Creates a new document which will be rendered with the given renderer.

Parameters
rendererThe renderer to use when rendering this document.
PowerUI.HtmlDocument.HtmlDocument ( Renderman  renderer,
Window  parentWindow 
)
inline

Creates a new document which will be rendered with the given renderer.

Parameters
rendererThe renderer to use when rendering this document.
parentWindowThe window that will become the parent window. Used in e.g. iframes.
PowerUI.HtmlDocument.HtmlDocument ( Renderman  renderer,
Window  parentWindow,
bool  aot 
)
inline

Creates a new document which will be rendered with the given renderer.

Parameters
rendererThe renderer to use when rendering this document.
parentWindowThe window that will become the parent window. Used in e.g. iframes.
aotTrue if this is a Nitro AOT document (used in the Editor only).

Member Function Documentation

override void PowerUI.HtmlDocument.clear ( )
inlinevirtual

Clears the document of all its content, including scripts and styles.

Reimplemented from Css.ReflowDocument.

void PowerUI.HtmlDocument.ClearCode ( )
inline

Clears all code.

void PowerUI.HtmlDocument.clearSelection ( )
inlinepackage

Clears any selection.

void PowerUI.HtmlDocument.ClickFocused ( )
inline

If there is an element focused, this will click it (mouse down and up are triggered).

void PowerUI.HtmlDocument.close ( )
inline

Closes the document.

Event PowerUI.HtmlDocument.createEvent ( string  type)
inline
Event PowerUI.HtmlDocument.createEvent ( string  type,
string  evtType,
object  init 
)
inline
Range PowerUI.HtmlDocument.createRange ( )
inline

Creates a range.

void PowerUI.HtmlDocument.exitFullscreen ( )
inline

Exits a fullscreen viewing.

object PowerUI.HtmlDocument.getJsVariable ( string  global)
inline

Gets or sets script variable values.

Parameters
indexThe name of the variable.
Returns
The variable value.
ScriptEngine PowerUI.HtmlDocument.GetScriptEngine ( string  type)
inline

Gets or creates a script engine of the given type.

Selection PowerUI.HtmlDocument.getSelection ( )
inline

The current selection.

void PowerUI.HtmlDocument.GotDocumentContent ( string  html,
int  status,
bool  openClose 
)
inlinepackage

Sets the document content with a status code. Displays error info if html is blank or ErrorHandlers.CatchAll is set.

void PowerUI.HtmlDocument.LanguageChanged ( )
inlinepackage

Called when the language has been changed.

override void PowerUI.HtmlDocument.LoadLanguageVariable ( string  groupName,
string  variableName,
LanguageTextEvent  onResolved 
)
inlinevirtual

Loads a variable value from the language set. Note that this occurs after checking 'diverted' variables and after custom ones too - it only looks for languages. This is essentially handled by the document.languages API.

Reimplemented from Dom.Document.

void PowerUI.HtmlDocument.MoveFocusDown ( )
inline

If there is an element focused, this will move focus to the nearest focusable element below. You can define 'focusable' on any element, or use a tag that is focusable anyway (input, textarea, a etc). You can also define focus-down="anElementID" to override which element will be focused next.

void PowerUI.HtmlDocument.MoveFocusLeft ( )
inline

If there is an element focused, this will move focus to the nearest focusable element to the left. You can define 'focusable' on any element, or use a tag that is focusable anyway (input, textarea, a etc). You can also define focus-left="anElementID" to override which element will be focused next.

void PowerUI.HtmlDocument.MoveFocusRight ( )
inline

If there is an element focused, this will move focus to the nearest focusable element to the right. You can define 'focusable' on any element, or use a tag that is focusable anyway (input, textarea, a etc). You can also define focus-right="anElementID" to override which element will be focused next.

void PowerUI.HtmlDocument.MoveFocusUp ( )
inline

If there is an element focused, this will move focus to the nearest focusable element above. You can define 'focusable' on any element, or use a tag that is focusable anyway (input, textarea, a etc). You can also define focus-up="anElementID" to override which element will be focused next.

void PowerUI.HtmlDocument.open ( )
inline

Opens the document for writing.

override bool PowerUI.HtmlDocument.ResourceStatus ( EventTarget  package,
int  status 
)
inlinepackagevirtual

Called when a resource for this document is loading.

Reimplemented from Dom.Document.

object PowerUI.HtmlDocument.Run ( string  name,
params object[]  args 
)
inline

Runs a nitro function by name with optional arguments.

Parameters
nameThe name of the function in lowercase.
argsOptional arguments to use when calling the function.
Returns
The value that the called function returned, if any.
object PowerUI.HtmlDocument.RunLiteral ( string  name,
object[]  args 
)
inline

Runs a nitro function by name with a set of arguments.

Parameters
nameThe name of the function in lowercase.
argsThe set of arguments to use when calling the function.
Returns
The value that the called function returned, if any.
object PowerUI.HtmlDocument.RunLiteral ( string  name,
object  context,
object[]  args 
)
inline

Runs a nitro function by name with a set of arguments.

Parameters
nameThe name of the function in lowercase.
contextThe context to use for the 'this' value.
argsThe set of arguments to use when calling the function.
Returns
The value that the called function returned, if any.
object PowerUI.HtmlDocument.RunLiteral ( string  name,
object[]  args,
bool  optional 
)
inline

Runs a nitro function by name with a set of arguments only if the method exists.

Parameters
nameThe name of the function in lowercase.
argsThe set of arguments to use when calling the function.
optionalTrue if the method call is optional. No exception is thrown if not found.
Returns
The value that the called function returned, if any.
object PowerUI.HtmlDocument.RunLiteral ( string  name,
object  context,
object[]  args,
bool  optional 
)
inline

Runs a nitro function by name with a set of arguments only if the method exists.

Parameters
nameThe name of the function in lowercase.
contextThe context to use for the 'this' value.
argsThe set of arguments to use when calling the function.
optionalTrue if the method call is optional. No exception is thrown if not found.
Returns
The value that the called function returned, if any.
object PowerUI.HtmlDocument.RunOptionally ( string  name,
object  context,
params object[]  args 
)
inline

Runs a nitro function by name with a set of arguments only if the method exists.

Parameters
nameThe name of the function in lowercase.
contextThe context to use for the 'this' value.
optionalTrue if the method call is optional. No exception is thrown if not found.
argsThe set of arguments to use when calling the function.
Returns
The value that the called function returned, if any.
object PowerUI.HtmlDocument.RunOptionally ( string  name,
params object[]  args 
)
inline

Runs a nitro function by name with a set of arguments only if the method exists.

Parameters
nameThe name of the function in lowercase.
optionalTrue if the method call is optional. No exception is thrown if not found.
argsThe set of arguments to use when calling the function.
Returns
The value that the called function returned, if any.
void PowerUI.HtmlDocument.set_location ( string  href)
inline

The JS shortcut for setting location as a string.

void PowerUI.HtmlDocument.setJsVariable ( string  global,
object  value 
)
inline

Gets or sets script variable values.

Parameters
indexThe name of the variable.
Returns
The variable value.
override void PowerUI.HtmlDocument.SetLocation ( Location  value,
bool  addHistory 
)
inlinepackagevirtual

Don't use this directly; use location instead.

Reimplemented from Dom.Document.

void PowerUI.HtmlDocument.SetRawLocation ( Location  path)
inlinepackage

Sets location without navigating to it.

void PowerUI.HtmlDocument.startDialogue ( string  startPath,
string  template 
)
inline

Starts the dialogue at the given path. It's relative to resources://Dialogue/ by default and ".json" is appended if it contains no dot. E.g. "joey" => "resources://Dialogue/joey.json". "Hello/joey" => "resources://Dialogue/Hello/joey.json". "cdn://...joey.json" => as is. Use {language} in your path to localise the file. Kills any already running dialogue in the document.

Parameters
templateThe window template to use. Note that the window doesn't need to be visual - it could, for example, manage a bunch of WorldUI's instead.
void PowerUI.HtmlDocument.startDialogue ( string  startPath,
string  template,
bool  killRunning 
)
inline

Starts the dialogue at the given path. It's relative to resources://Dialogue/ by default and ".json" is appended if it contains no dot. E.g. "joey" => "resources://Dialogue/joey.json". "Hello/joey" => "resources://Dialogue/Hello/joey.json". "cdn://...joey.json" => as is. Use {language} in your path to localise the file.

Parameters
templateThe window template to use. Note that the window doesn't need to be visual - it could, for example, manage a bunch of WorldUI's instead.
killRunningKills any open dialogue in the document.
void PowerUI.HtmlDocument.TabNext ( )
inline

Moves the focus to the next element as defined by tabindex. If there is no currently focused element, a tabindex of 0 will be searched for. If that's not found, then the first focusable element in the DOM will be used.

override string PowerUI.HtmlDocument.ToString ( )
inline
bool PowerUI.HtmlDocument.TryCompile ( )
inline

Attempts to compile all code.

void PowerUI.HtmlDocument.write ( string  text)
inline

Writes the given html to the end of the document.

Parameters
textThe html to write.
void PowerUI.HtmlDocument.writeln ( string  text)
inline

Writes the given line to the end of the document.

Parameters
textThe html to write.

Member Data Documentation

DomEventDelegate PowerUI.HtmlDocument.AfterClearBeforeSet

An event called after clear but before the new content is set. Allows hooking up of various events.

bool PowerUI.HtmlDocument.AotDocument

True if this is a Nitro AOT compilation document.

string PowerUI.HtmlDocument.baseTarget

An overriding base target which any links will use if they have no target defined. See the HTML 'base' tag.

HtmlBodyElement PowerUI.HtmlDocument.body

The body element of the document. It's contained within the html element.

string PowerUI.HtmlDocument.CurrentTitle
private

The title of the document. This originates from <title> tags.

string PowerUI.HtmlDocument.CurrentTooltip
private

The tooltip of the document. This originates from <.. title="tooltip">. See Document.tooltip.

string PowerUI.HtmlDocument.domain_

A custom set domain value.

Dictionary<string,ScriptEngine> PowerUI.HtmlDocument.Engines

The available script engines for this document, indexed by script type.

bool PowerUI.HtmlDocument.FinishedParsing

True if we're done parsing and setting the innerHTML of the body tag. Used to guage when the code should be compiled.

HtmlElement PowerUI.HtmlDocument.fullscreenElement

The current fullscreen element, if any.

HtmlHtmlElement PowerUI.HtmlDocument.html

The HTML element of the document. This is the outermost tag of the document.

bool PowerUI.HtmlDocument.IsOpen
package

True if the doc is currently open.

Languages PowerUI.HtmlDocument.languages_
package

The document.languages API. Use languages instead.

string PowerUI.HtmlDocument.ScriptLocation

Only used by Nitro AOT. The location of the html file for error reporting.

Window PowerUI.HtmlDocument.window

The window that this document belongs to.

Windows.Manager PowerUI.HtmlDocument.windows_
private

Instance of a window manager. May be null.

Property Documentation

HTMLCollection PowerUI.HtmlDocument.anchors
get

All the links on a page.

HTMLCollection PowerUI.HtmlDocument.applets
get

All applets on the document.

string PowerUI.HtmlDocument.bgColor
getset

The document background color.

string PowerUI.HtmlDocument.characterSet
get

The character set this document is using.

string PowerUI.HtmlDocument.charset
get

The character set this document is using.

string PowerUI.HtmlDocument.cookie
getset
Window PowerUI.HtmlDocument.defaultView
get

A reference to the window object.

bool PowerUI.HtmlDocument.designMode
getset

Gets or sets design mode (content editable) on the whole document.

string PowerUI.HtmlDocument.dir
getset

Document directionality.

override Dom.Element PowerUI.HtmlDocument.documentElement
get

The root style node.

string PowerUI.HtmlDocument.domain
getset

Document domain.

HTMLCollection PowerUI.HtmlDocument.embeds
get

All embeds on the document.

override EventTarget PowerUI.HtmlDocument.eventTargetParentNode
getpackage

The parent node as used by EventTarget during capture. Can be null.

HTMLCollection PowerUI.HtmlDocument.forms
get

All forms on the document.

bool PowerUI.HtmlDocument.fullscreen
get

Is something currently fullscreen?

bool PowerUI.HtmlDocument.fullscreenEnabled
get

Is full screen available for this document?

string PowerUI.HtmlDocument.ggColor
getset

The document foreground (font) color.

override object PowerUI.HtmlDocument.GlobalScope
get

The global scope.

HtmlElement PowerUI.HtmlDocument.head
get

The head element if there is one.

HtmlElement PowerUI.HtmlDocument.htmlActiveElement
get

Current focused element casted to a HtmlElement (generally you should use activeElement instead).

HTMLCollection PowerUI.HtmlDocument.images
get

All images on the document.

int PowerUI.HtmlDocument.innerHeight
get

Available height.

string PowerUI.HtmlDocument.innerHTML
getset

Gets or sets the innerHTML of this document.

override string PowerUI.HtmlDocument.innerML
getset

Gets or sets the innerHTML of this document.

int PowerUI.HtmlDocument.innerWidth
get

Available width.

string PowerUI.HtmlDocument.inputEncoding
get

The input encoding set this document is using.

Languages PowerUI.HtmlDocument.languages
get

The document.languages API.

HTMLCollection PowerUI.HtmlDocument.links
get

All links on the document.

NitroScriptEngine PowerUI.HtmlDocument.NitroEngine
get

Gets the existing JS engine for this document.

BeforeUnloadEventDelegate PowerUI.HtmlDocument.onbeforeunload
getset

Called when the document is about to be unloaded.

KeyboardEventDelegate PowerUI.HtmlDocument.onkeydown
getset

Called when a key goes down.

KeyboardEventDelegate PowerUI.HtmlDocument.onkeyup
getset

Called when a key goes up.

MouseEventDelegate PowerUI.HtmlDocument.onmousemove
getset

Called when the mouse moves.

DomEventDelegate PowerUI.HtmlDocument.onresize
getset

Called when the document resizes.

DomEventDelegate PowerUI.HtmlDocument.ontitlechange
getset

Called when the title of this document changes.

DomEventDelegate PowerUI.HtmlDocument.ontooltipchange
getset

Called when the tooltip for this document changes.

string PowerUI.HtmlDocument.origin
get

The document origin.

HTMLCollection PowerUI.HtmlDocument.plugins
get

The plugins on the page.

HTMLCollection PowerUI.HtmlDocument.scripts
get

All scripts on the document.

Windows.Manager PowerUI.HtmlDocument.sparkWindows
get

The document.windows API. Read only.

override string PowerUI.HtmlDocument.Target
get

The documents current target. It's the same as location.hash.

override string PowerUI.HtmlDocument.title
getset

The title of the document. This originates from <title> tags.

string PowerUI.HtmlDocument.tooltip
getset

The tooltip of the document. This originates from <.. title="tooltip">. Note that this is set internally.

string PowerUI.HtmlDocument.URL
get

The location as a string.

override EventTarget PowerUI.HtmlDocument.windowTarget
getpackage

A window event target if there is one.