DOM::Document

Search for usage in LXR

DOM::Document Class Reference

#include <dom_doc.h>

Inheritance diagram for DOM::Document:

Public Member Functions

 Document (bool)
 
 Document (const Document &other)
 
 Document (const Node &other)
 
 Document (DocumentImpl *i)
 
void abort ()
 
void addStyleSheet (const StyleSheet &sheet)
 
bool async () const
 
DOMString completeURL (const DOMString &url)
 
Attr createAttribute (const DOMString &name)
 
Attr createAttributeNS (const DOMString &namespaceURI, const DOMString &qualifiedName)
 
CDATASection createCDATASection (const DOMString &data)
 
Comment createComment (const DOMString &data)
 
DocumentFragment createDocumentFragment ()
 
Element createElement (const DOMString &tagName)
 
Element createElementNS (const DOMString &namespaceURI, const DOMString &qualifiedName)
 
EntityReference createEntityReference (const DOMString &name)
 
Event createEvent (const DOMString &eventType)
 
NodeIterator createNodeIterator (Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion)
 
ProcessingInstruction createProcessingInstruction (const DOMString &target, const DOMString &data)
 
Range createRange ()
 
Text createTextNode (const DOMString &data)
 
TreeWalker createTreeWalker (Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion)
 
AbstractView defaultView () const
 
bool designMode () const
 
DocumentType doctype () const
 
Element documentElement () const
 
bool execCommand (const DOMString &command, bool userInterface, const DOMString &value)
 
Element getElementById (const DOMString &elementId) const
 
NodeList getElementsByClassName (const DOMString &className)
 
NodeList getElementsByTagName (const DOMString &tagname)
 
NodeList getElementsByTagNameNS (const DOMString &namespaceURI, const DOMString &localName)
 
CSSStyleDeclaration getOverrideStyle (const Element &elt, const DOMString &pseudoElt)
 
DOMImplementation implementation () const
 
Node importNode (const Node &importedNode, bool deep)
 
bool isHTMLDocument () const
 
void load (const DOMString &uri)
 
void loadXML (const DOMString &source)
 
Documentoperator= (const Document &other)
 
Documentoperator= (const Node &other)
 
DOMString preferredStylesheetSet ()
 
bool queryCommandEnabled (const DOMString &command)
 
bool queryCommandIndeterm (const DOMString &command)
 
bool queryCommandState (const DOMString &command)
 
bool queryCommandSupported (const DOMString &command)
 
DOMString queryCommandValue (const DOMString &command)
 
Element querySelector (const DOMString &query) const
 
NodeList querySelectorAll (const DOMString &query) const
 
void removeStyleSheet (const StyleSheet &sheet)
 
DOMString selectedStylesheetSet ()
 
void setAsync (bool)
 
void setDesignMode (bool enable)
 
void setSelectedStylesheetSet (const DOMString &aString)
 
StyleSheetList styleSheets () const
 
DOMString toString () const
 
void updateRendering ()
 
KHTMLViewview () const
 
- Public Member Functions inherited from DOM::Node
 Node (const Node &other)
 
 Node (NodeImpl *_impl)
 
void addEventListener (const DOMString &type, EventListener *listener, const bool useCapture)
 
Node appendChild (const Node &newChild)
 
void applyChanges ()
 
NamedNodeMap attributes () const
 
NodeList childNodes () const
 
Node cloneNode (bool deep)
 
unsigned compareDocumentPosition (const DOM::Node &other)
 
bool dispatchEvent (const Event &evt)
 
quint32 elementId () const
 
Node firstChild () const
 
KHTML_DEPRECATED void getCursor (int offset, int &_x, int &_y, int &height)
 
QRect getRect ()
 
NodeImpl * handle () const
 
bool hasAttributes ()
 
bool hasChildNodes ()
 
unsigned long index () const
 
Node insertBefore (const Node &newChild, const Node &refChild)
 
bool isNull () const
 
bool isSupported (const DOMString &feature, const DOMString &version) const
 
