|
|
This file is part of the DOM implementation for KDE.
(C) 2001 Peter Kelly (pmk@post.com)
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
$Id: dom2_views.h,v 1.2 2001/06/02 04:18:00 pmk Exp $
HTMLDocument (class) | HTMLDocument |
An <code> HTMLDocument </code> is the root of the HTML hierarchy and holds the entire content. Beside providing access to the hierarchy, it also provides some convenience methods for accessing certain sets of information from the document.
The following properties have been deprecated in favor of the corresponding ones for the BODY element:
<ulist> <item> alinkColor
</item> <item> background
</item> <item> bgColor
</item> <item> fgColor
</item> <item> linkColor
</item> <item> vlinkColor
</item> </ulist>
Node (class) | Node |
The <code> Node </code> interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the <code> Node </code> interface expose methods for dealing with children, not all objects implementing the <code> Node </code> interface may have children. For example, <code> Text </code> nodes may not have children, and adding children to such nodes results in a <code> DOMException </code> being raised.
The attributes <code> nodeName </code> , <code> nodeValue </code> and <code> attributes </code> are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific <code> nodeType </code> (e.g., <code> nodeValue </code> for an Element or <code> attributes </code> for a Comment), this returns <code> null </code> . Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information.
EventListener (class) | EventListener |
Introduced in DOM Level 2
The EventListener interface is the primary method for handling events. Users implement the EventListener interface and register their listener on an EventTarget using the AddEventListener method. The users should also remove their EventListener from its EventTarget after they have completed using the listener.
When a Node is copied using the cloneNode method the EventListeners attached to the source Node are not attached to the copied Node. If the user wishes the same EventListeners to be added to the newly created copy the user must add them manually.
Range (class) | Range |
CSS2Azimuth (class) | CSS2Azimuth |
The <code> CSS2Azimuth </code> interface represents the <a href="http://www.w3.org/TR/REC-CSS2/aural.html#propdef-azimuth"> azimuth </a> CSS Level 2 property.
CSS2BackgroundPosition (class) | CSS2BackgroundPosition |
The <code> CSS2BackgroundPosition </code> interface represents the <a href="http://www.w3.org/TR/REC-CSS2/colors.html#propdef-background-position"> background-position </a> CSS Level 2 property.
CSS2BorderSpacing (class) | CSS2BorderSpacing |
The <code> CSS2BorderSpacing </code> interface represents the <a href="http://www.w3.org/TR/REC-CSS2/tables.html#propdef-border-spacing"> border-spacing </a> CSS Level 2 property.
CSS2CounterIncrement (class) | CSS2CounterIncrement |
The <code> CSS2CounterIncrement </code> interface represents a imple value for the <a href="http://www.w3.org/TR/REC-CSS2/generate.html#propdef-counter-increment"> counter-increment </a> CSS Level 2 property.
CSS2CounterReset (class) | CSS2CounterReset |
The <code> CSS2CounterReset </code> interface represents a simple value for the <a href="http://www.w3.org/TR/REC-CSS2/generate.html#propdef-counter-reset"> counter-reset </a> CSS Level 2 property.
CSSValueList (class) | CSSValueList |
The <code> CSSValueList </code> interface provides the absraction of an ordered collection of CSS values.
CSS2Cursor (class) | CSS2Cursor |
The <code> CSS2Cursor </code> interface represents the <a href="http://www.w3.org/TR/REC-CSS2/ui.html#propdef-cursor"> cursor </a> CSS Level 2 property.
CSS2FontFaceSrc (class) | CSS2FontFaceSrc |
The <code> CSS2Cursor </code> interface represents the <a href="http://www.w3.org/TR/REC-CSS2/fonts.html#descdef-src"> src </a> CSS Level 2 descriptor.
CSS2FontFaceWidths (class) | CSS2FontFaceWidths |
The <code> CSS2Cursor </code> interface represents a simple value for the <a href="http://www.w3.org/TR/REC-CSS2/fonts.html#descdef-widths"> widths </a> CSS Level 2 descriptor.
CSS2PageSize (class) | CSS2PageSize |
The <code> CSS2Cursor </code> interface represents the <a href="http://www.w3.org/TR/REC-CSS2/page.html#propdef-size"> size </a> CSS Level 2 descriptor.
CSS2PlayDuring (class) | CSS2PlayDuring |
The <code> CSS2PlayDuring </code> interface represents the <a href="http://www.w3.org/TR/REC-CSS2/aural.html#propdef-play-during"> play-during </a> CSS Level 2 property.
CSS2Properties (class) | CSS2Properties |
The <code> CSS2Properties </code> interface represents a convenience mechanism for retrieving and setting properties within a <code> CSSStyleDeclaration </code> . The attributes of this interface correspond to all the <a href="http://www.w3.org/TR/REC-CSS2/propidx.html"> properties specified in CSS2 </a> . Getting an attribute of this interface is equivalent to calling the <code> getPropertyValue </code> method of the <code> CSSStyleDeclaration </code> interface. Setting an attribute of this interface is equivalent to calling the <code> setProperty </code> method of the <code> CSSStyleDeclaration </code> interface.
A compliant implementation is not required to implement the <code> CSS2Properties </code> interface. If an implementation does implement this interface, the expectation is that language-specific methods can be used to cast from an instance of the <code> CSSStyleDeclaration </code> interface to the <code> CSS2Properties </code> interface.
If an implementation does implement this interface, it is expected to understand the specific syntax of the shorthand properties, and apply their semantics; when the <code> margin </code> property is set, for example, the <code> marginTop </code> , <code> marginRight </code> , <code> marginBottom </code> and <code> marginLeft </code> properties are actually being set by the underlying implementation.
When dealing with CSS "shorthand" properties, the shorthand properties should be decomposed into their component longhand properties as appropriate, and when querying for their value, the form returned should be the shortest form exactly equivalent to the declarations made in the ruleset. However, if there is no shorthand declaration that could be added to the ruleset without changing in any way the rules already declared in the ruleset (i.e., by adding longhand rules that were previously not declared in the ruleset), then the empty string should be returned for the shorthand property.
For example, querying for the <code> font </code> property should not return "normal normal normal 14pt/normal Arial, sans-serif", when "14pt Arial, sans-serif" suffices (the normals are initial values, and are implied by use of the longhand property).
If the values for all the longhand properties that compose a particular string are the initial values, then a string consisting of all the initial values should be returned (e.g. a <code> border-width </code> value of "medium" should be returned as such, not as "").
For some shorthand properties that take missing values from other sides, such as the <code> margin </code> , <code> padding </code> , and <code> border-[width|style|color] </code> properties, the minimum number of sides possible should be used, i.e., "0px 10px" will be returned instead of "0px 10px 0px 10px".
If the value of a shorthand property can not be decomposed into its component longhand properties, as is the case for the <code> font </code> property with a value of "menu", querying for the values of the component longhand properties should return the empty string.
CSSValue (class) | CSSValue |
The <code> CSSValue </code> interface represents a simple or a complexe value.
CSS2TextShadow (class) | CSS2TextShadow |
The <code> CSS2TextShadow </code> interface represents a simple value for the <a href="http://www.w3.org/TR/REC-CSS2/text.html#propdef-text-shadow"> text-shadow </a> CSS Level 2 property.
CSSRule (class) | CSSRule |
The <code> CSSRule </code> interface is the abstract base interface for any type of CSS <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#q5"> statement </a> . This includes both <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#q8"> rule sets </a> and <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#at-rules"> at-rules </a> . An implementation is expected to preserve all rules specified in a CSS style sheet, even if it is not recognized. Unrecognized rules are represented using the <code> CSSUnknownRule </code> interface.
CSSCharsetRule (class) | CSSCharsetRule |
The <code> CSSCharsetRule </code> interface a <a href=""> @charset rule </a> in a CSS style sheet. A <code> @charset </code> rule can be used to define the encoding of the style sheet.
CSSFontFaceRule (class) | CSSFontFaceRule |
The <code> CSSFontFaceRule </code> interface represents a <a href="http://www.w3.org/TR/REC-CSS2/fonts.html#font-descriptions"> @font-face rule </a> in a CSS style sheet. The <code> @font-face </code> rule is used to hold a set of font descriptions.
CSSImportRule (class) | CSSImportRule |
The <code> CSSImportRule </code> interface represents a <a href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import"> @import rule </a> within a CSS style sheet. The <code> @import </code> rule is used to import style rules from other style sheets.
CSSMediaRule (class) | CSSMediaRule |
The <code> CSSMediaRule </code> interface represents a <a href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule"> @media rule </a> in a CSS style sheet. A <code> @media </code> rule can be used to delimit style rules for specific media types.
CSSPageRule (class) | CSSPageRule |
The <code> CSSPageRule </code> interface represents a <a href="http://www.w3.org/TR/REC-CSS2/page.html#page-box"> @page rule </a> within a CSS style sheet. The <code> @page </code> rule is used to specify the dimensions, orientation, margins, etc. of a page box for paged media.
CSSStyleRule (class) | CSSStyleRule |
The <code> CSSStyleRule </code> interface represents a single <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#q8"> rule set </a> in a CSS style sheet.
CSSUnknownRule (class) | CSSUnknownRule |
The <code> CSSUnkownRule </code> interface represents an at-rule not supported by this user agent.
CSSRuleList (class) | CSSRuleList |
The <code> CSSRuleList </code> interface provides the abstraction of an ordered collection of CSS rules.
MediaList (class) | MediaList |
The <code> MediaList </code> interface provides the abstraction of an ordered collection of media, without defining or constraining how this collection is implemented. All media are lowercase strings.
StyleSheet (class) | StyleSheet |
The <code> StyleSheet </code> interface is the abstract base interface for any type of style sheet. It represents a single style sheet associated with a structured document. In HTML, the StyleSheet interface represents either an external style sheet, included via the HTML <a href="http://www.w3.org/TR/REC-html40/struct/links.html#h-12.3"> LINK </a> element, or an inline <a href="http://www.w3.org/TR/REC-html40/present/styles.html#h-14.2.3"> STYLE </a> element. In XML, this interface represents an external style sheet, included via a <a href="http://www.w3.org/TR/xml-stylesheet"> style sheet processing instruction </a> .
CSSException (class) | CSSException |
This exception is raised when a specific CSS operation is impossible to perform.
CSSStyleSheet (class) | CSSStyleSheet |
The <code> CSSStyleSheet </code> interface is a concrete interface used to represent a CSS style sheet i.e. a style sheet whose content type is "text/css".
StyleSheetList (class) | StyleSheetList |
The <code> StyleSheetList </code> interface provides the abstraction of an ordered collection of style sheets.
LinkStyle (class) | LinkStyle |
DocumentStyle (class) | DocumentStyle |
CSSStyleDeclaration (class) | CSSStyleDeclaration |
The <code> CSSStyleDeclaration </code> interface represents a single <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#block"> CSS declaration block </a> . This interface may be used to determine the style properties currently set in a block or to set style properties explicitly within the block.
While an implementation may not recognize all CSS properties within a CSS declaration block, it is expected to provide access to all specified properties through the <code> CSSStyleDeclaration </code> interface. Furthermore, implementations that support a specific level of CSS should correctly handle <a href="http://www.w3.org/TR/REC-CSS2/about.html#shorthand"> CSS shorthand </a> properties for that level. For a further discussion of shorthand properties, see the <code> CSS2Properties </code> interface.
Counter (class) | Counter |
The <code> Counter </code> interface is used to represent any <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-counter"> counter or counters function </a> value. This interface reflects the values in the underlying style property. Hence, modifications made through this interface modify the style property.
RGBColor (class) | RGBColor |
The <code> RGBColor </code> interface is used to represent any <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-color"> RGB color </a> value. This interface reflects the values in the underlying style property. Hence, modifications made through this interface modify the style property.
Rect (class) | Rect |
The <code> Rect </code> interface is used to represent any <a href="http://www.w3.org/TR/REC-CSS2/visufx.html#value-def-shape"> rect </a> value. This interface reflects the values in the underlying style property. Hence, modifications made through this interface modify the style property.
CSSPrimitiveValue (class) | CSSPrimitiveValue |
The <code> CSSPrimitiveValue </code> interface represents a single <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#values"> CSS value </a> . This interface may be used to determine the value of a specific style property currently set in a block or to set a specific style properties explicitly within the block. An instance of this interface can be obtained from the <code> getPropertyCSSValue </code> method of the <code> CSSStyleDeclaration </code> interface.
Event (class) | Event |
Introduced in DOM Level 2
The Event interface is used to provide contextual information about an event to the handler processing the event. An object which implements the Event interface is generally passed as the first parameter to an event handler. More specific context information is passed to event handlers by deriving additional interfaces from Event which contain information directly relating to the type of event they accompany. These derived interfaces are also implemented by the object passed to the event listener.
EventException (class) | EventException |
Introduced in DOM Level 2:
Event operations may throw an EventException as specified in their method descriptions.
UIEvent (class) | UIEvent |
Introduced in DOM Level 2
The UIEvent interface provides specific contextual information associated with User Interface events.
MouseEvent (class) | MouseEvent |
Introduced in DOM Level 2
The MouseEvent interface provides specific contextual information associated with Mouse events.
The detail attribute inherited from UIEvent indicates the number of times a mouse button has been pressed and released over the same screen location during a user action. The attribute value is 1 when the user begins this action and increments by 1 for each full sequence of pressing and releasing. If the user moves the mouse between the mousedown and mouseup the value will be set to 0, indicating that no click is occurring.
In the case of nested elements mouse events are always targeted at the most deeply nested element. Ancestors of the targeted element may use bubbling to obtain notification of mouse events which occur within its descendent elements.
MutationEvent (class) | MutationEvent |
Introduced in DOM Level 2
The MutationEvent interface provides specific contextual information associated with Mutation events.
AbstractView (class) | AbstractView |
Introduced in DOM Level 2
A base interface that all views shall derive from.
DocumentFragment (class) | DocumentFragment |
<code> DocumentFragment </code> is a "lightweight" or "minimal" <code> Document </code> object. It is very common to want to be able to extract a portion of a document's tree or to create a new fragment of a document. Imagine implementing a user command like cut or rearranging a document by moving fragments around. It is desirable to have an object which can hold such fragments and it is quite natural to use a Node for this purpose. While it is true that a <code> Document </code> object could fulfil this role, a <code> Document </code> object can potentially be a heavyweight object, depending on the underlying implementation. What is really needed for this is a very lightweight object. <code> DocumentFragment </code> is such an object.
Furthermore, various operations -- such as inserting nodes as children of another <code> Node </code> -- may take <code> DocumentFragment </code> objects as arguments; this results in all the child nodes of the <code> DocumentFragment </code> being moved to the child list of this node.
The children of a <code> DocumentFragment </code> node are zero or more nodes representing the tops of any sub-trees defining the structure of the document. <code> DocumentFragment </code> nodes do not need to be well-formed XML documents (although they do need to follow the rules imposed upon well-formed XML parsed entities, which can have multiple top nodes). For example, a <code> DocumentFragment </code> might have only one child and that child node could be a <code> Text </code> node. Such a structure model represents neither an HTML document nor a well-formed XML document.
When a <code> DocumentFragment </code> is inserted into a <code> Document </code> (or indeed any other <code> Node </code> that may take children) the children of the <code> DocumentFragment </code> and not the <code> DocumentFragment </code> itself are inserted into the <code> Node </code> . This makes the <code> DocumentFragment </code> very useful when the user wishes to create nodes that are siblings; the <code> DocumentFragment </code> acts as the parent of these nodes so that the user can use the standard methods from the <code> Node </code> interface, such as <code> insertBefore() </code> and <code> appendChild() </code> .
DOMString (class) | DOMString |
This class implements the basic string we use in the DOM. We do not use QString for 2 reasons: Memory overhead, and the missing explicit sharing of strings we need for the DOM.
All DOMStrings are explicitly shared (they behave like pointers), meaning that modifications to one instance will also modify all others. If you wish to get a DOMString that is independent, use copy().
DOMException (class) | DOMException |
DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impossible to perform (either for logical reasons, because data is lost, or because the implementation has become unstable). In general, DOM methods return specific error values in ordinary processing situation, such as out-of-bound errors when using <code> NodeList </code> .
Implementations may raise other exceptions under other circumstances. For example, implementations may raise an implementation-dependent exception if a <code> null </code> argument is passed.
Some languages and object systems do not support the concept of exceptions. For such systems, error conditions may be indicated using native error reporting mechanisms. For some bindings, for example, methods may return error codes similar to those listed in the corresponding method descriptions.
RangeException (class) | RangeException |
NodeFilter (class) | NodeFilter |
Filters are objects that know how to "filter out" nodes. If an Iterator or <code> TreeWalker </code> is given a filter, before it returns the next node, it applies the filter. If the filter says to accept the node, the Iterator returns it; otherwise, the Iterator looks for the next node and pretends that the node that was rejected was not there.
The DOM does not provide any filters. Filter is just an interface that users can implement to provide their own filters.
Filters do not need to know how to iterate, nor do they need to know anything about the data structure that is being iterated. This makes it very easy to write filters, since the only thing they have to know how to do is evaluate a single node. One filter may be used with a number of different kinds of Iterators, encouraging code reuse.
To create your own cutsom NodeFilter, define a subclass of CustomNodeFilter which overrides the acceptNode() method and assign an instance of it to the NodeFilter. For more details see the CustomNodeFilter class
CustomNodeFilter (class) | CustomNodeFilter |
CustomNodeFilter can be used to define your own NodeFilter for use with NodeIterators and TreeWalkers. You can create a custom filter by doing the follwing:
class MyCustomNodeFilter { ..... virtual short acceptNode (const Node &n); ..... }
Then in your program:
short MyCustomNodeFilter::acceptNode (const Node &n) { if (condition) return NodeFilter::FILTER_ACCEPT; else .... }
MyCustomFilter *filter = new MyCustomFilter(); NodeFilter nf = NodeFilter::createCutsom(filter); NodeIterator ni = document.createNodeIterator(document,NodeFilter.SHOW_ALL,nf,false);
The default implementation of acceptNode() returns NodeFilter::FILTER_ACCEPT for all nodes.
NodeIterator (class) | NodeIterator |
NodeIterators are used to step through a set of nodes, e.g. the set of nodes in a NodeList, the document subtree governed by a particular node, the results of a query, or any other set of nodes. The set of nodes to be iterated is determined by the implementation of the NodeIterator. DOM Level 2 specifies a single NodeIterator implementation for document-order traversal of a document subtree. Instances of these iterators are created by calling DocumentTraversal.createNodeIterator().
Any Iterator that returns nodes may implement the <code> NodeIterator </code> interface. Users and vendor libraries may also choose to create Iterators that implement the <code> NodeIterator </code> interface.
TreeWalker (class) | TreeWalker |
<code> TreeWalker </code> objects are used to navigate a document tree or subtree using the view of the document defined by its <code> whatToShow </code> flags and any filters that are defined for the <code> TreeWalker </code> . Any function which performs navigation using a <code> TreeWalker </code> will automatically support any view defined by a <code> TreeWalker </code> .
Omitting nodes from the logical view of a subtree can result in a structure that is substantially different from the same subtree in the complete, unfiltered document. Nodes that are siblings in the TreeWalker view may be children of different, widely separated nodes in the original view. For instance, consider a Filter that skips all nodes except for Text nodes and the root node of a document. In the logical view that results, all text nodes will be siblings and appear as direct children of the root node, no matter how deeply nested the structure of the original document.
Document (class) | Document |
The <code> Document </code> interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.
Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a <code> Document </code> , the <code> Document </code> interface also contains the factory methods needed to create these objects. The <code> Node </code> objects created have a <code> ownerDocument </code> attribute which associates them with the <code> Document </code> within whose context they were created.
Element (class) | Element |
By far the vast majority of objects (apart from text) that authors encounter when traversing a document are <code> Element </code> nodes. Assume the following XML document: <elementExample id="demo"> <subelement1/> <subelement2><subsubelement/></subelement2> </elementExample>
When represented using DOM, the top node is an <code> Element </code> node for "elementExample", which contains two child <code> Element </code> nodes, one for "subelement1" and one for "subelement2". "subelement1" contains no child nodes.
Elements may have attributes associated with them; since the <code> Element </code> interface inherits from <code> Node </code> , the generic <code> Node </code> interface method <code> getAttributes </code> may be used to retrieve the set of all attributes for an element. There are methods on the <code> Element </code> interface to retrieve either an <code> Attr </code> object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an <code> Attr </code> object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value. On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience.
DocumentType (class) | DocumentType |
Each <code> Document </code> has a <code> doctype </code> attribute whose value is either <code> null </code> or a <code> DocumentType </code> object. The <code> DocumentType </code> interface in the DOM Level 1 Core provides an interface to the list of entities that are defined for the document, and little else because the effect of namespaces and the various XML scheme efforts on DTD representation are not clearly understood as of this writing.
The DOM Level 1 doesn't support editing <code> DocumentType </code> nodes.
NodeList (class) | NodeList |
The <code> NodeList </code> interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented.
The items in the <code> NodeList </code> are accessible via an integral index, starting from 0.
CDATASection (class) | CDATASection |
CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. The only delimiter that is recognized in a CDATA section is the "]]>" string that ends the CDATA section. CDATA sections can not be nested. The primary purpose is for including material such as XML fragments, without needing to escape all the delimiters.
The <code> DOMString </code> attribute of the <code> Text </code> node holds the text that is contained by the CDATA section. Note that this may contain characters that need to be escaped outside of CDATA sections and that, depending on the character encoding ("charset") chosen for serialization, it may be impossible to write out some characters as part of a CDATA section.
The <code> CDATASection </code> interface inherits the <code> CharacterData </code> interface through the <code> Text </code> interface. Adjacent <code> CDATASections </code> nodes are not merged by use of the Element.normalize() method.
Comment (class) | Comment |
This represents the content of a comment, i.e., all the characters between the starting ' <code> <!-- </code> ' and ending ' <code> --> </code> '. Note that this is the definition of a comment in XML, and, in practice, HTML, although some HTML tools may implement the full SGML comment structure.
Text (class) | Text |
The <code> Text </code> interface represents the textual content (termed <a href="&xml-spec;#syntax"> character data </a> in XML) of an <code> Element </code> or <code> Attr </code> . If there is no markup inside an element's content, the text is contained in a single object implementing the <code> Text </code> interface that is the only child of the element. If there is markup, it is parsed into a list of elements and <code> Text </code> nodes that form the list of children of the element.
When a document is first made available via the DOM, there is only one <code> Text </code> node for each block of text. Users may create adjacent <code> Text </code> nodes that represent the contents of a given element without any intervening markup, but should be aware that there is no way to represent the separations between these nodes in XML or HTML, so they will not (in general) persist between DOM editing sessions. The <code> normalize() </code> method on <code> Element </code> merges any such adjacent <code> Text </code> objects into a single node for each block of text; this is recommended before employing operations that depend on a particular document structure, such as navigation with <code> XPointers. </code>
DOMImplementation (class) | DOMImplementation |
The <code> DOMImplementation </code> interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.
The DOM Level 1 does not specify a way of creating a document instance, and hence document creation is an operation specific to an implementation. Future Levels of the DOM specification are expected to provide methods for creating documents directly.
Attr (class) | Attr |
The <code> Attr </code> interface represents an attribute in an <code> Element </code> object. Typically the allowable values for the attribute are defined in a document type definition.
<code> Attr </code> objects inherit the <code> Node </code> interface, but since they are not actually child nodes of the element they describe, the DOM does not consider them part of the document tree. Thus, the <code> Node </code> attributes <code> parentNode </code> , <code> previousSibling </code> , and <code> nextSibling </code> have a null value for <code> Attr </code> objects. The DOM takes the view that attributes are properties of elements rather than having a separate identity from the elements they are associated with; this should make it more efficient to implement such features as default attributes associated with all elements of a given type. Furthermore, <code> Attr </code> nodes may not be immediate children of a <code> DocumentFragment </code> . However, they can be associated with <code> Element </code> nodes contained within a <code> DocumentFragment </code> . In short, users and implementors of the DOM need to be aware that <code> Attr </code> nodes have some things in common with other objects inheriting the <code> Node </code> interface, but they also are quite distinct.
The attribute's effective value is determined as follows: if this attribute has been explicitly assigned any value, that value is the attribute's effective value; otherwise, if there is a declaration for this attribute, and that declaration includes a default value, then that default value is the attribute's effective value; otherwise, the attribute does not exist on this element in the structure model until it has been explicitly added. Note that the <code> nodeValue </code> attribute on the <code> Attr </code> instance can also be used to retrieve the string version of the attribute's value(s).
In XML, where the value of an attribute can contain entity references, the child nodes of the <code> Attr </code> node provide a representation in which entity references are not expanded. These child nodes may be either <code> Text </code> or <code> EntityReference </code> nodes. Because the attribute type may be unknown, there are no tokenized attribute values.
EntityReference (class) | EntityReference |
<code> EntityReference </code> objects may be inserted into the structure model when an entity reference is in the source document, or when the user wishes to insert an entity reference. Note that character references and references to predefined entities are considered to be expanded by the HTML or XML processor so that characters are represented by their Unicode equivalent rather than by an entity reference. Moreover, the XML processor may completely expand references to entities while building the structure model, instead of providing <code> EntityReference </code> objects. If it does provide such objects, then for a given <code> EntityReference </code> node, it may be that there is no <code> Entity </code> node representing the referenced entity; but if such an <code> Entity </code> exists, then the child list of the <code> EntityReference </code> node is the same as that of the <code> Entity </code> node. As with the <code> Entity </code> node, all descendants of the <code> EntityReference </code> are readonly.
The resolution of the children of the <code> EntityReference </code> (the replacement value of the referenced <code> Entity </code> ) may be lazily evaluated; actions by the user (such as calling the <code> childNodes </code> method on the <code> EntityReference </code> node) are assumed to trigger the evaluation.
ProcessingInstruction (class) | ProcessingInstruction |
The <code> ProcessingInstruction </code> interface represents a "processing instruction", used in XML as a way to keep processor-specific information in the text of the document.
NamedNodeMap (class) | NamedNodeMap |
Objects implementing the <code> NamedNodeMap </code> interface are used to represent collections of nodes that can be accessed by name. Note that <code> NamedNodeMap </code> does not inherit from <code> NodeList </code> ; <code> NamedNodeMap </code> s are not maintained in any particular order. Objects contained in an object implementing <code> NamedNodeMap </code> may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a <code> NamedNodeMap </code> , and does not imply that the DOM specifies an order to these Nodes.
DomShared (class) | DomShared |
typedef unsigned long long DOMTimeStamp | DOMTimeStamp |
A DOMTimeStamp represents a number of milliseconds.
bool operator== ( const DOMString &a, const DOMString &b )
| operator== |
bool operator== ( const DOMString &a, const QString &b )
| operator== |
bool operator== ( const DOMString &a, const char *b )
| operator== |
inline bool operator!= ( const DOMString &a, const DOMString &b )
| operator!= |
inline bool operator!= ( const DOMString &a, const QString &b )
| operator!= |
inline bool operator!= ( const DOMString &a, const char *b )
| operator!= |
inline bool strcmp ( const DOMString &a, const DOMString &b )
| strcmp |
bool strcasecmp ( const DOMString &a, const DOMString &b )
| strcasecmp |
bool strcasecmp ( const DOMString& a, const char* b )
| strcasecmp |
CharacterData (class) | CharacterData |
The <code> CharacterData </code> interface extends Node with a set of attributes and methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to <code> CharacterData </code> , though <code> Text </code> and others do inherit the interface from it. All <code> offset</code>s in this interface start from 0.
Entity (class) | Entity |
This interface represents an entity, either parsed or unparsed, in an XML document. Note that this models the entity itself not the entity declaration. <code> Entity </code> declaration modeling has been left for a later Level of the DOM specification.
The <code> nodeName </code> attribute that is inherited from <code> Node </code> contains the name of the entity.
An XML processor may choose to completely expand entities before the structure model is passed to the DOM; in this case there will be no <code> EntityReference </code> nodes in the document tree.
XML does not mandate that a non-validating XML processor read and process entity declarations made in the external subset or declared in external parameter entities. This means that parsed entities declared in the external subset need not be expanded by some classes of applications, and that the replacement value of the entity may not be available. When the replacement value is available, the corresponding <code> Entity </code> node's child list represents the structure of that replacement text. Otherwise, the child list is empty.
The resolution of the children of the <code> Entity </code> (the replacement value) may be lazily evaluated; actions by the user (such as calling the <code> childNodes </code> method on the <code> Entity </code> Node) are assumed to trigger the evaluation.
The DOM Level 1 does not support editing <code> Entity </code> nodes; if a user wants to make changes to the contents of an <code> Entity </code> , every related <code> EntityReference </code> node has to be replaced in the structure model by a clone of the <code> Entity </code> 's contents, and then the desired changes must be made to each of those clones instead. All the descendants of an <code> Entity </code> node are readonly.
An <code> Entity </code> node does not have any parent.
Notation (class) | Notation |
This interface represents a notation declared in the DTD. A notation either declares, by name, the format of an unparsed entity (see section 4.7 of the XML 1.0 specification), or is used for formal declaration of Processing Instruction targets (see section 2.6 of the XML 1.0 specification). The <code> nodeName </code> attribute inherited from <code> Node </code> is set to the declared name of the notation.
The DOM Level 1 does not support editing <code> Notation </code> nodes; they are therefore readonly.
A <code> Notation </code> node does not have any parent.
HTMLBodyElement (class) | HTMLBodyElement |
The HTML document body. This element is always present in the DOM API, even if the tags are not present in the source document. See the <a href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-BODY"> BODY element definition </a> in HTML 4.0.
HTMLFrameElement (class) | HTMLFrameElement |
Create a frame. See the <a href="http://www.w3.org/TR/REC-html40/present/frames.html#edef-FRAME"> FRAME element definition </a> in HTML 4.0.
HTMLFrameSetElement (class) | HTMLFrameSetElement |
Create a grid of frames. See the <a href="http://www.w3.org/TR/REC-html40/present/frames.html#edef-FRAMESET"> FRAMESET element definition </a> in HTML 4.0.
HTMLHeadElement (class) | HTMLHeadElement |
Document head information. See the <a href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-HEAD"> HEAD element definition </a> in HTML 4.0.
HTMLHtmlElement (class) | HTMLHtmlElement |
Root of an HTML document. See the <a href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-HTML"> HTML element definition </a> in HTML 4.0.
HTMLBlockquoteElement (class) | HTMLBlockquoteElement |
??? See the <a href="http://www.w3.org/TR/REC-html40/struct/text.html#edef-BLOCKQUOTE"> BLOCKQUOTE element definition </a> in HTML 4.0.
HTMLDivElement (class) | HTMLDivElement |
Generic block container. See the <a href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-DIV"> DIV element definition </a> in HTML 4.0.
HTMLHRElement (class) | HTMLHRElement |
Create a horizontal rule. See the <a href="http://www.w3.org/TR/REC-html40/present/graphics.html#edef-HR"> HR element definition </a> in HTML 4.0.
HTMLHeadingElement (class) | HTMLHeadingElement |
For the <code> H1 </code> to <code> H6 </code> elements. See the <a href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-H1"> H1 element definition </a> in HTML 4.0.
HTMLParagraphElement (class) | HTMLParagraphElement |
Paragraphs. See the <a href="http://www.w3.org/TR/REC-html40/struct/text.html#edef-P"> P element definition </a> in HTML 4.0.
HTMLPreElement (class) | HTMLPreElement |
Preformatted text. See the <a href="http://www.w3.org/TR/REC-html40/struct/text.html#edef-PRE"> PRE element definition </a> in HTML 4.0.
HTMLCollection (class) | HTMLCollection |
An <code> HTMLCollection </code> is a list of nodes. An individual node may be accessed by either ordinal index or the node's <code> name </code> or <code> id </code> attributes. Note: Collections in the HTML DOM are assumed to be live meaning that they are automatically updated when the underlying document is changed.
HTMLElement (class) | HTMLElement |
All HTML element interfaces derive from this class. Elements that only expose the HTML core attributes are represented by the base <code> HTMLElement </code> interface. These elements are as follows:
<ulist> <item> HEAD
</item> <item> special: SUB, SUP, SPAN, BDO
</item> <item> font: TT, I, B, U, S, STRIKE, BIG, SMALL
</item> <item> phrase: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ACRONYM, ABBR
</item> <item> list: DD, DT
</item> <item> NOFRAMES, NOSCRIPT
</item> <item> ADDRESS, CENTER
</item> </ulist> Note. The <code> style </code> attribute for this interface is reserved for future usage.
HTMLFormElement (class) | HTMLFormElement |
The <code> FORM </code> element encompasses behavior similar to a collection and an element. It provides direct access to the contained input elements as well as the attributes of the form element. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-FORM"> FORM element definition </a> in HTML 4.0.
HTMLButtonElement (class) | HTMLButtonElement |
Push button. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-BUTTON"> BUTTON element definition </a> in HTML 4.0.
HTMLFieldSetElement (class) | HTMLFieldSetElement |
Organizes form controls into logical groups. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-FIELDSET"> FIELDSET element definition </a> in HTML 4.0.
HTMLInputElement (class) | HTMLInputElement |
Form control. Note. Depending upon the environment the page is being viewed, the value property may be read-only for the file upload input type. For the "password" input type, the actual value returned may be masked to prevent unauthorized use. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-INPUT"> INPUT element definition </a> in HTML 4.0.
HTMLLabelElement (class) | HTMLLabelElement |
Form field label text. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-LABEL"> LABEL element definition </a> in HTML 4.0.
HTMLLegendElement (class) | HTMLLegendElement |
Provides a caption for a <code> FIELDSET </code> grouping. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-LEGEND"> LEGEND element definition </a> in HTML 4.0.
HTMLOptGroupElement (class) | HTMLOptGroupElement |
Group options together in logical subdivisions. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-OPTGROUP"> OPTGROUP element definition </a> in HTML 4.0.
HTMLSelectElement (class) | HTMLSelectElement |
The select element allows the selection of an option. The contained options can be directly accessed through the select element as a collection. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-SELECT"> SELECT element definition </a> in HTML 4.0.
HTMLTextAreaElement (class) | HTMLTextAreaElement |
Multi-line text field. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-TEXTAREA"> TEXTAREA element definition </a> in HTML 4.0.
HTMLOptionElement (class) | HTMLOptionElement |
A selectable choice. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-OPTION"> OPTION element definition </a> in HTML 4.0.
HTMLIsIndexElement (class) | HTMLIsIndexElement |
This element is used for single-line text input. See the <a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-ISINDEX"> ISINDEX element definition </a> in HTML 4.0. This element is deprecated in HTML 4.0.
HTMLBaseElement (class) | HTMLBaseElement |
Document base URI. See the <a href="http://www.w3.org/TR/REC-html40/struct/links.html#edef-BASE"> BASE element definition </a> in HTML 4.0.
HTMLLinkElement (class) | HTMLLinkElement |
The <code> LINK </code> element specifies a link to an external resource, and defines this document's relationship to that resource (or vice versa). See the <a href="http://www.w3.org/TR/REC-html40/struct/links.html#edef-LINK"> LINK element definition </a> in HTML 4.0.
HTMLMetaElement (class) | HTMLMetaElement |
This contains generic meta-information about the document. See the <a href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-META"> META element definition </a> in HTML 4.0.
HTMLScriptElement (class) | HTMLScriptElement |
Script statements. See the <a href="http://www.w3.org/TR/REC-html40/interact/scripts.html#edef-SCRIPT"> SCRIPT element definition </a> in HTML 4.0.
HTMLStyleElement (class) | HTMLStyleElement |
Style information. A more detailed style sheet object model is planned to be defined in a separate document. See the <a href="http://www.w3.org/TR/REC-html40/present/styles.html#edef-STYLE"> STYLE element definition </a> in HTML 4.0.
HTMLTitleElement (class) | HTMLTitleElement |
The document title. See the <a href="http://www.w3.org/TR/REC-html40/struct/global.html#edef-TITLE"> TITLE element definition </a> in HTML 4.0.
HTMLAreaElement (class) | HTMLAreaElement |
Client-side image map area definition. See the <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-AREA"> AREA element definition </a> in HTML 4.0.
HTMLImageElement (class) | HTMLImageElement |
Embedded image. See the <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-IMG"> IMG element definition </a> in HTML 4.0.
HTMLMapElement (class) | HTMLMapElement |
Client-side image map. See the <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-MAP"> MAP element definition </a> in HTML 4.0.
HTMLAnchorElement (class) | HTMLAnchorElement |
The anchor element. See the <a href="http://www.w3.org/TR/REC-html40/struct/links.html#edef-A"> A element definition </a> in HTML 4.0.
HTMLBRElement (class) | HTMLBRElement |
Force a line break. See the <a href="http://www.w3.org/TR/REC-html40/struct/text.html#edef-BR"> BR element definition </a> in HTML 4.0.
HTMLFontElement (class) | HTMLFontElement |
Local change to font. See the <a href="http://www.w3.org/TR/REC-html40/present/graphics.html#edef-FONT"> FONT element definition </a> in HTML 4.0. This element is deprecated in HTML 4.0.
HTMLIFrameElement (class) | HTMLIFrameElement |
Inline subwindows. See the <a href="http://www.w3.org/TR/REC-html40/present/frames.html#edef-IFRAME"> IFRAME element definition </a> in HTML 4.0.
HTMLModElement (class) | HTMLModElement |
Notice of modification to part of a document. See the <a href="http://www.w3.org/TR/REC-html40/struct/text.html#edef-ins"> INS </a> and <a href="http://www.w3.org/TR/REC-html40/struct/text.html#edef-del"> DEL </a> element definitions in HTML 4.0.
HTMLQuoteElement (class) | HTMLQuoteElement |
For the <code> Q </code> and <code> BLOCKQUOTE </code> elements. See the <a href="http://www.w3.org/TR/REC-html40/struct/text.html#edef-Q"> Q element definition </a> in HTML 4.0.
Note: The DOM is not quite consistent here. They also define the HTMLBlockQuoteElement interface, to represent the <code>BLOCKQUOTE</code> element. To resolve ambiquities, we use this one for the <code>Q</code> element only.
HTMLDListElement (class) | HTMLDListElement |
Definition list. See the <a href="http://www.w3.org/TR/REC-html40/struct/lists.html#edef-DL"> DL element definition </a> in HTML 4.0.
HTMLDirectoryElement (class) | HTMLDirectoryElement |
Directory list. See the <a href="http://www.w3.org/TR/REC-html40/struct/lists.html#edef-DIR"> DIR element definition </a> in HTML 4.0. This element is deprecated in HTML 4.0.
HTMLLIElement (class) | HTMLLIElement |
List item. See the <a href="http://www.w3.org/TR/REC-html40/struct/lists.html#edef-LI"> LI element definition </a> in HTML 4.0.
HTMLMenuElement (class) | HTMLMenuElement |
Menu list. See the <a href="http://www.w3.org/TR/REC-html40/struct/lists.html#edef-MENU"> MENU element definition </a> in HTML 4.0. This element is deprecated in HTML 4.0.
HTMLOListElement (class) | HTMLOListElement |
Ordered list. See the <a href="http://www.w3.org/TR/REC-html40/struct/lists.html#edef-OL"> OL element definition </a> in HTML 4.0.
HTMLUListElement (class) | HTMLUListElement |
Unordered list. See the <a href="http://www.w3.org/TR/REC-html40/struct/lists.html#edef-UL"> UL element definition </a> in HTML 4.0.
HTMLBaseFontElement (class) | HTMLBaseFontElement |
Base font. See the <a href="http://www.w3.org/TR/REC-html40/present/graphics.html#edef-BASEFONT"> BASEFONT element definition </a> in HTML 4.0. This element is deprecated in HTML 4.0.
HTMLFormCollection (class) | HTMLFormCollection |
HTMLAppletElement (class) | HTMLAppletElement |
An embedded Java applet. See the <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-APPLET"> APPLET element definition </a> in HTML 4.0. This element is deprecated in HTML 4.0.
HTMLObjectElement (class) | HTMLObjectElement |
Generic embedded object. Note. In principle, all properties on the object element are read-write but in some environments some properties may be read-only once the underlying object is instantiated. See the <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-OBJECT"> OBJECT element definition </a> in HTML 4.0.
HTMLParamElement (class) | HTMLParamElement |
Parameters fed to the <code> OBJECT </code> element. See the <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#edef-PARAM"> PARAM element definition </a> in HTML 4.0.
HTMLTableCaptionElement (class) | HTMLTableCaptionElement |
Table caption See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-CAPTION"> CAPTION element definition </a> in HTML 4.0.
HTMLTableCellElement (class) | HTMLTableCellElement |
The object used to represent the <code> TH </code> and <code> TD </code> elements. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TD"> TD element definition </a> in HTML 4.0.
HTMLTableColElement (class) | HTMLTableColElement |
Regroups the <code> COL </code> and <code> COLGROUP </code> elements. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-COL"> COL element definition </a> in HTML 4.0.
HTMLTableSectionElement (class) | HTMLTableSectionElement |
The <code> THEAD </code> , <code> TFOOT </code> , and <code> TBODY </code> elements.
HTMLTableElement (class) | HTMLTableElement |
The create* and delete* methods on the table allow authors to construct and modify tables. HTML 4.0 specifies that only one of each of the <code> CAPTION </code> , <code> THEAD </code> , and <code> TFOOT </code> elements may exist in a table. Therefore, if one exists, and the createTHead() or createTFoot() method is called, the method returns the existing THead or TFoot element. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TABLE"> TABLE element definition </a> in HTML 4.0.
HTMLTableRowElement (class) | HTMLTableRowElement |
A row in a table. See the <a href="http://www.w3.org/TR/REC-html40/struct/tables.html#edef-TR"> TR element definition </a> in HTML 4.0.
Generated by: root@daffy.perf.redhat.com on Mon Jul 14 13:28:10 2003, using kdoc 2.0a53. |