Node lastChild () const
 
DOMString localName () const
 
DOMString namespaceURI () const
 
Node nextSibling () const
 
DOMString nodeName () const
 
unsigned short nodeType () const
 
DOMString nodeValue () const
 
void normalize ()
 
bool operator!= (const Node &other) const
 
Nodeoperator= (const Node &other)
 
bool operator== (const Node &other) const
 
Document ownerDocument () const
 
Node parentNode () const
 
DOMString prefix () const
 
Node previousSibling () const
 
Node removeChild (const Node &oldChild)
 
void removeEventListener (const DOMString &type, EventListener *listener, bool useCapture)
 
Node replaceChild (const Node &newChild, const Node &oldChild)
 
void setNodeValue (const DOMString &)
 
void setPrefix (const DOMString &prefix)
 
void setTextContent (const DOMString &text)
 
DOMString textContent () const
 
KHTML_DEPRECATED QString toHTML ()
 

Additional Inherited Members

- Public Types inherited from DOM::Node
enum  DocumentPosition {
  DOCUMENT_POSITION_DISCONNECTED = 0x01, DOCUMENT_POSITION_PRECEDING = 0x02, DOCUMENT_POSITION_FOLLOWING = 0x04, DOCUMENT_POSITION_CONTAINS = 0x08,
  DOCUMENT_POSITION_CONTAINED_BY = 0x10, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20
}
 
enum  NodeType {
  ELEMENT_NODE = 1, ATTRIBUTE_NODE = 2, TEXT_NODE = 3, CDATA_SECTION_NODE = 4,
  ENTITY_REFERENCE_NODE = 5, ENTITY_NODE = 6, PROCESSING_INSTRUCTION_NODE = 7, COMMENT_NODE = 8,
  DOCUMENT_NODE = 9, DOCUMENT_TYPE_NODE = 10, DOCUMENT_FRAGMENT_NODE = 11, NOTATION_NODE = 12,
  XPATH_NAMESPACE_NODE = 13
}
 
- Protected Attributes inherited from DOM::Node
NodeImpl * impl
 

Detailed Description

The Document 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 Document , the Document interface also contains the factory methods needed to create these objects. The Node objects created have a ownerDocument attribute which associates them with the Document within whose context they were created.

Definition at line 246 of file dom_doc.h.

Constructor & Destructor Documentation

◆ Document()

Document::Document ( bool  create)

don't create an implementation if false use at own risk

Definition at line 178 of file dom_doc.cpp.

Member Function Documentation

◆ abort()

void Document::abort ( )

Introduced in DOM Level 3 This method is from the DocumentLS interface.

If the document is currently being loaded as a result of the method load being invoked the loading and parsing is immediately aborted. The possibly partial result of parsing the document is discarded and the document is cleared.

Definition at line 615 of file dom_doc.cpp.

◆ addStyleSheet()

void Document::addStyleSheet ( const StyleSheet sheet)

Adds a new style sheet to the list of style sheets.

The new style sheet will be applied after all author and implicit style sheets, but before the user style sheet.

Create new style sheets with e. g. DOMImplementation::createCSSStyleSheet

This is not part of the official DOM.

Parameters
sheetstyle sheet
Exceptions
DOMException

Definition at line 711 of file dom_doc.cpp.

◆ async()

bool Document::async ( ) const

Introduced in DOM Level 3 This method is from the DocumentLS interface.

Indicates whether the method DocumentLS.load() should be synchronous or asynchronous. When the async attribute is set to true the load method returns control to the caller before the document has completed loading. The default value of this attribute is true.

Definition at line 597 of file dom_doc.cpp.

◆ completeURL()

DOMString Document::completeURL ( const DOMString url)

not part of the DOM

completes a given URL

Definition at line 686 of file dom_doc.cpp.

◆ createAttribute()

Attr Document::createAttribute ( const DOMString name)

Creates an Attr of the given name.

Note that the Attr instance can then be set on an Element using the setAttribute method.

Parameters
nameThe name of the attribute.
Returns
A new Attr object.
Exceptions
DOMExceptionINVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

Definition at line 324 of file dom_doc.cpp.

◆ createAttributeNS()

Attr Document::createAttributeNS ( const DOMString namespaceURI,
const DOMString qualifiedName 
)

Introduced in DOM Level 2 Creates an attribute of the given qualified name and namespace URI.

HTML-only DOM implementations do not need to implement this method.

Parameters
namespaceURIThe namespace URI of the attribute to create.
qualifiedNameThe qualified name of the attribute to instantiate.
Returns
A new Attr object with the following attributes: Node.nodeName - qualifiedName Node.namespaceURI - namespaceURI Node.prefix - prefix, extracted from qualifiedName, or null if there is no prefix Node.localName - local name, extracted from qualifiedName Attr.name - qualifiedName Node.nodeValue - the empty string
Exceptions
INVALID_CHARACTER_ERRRaised if the specified qualified name contains an illegal character.
NAMESPACE_ERRRaised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace", or if the qualifiedName is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/".

Definition at line 340 of file dom_doc.cpp.

◆ createCDATASection()

CDATASection Document::createCDATASection ( const DOMString data)

Creates a CDATASection node whose value is the specified string.

Parameters
dataThe data for the CDATASection contents.
Returns
The new CDATASection object.
Exceptions
DOMExceptionNOT_SUPPORTED_ERR: Raised if this document is an HTML document.

Definition at line 303 of file dom_doc.cpp.

◆ createComment()

Comment Document::createComment ( const DOMString data)

Creates a Comment node given the specified string.

Parameters
dataThe data for the node.
Returns
The new Comment object.

Definition at line 295 of file dom_doc.cpp.

◆ createDocumentFragment()

DocumentFragment Document::createDocumentFragment ( )

Creates an empty DocumentFragment object.

Returns
A new DocumentFragment .

Definition at line 279 of file dom_doc.cpp.

◆ createElement()

Element Document::createElement ( const DOMString tagName)

Creates an element of the type specified.

Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object.

Parameters
tagNameThe name of the element type to instantiate. For XML, this is case-sensitive. For HTML, the tagName parameter may be provided in any case, but it must be mapped to the canonical uppercase form by the DOM implementation.
Returns
A new Element object.
Exceptions
DOMExceptionINVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

Definition at line 251 of file dom_doc.cpp.

◆ createElementNS()

Element Document::createElementNS ( const DOMString namespaceURI,
const DOMString qualifiedName 
)

Introduced in DOM Level 2 Creates an element of the given qualified name and namespace URI.

Parameters
namespaceURIThe namespace URI of the element to create.
qualifiedNameThe qualified name of the element type to instantiate.
Returns
A new Element object with the following attributes:
Exceptions
INVALID_CHARACTER_ERRRaised if the specified qualified name contains an illegal character.
NAMESPACE_ERRRaised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace"

Definition at line 265 of file dom_doc.cpp.

◆ createEntityReference()

EntityReference Document::createEntityReference ( const DOMString name)

Creates an EntityReference object.

Parameters
nameThe name of the entity to reference.
Returns
The new EntityReference object.
Exceptions
DOMExceptionINVALID_CHARACTER_ERR: Raised if the specified name contains an invalid character.

NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

Definition at line 356 of file dom_doc.cpp.

◆ createEvent()

Event Document::createEvent ( const DOMString eventType)

Introduced in DOM Level 2 This method is from the DocumentEvent interface.

The createEvent method is used in creating Events when it is either inconvenient or unnecessary for the user to create an Event themselves. In cases where the implementation provided Event is insufficient, users may supply their own Event implementations for use with the dispatchEvent method.

Parameters
eventTypeThe eventType parameter specifies the type of Event interface to be created. If the Event interface specified is supported by the implementation this method will return a new Event of the interface type requested. If the Event is to be dispatched via the dispatchEvent method the appropriate event init method must be called after creation in order to initialize the Event's values. As an example, a user wishing to synthesize some kind of UIEvent would call createEvent with the parameter "UIEvents". The initUIEvent method could then be called on the newly created UIEvent to set the specific type of UIEvent to be dispatched and set its context information.
Returns
The newly created EventExceptions
Exceptions
DOMExceptionNOT_SUPPORTED_ERR: Raised if the implementation does not support the type of Event interface requested

Definition at line 465 of file dom_doc.cpp.

◆ createNodeIterator()

NodeIterator Document::createNodeIterator ( Node  root,
unsigned long  whatToShow,
NodeFilter  filter,
bool  entityReferenceExpansion 
)

Introduced in DOM Level 2 This method is from the DocumentTraversal interface.

Create a new NodeIterator over the subtree rooted at the specified node.

Parameters
rootThe node which will be iterated together with its children. The iterator is initially positioned just before this node. The whatToShow flags and the filter, if any, are not considered when setting this position. The root must not be null.
whatToShowThis flag specifies which node types may appear in the logical view of the tree presented by the iterator. See the description of NodeFilter for the set of possible SHOW_ values. These flags can be combined using OR.
filterThe NodeFilter to be used with this NodeIterator, or null to indicate no filter.
entityReferenceExpansionThe value of this flag determines whether entity reference nodes are expanded.
Returns
NodeIterator The newly created NodeIterator.
Exceptions
DOMExceptionNOT_SUPPORTED_ERR: Raised if the specified root is null.

Definition at line 431 of file dom_doc.cpp.

◆ createProcessingInstruction()

ProcessingInstruction Document::createProcessingInstruction ( const DOMString target,
const DOMString data 
)

Creates a ProcessingInstruction node given the specified name and data strings.

Parameters
targetThe target part of the processing instruction.
dataThe data for the node.
Returns
The new ProcessingInstruction object.
Exceptions
DOMExceptionINVALID_CHARACTER_ERR: Raised if an invalid character is specified.

NOT_SUPPORTED_ERR: Raised if this document is an HTML document.

Definition at line 316 of file dom_doc.cpp.

◆ createRange()

Range Document::createRange ( )

Introduced in DOM Level 2 This method is from the DocumentRange interface.

Returns
Range The initial state of the Range returned from this method is such that both of its boundary-points are positioned at the beginning of the corresponding Document, before any content. The Range returned can only be used to select content associated with this Document, or with DocumentFragments and Attrs for which this Document is the ownerDocument.

Definition at line 423 of file dom_doc.cpp.

◆ createTextNode()

Text Document::createTextNode ( const DOMString data)

Creates a Text node given the specified string.

Parameters
dataThe data for the node.
Returns
The new Text object.

Definition at line 287 of file dom_doc.cpp.

◆ createTreeWalker()

TreeWalker Document::createTreeWalker ( Node  root,
unsigned long  whatToShow,
NodeFilter  filter,
bool  entityReferenceExpansion 
)

Introduced in DOM Level 2 This method is from the DocumentTraversal interface.

Create a new TreeWalker over the subtree rooted at the specified node.

Parameters
rootThe node which will serve as the root for the TreeWalker. The whatToShow flags and the NodeFilter are not considered when setting this value; any node type will be accepted as the root. The currentNode of the TreeWalker is initialized to this node, whether or not it is visible. The root functions as a stopping point for traversal methods that look upward in the document structure, such as parentNode and nextNode. The root must not be null.
whatToShowThis flag specifies which node types may appear in the logical view of the tree presented by the tree-walker. See the description of NodeFilter for the set of possible SHOW_ values. These flags can be combined using OR.
filterThe NodeFilter to be used with this TreeWalker, or null to indicate no filter.
entityReferenceExpansionIf this flag is false, the contents of EntityReference nodes are not presented in the logical view.
Returns
The newly created TreeWalker.
Exceptions
DOMExceptionNOT_SUPPORTED_ERR: Raised if the specified root is null.

Definition at line 447 of file dom_doc.cpp.

◆ defaultView()

AbstractView Document::defaultView ( ) const

Introduced in DOM Level 2 This method is from the DocumentView interface.

The default AbstractView for this Document, or null if none available.

Definition at line 479 of file dom_doc.cpp.

◆ designMode()

bool Document::designMode ( ) const

not part of the official DOM

Documents are read-only by default, but they can be made editable by entering "design mode".

Returns
whether this document is in design mode.

Definition at line 668 of file dom_doc.cpp.

◆ doctype()

DocumentType Document::doctype ( ) const

The Document Type Declaration (see DocumentType ) associated with this document.

For HTML documents as well as XML documents without a document type declaration this returns null . The DOM Level 1 does not support editing the Document Type Declaration, therefore docType cannot be altered in any way.

Definition at line 227 of file dom_doc.cpp.

◆ documentElement()

Element Document::documentElement ( ) const

This is a convenience attribute that allows direct access to the child node that is the root element of the document.

For HTML documents, this is the element with the tagName "HTML".

Definition at line 243 of file dom_doc.cpp.

◆ execCommand()

bool Document::execCommand ( const DOMString command,
bool  userInterface,
const DOMString value 
)

not part of the DOM

javascript editing command support

Definition at line 543 of file dom_doc.cpp.

◆ getElementById()

Element Document::getElementById ( const DOMString elementId) const

Moved from HTMLDocument in DOM Level 2 Returns the Element whose id is given by elementId.

If no such element exists, returns null . Behavior is not defined if more than one element has this id .

Parameters
elementIdThe unique id value for an element.
Returns
The matching element.

Definition at line 369 of file dom_doc.cpp.

◆ getElementsByClassName()

NodeList Document::getElementsByClassName ( const DOMString className)

Introduced in HTML 5.

No Exceptions.

Returns a NodeList of all the Element 's with a given class name in the order in which they would be encountered in a preorder traversal of the Document tree.

Parameters
tagnameAn unordered set of unique space-separated tokens representing classes.
Returns
A new NodeList object containing all the matched Element s.
Since
4.1

Definition at line 393 of file dom_doc.cpp.

◆ getElementsByTagName()

NodeList Document::getElementsByTagName ( const DOMString tagname)

No Exceptions.

Returns a NodeList of all the Element 's with a given tag name in the order in which they would be encountered in a preorder traversal of the Document tree.

Parameters
tagnameThe name of the tag to match on. The special value "*" matches all tags.
Returns
A new NodeList object containing all the matched Element s.

Definition at line 377 of file dom_doc.cpp.

◆ getElementsByTagNameNS()

NodeList Document::getElementsByTagNameNS ( const DOMString namespaceURI,
const DOMString localName 
)

Introduced in DOM Level 2 No Exceptions.

Returns a NodeList of all the Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of the Document tree.

Parameters
namespaceURIThe namespace URI of the elements to match on. The special value "*" matches all namespaces.
localNameThe local name of the elements to match on. The special value "*" matches all local names.
Returns
A new NodeList object containing all the matched Elements.

Definition at line 385 of file dom_doc.cpp.

◆ getOverrideStyle()

CSSStyleDeclaration Document::getOverrideStyle ( const Element elt,
const DOMString pseudoElt 
)

Introduced in DOM Level 2 This method is from the DocumentCSS interface.

This method is used to retrieve the override style declaration for a specified element and a specified pseudo-element.

Parameters
eltThe element whose style is to be modified. This parameter cannot be null.
pseudoEltThe pseudo-element or null if none.
Returns
The override style declaration.

Definition at line 533 of file dom_doc.cpp.

◆ implementation()

DOMImplementation Document::implementation ( ) const

The DOMImplementation object that handles this document.

A DOM application may use objects from multiple implementations.

Definition at line 235 of file dom_doc.cpp.

◆ importNode()

Node Document::importNode ( const Node importedNode,
bool  deep 
)

Introduced in DOM Level 2.

Imports a node from another document to this document. The returned node has no parent; (parentNode is null). The source node is not altered or removed from the original document; this method creates a new copy of the source node.

For all nodes, importing a node creates a node object owned by the importing document, with attribute values identical to the source node's nodeName and nodeType, plus the attributes related to namespaces (prefix, localName, and namespaceURI).

As in the cloneNode operation on a Node, the source node is not altered. Additional information is copied as appropriate to the nodeType, attempting to mirror the behavior expected if a fragment of XML or HTML source was copied from one document to another, recognizing that the two documents may have different DTDs in the XML case. The following list describes the specifics for each type of node.

ATTRIBUTE_NODE The ownerElement attribute is set to null and the specified flag is set to true on the generated Attr. The descendants of the source Attr are recursively imported and the resulting nodes reassembled to form the corresponding subtree. Note that the deep parameter has no effect on Attr nodes; they always carry their children with them when imported.

DOCUMENT_FRAGMENT_NODE If the deep option was set to true, the descendants of the source element are recursively imported and the resulting nodes reassembled to form the corresponding subtree. Otherwise, this simply generates an empty DocumentFragment.

DOCUMENT_NODE Document nodes cannot be imported.

DOCUMENT_TYPE_NODE DocumentType nodes cannot be imported.

ELEMENT_NODE Specified attribute nodes of the source element are imported, and the generated Attr nodes are attached to the generated Element. Default attributes are not copied, though if the document being imported into defines default attributes for this element name, those are assigned. If the importNode deep parameter was set to true, the descendants of the source element are recursively imported and the resulting nodes reassembled to form the corresponding subtree.

ENTITY_NODE Entity nodes can be imported, however in the current release of the DOM the DocumentType is readonly. Ability to add these imported nodes to a DocumentType will be considered for addition to a future release of the DOM. On import, the publicId, systemId, and notationName attributes are copied. If a deep import is requested, the descendants of the source Entity are recursively imported and the resulting nodes reassembled to form the corresponding subtree.

ENTITY_REFERENCE_NODE Only the EntityReference itself is copied, even if a deep import is requested, since the source and destination documents might have defined the entity differently. If the document being imported into provides a definition for this entity name, its value is assigned.

NOTATION_NODE Notation nodes can be imported, however in the current release of the DOM the DocumentType is readonly. Ability to add these imported nodes to a DocumentType will be considered for addition to a future release of the DOM. On import, the publicId and systemId attributes are copied. Note that the deep parameter has no effect on Notation nodes since they never have any children.

PROCESSING_INSTRUCTION_NODE The imported node copies its target and data values from those of the source node.

TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE These three types of nodes inheriting from CharacterData copy their data and length attributes from those of the source node.

Parameters
importedNodeThe node to import.
deepIf true, recursively import the subtree under the specified node; if false, import only the node itself, as explained above. This has no effect on Attr, EntityReference, and Notation nodes.
Returns
The imported node that belongs to this Document.
Exceptions
DOMExceptionNOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.

Definition at line 401 of file dom_doc.cpp.

◆ isHTMLDocument()

bool Document::isHTMLDocument ( ) const

not part of the DOM

Definition at line 415 of file dom_doc.cpp.

◆ load()

void Document::load ( const DOMString uri)

Introduced in DOM Level 3 This method is from the DocumentLS interface.

Replaces the content of the document with the result of parsing the given URI. Invoking this method will either block the caller or return to the caller immediately depending on the value of the async attribute. Once the document is fully loaded a "load" event (as defined in [DOM Level 3 Events], except that the Event.targetNode will be the document, not an element) will be dispatched on the document. If an error occurs, an implementation dependent "error" event will be dispatched on the document. If this method is called on a document that is currently loading, the current load is interrupted and the new URI load is initiated.

When invoking this method the parameters used in the DOMParser interface are assumed to have their default values with the exception that the parameters "entities", "normalize-characters", "check-character-normalization" are set to "false".

The result of a call to this method is the same the result of a call to DOMParser.parseWithContext with an input stream referencing the URI that was passed to this call, the document as the context node, and the action ACTION_REPLACE_CHILDREN.

Parameters
uriof type DOMString The URI reference for the XML file to be loaded. If this is a relative URI, the base URI used by the implementation is implementation dependent.
Returns
If async is set to true load returns true if the document load was successfully initiated. If an error occurred when initiating the document load, load returns false. If async is set to false load returns true if the document was successfully loaded and parsed. If an error occurred when either loading or parsing the URI, load returns false.

Definition at line 624 of file dom_doc.cpp.

◆ loadXML()

void Document::loadXML ( const DOMString source)

Introduced in DOM Level 3 This method is from the DocumentLS interface.

Replace the content of the document with the result of parsing the input string, this method is always synchronous. This method always parses from a DOMString, which means the data is always UTF-16. All other encoding information is ignored.

The parameters used in the DOMParser interface are assumed to have their default values when invoking this method.

The result of a call to this method is the same as the result of a call to DOMParser.parseWithContext with an input stream containing the string passed to this call, the document as the context node, and the action ACTION_REPLACE_CHILDREN.

Parameters
sourceA string containing an XML document.

Definition at line 633 of file dom_doc.cpp.

◆ preferredStylesheetSet()

DOMString Document::preferredStylesheetSet ( )

CSS3 mechanism for selecting alternate stylesheets using the DOM.

Might change without further notice.

Definition at line 497 of file dom_doc.cpp.

◆ querySelector()

Element Document::querySelector ( const DOMString query) const

Introduced in Selectors Level 1.

Returns the first (in document order) element matching the given CSS selector query.

Since
4.5

Definition at line 642 of file dom_doc.cpp.

◆ querySelectorAll()

NodeList Document::querySelectorAll ( const DOMString query) const

Introduced in Selectors Level 1.

Returns all (in document order) elements matching the given CSS selector query. Note that the returned NodeList is static and not live, and will not be updated when the document changes

Since
4.5

Definition at line 655 of file dom_doc.cpp.

◆ removeStyleSheet()

void Document::removeStyleSheet ( const StyleSheet sheet)

Removes a style sheet to the list of style sheets.

Only sheets added by addStyleSheet may be removed.

This is not part of the official DOM.

Parameters
sheetstyle sheet to remove
Exceptions
DOMExceptionNOT_FOUND_ERR sheet is not contained in the list of style sheets or it has not been added by addStyleSheet

Definition at line 724 of file dom_doc.cpp.

◆ setAsync()

void Document::setAsync ( bool  b)

Introduced in DOM Level 3 This method is from the DocumentLS interface.

see async

Exceptions
DOMExceptionNOT_SUPPORTED_ERR: Raised if the implementation doesn't support the mode the attribute is being set to.

Definition at line 606 of file dom_doc.cpp.

◆ setDesignMode()

void Document::setDesignMode ( bool  enable)

not part of the official DOM

Parameters
enabletrue to enable design mode, false to disable.
See also
designMode

Definition at line 677 of file dom_doc.cpp.

◆ styleSheets()

StyleSheetList Document::styleSheets ( ) const

Introduced in DOM Level 2 This method is from the DocumentStyle interface.

A list containing all the style sheets explicitly linked into or embedded in a document. For HTML documents, this includes external style sheets, included via the HTML LINK element, and inline STYLE elements. In XML, this includes external style sheets, included via style sheet processing instructions (see [XML-StyleSheet]).

Definition at line 488 of file dom_doc.cpp.

◆ updateRendering()

void Document::updateRendering ( )

not part of the DOM

Updates the rendered display after one or more changes to the DOM structure

Definition at line 703 of file dom_doc.cpp.

◆ view()

KHTMLView * Document::view ( ) const
Returns
The KHTML view widget of this document.

Definition at line 524 of file dom_doc.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 04:09:50 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.