DOM::DocumentImpl

Search for usage in LXR

#include <dom_docimpl.h>

Inheritance diagram for DOM::DocumentImpl:

Public Types

enum  HTMLMode { Html3 = 0, Html4 = 1, XHtml = 2 }
 
enum  ListenerType {
  DOMSUBTREEMODIFIED_LISTENER = 0x01, DOMNODEINSERTED_LISTENER = 0x02, DOMNODEREMOVED_LISTENER = 0x04, DOMNODEREMOVEDFROMDOCUMENT_LISTENER = 0x08,
  DOMNODEINSERTEDINTODOCUMENT_LISTENER = 0x10, DOMATTRMODIFIED_LISTENER = 0x20, DOMCHARACTERDATAMODIFIED_LISTENER = 0x40
}
 
typedef QMap< QString, ProcessingInstructionImpl * > LocalStyleRefs
 
enum  ParseMode { Unknown, Compat, Transitional, Strict }
 
enum  TreeVersion { TV_Structural, TV_IDNameHref, TV_Class, NumTreeVersions }
 

Signals

void finishedParsing ()
 

Public Member Functions

 DocumentImpl (KHTMLView *v)
 
void abort ()
 
WebCore::SVGDocumentExtensions * accessSVGExtensions ()
 
DynamicNodeListImpl::Cache * acquireCachedNodeListInfo (DynamicNodeListImpl::CacheFactory *fact, NodeImpl *base, int type)
 
NodeImpl * activeNode () const
 
void addListenerType (ListenerType listenerType)
 
void addPendingSheet ()
 
void addStyleSheet (StyleSheetImpl *, int *exceptioncode=nullptr)
 
void addWindowEventListener (EventName id, EventListener *listener, const bool useCapture)
 
bool async () const
 
void attach () override
 
void attachNodeIterator (NodeIteratorImpl *ni)
 
void attemptRestoreState (NodeImpl *e)
 
QStringList availableStyleSheets () const
 
QString baseTarget () const
 
QUrl baseURL () const
 
HTMLElementImpl * body () const
 
DOMString canonURL (const DOMString &url) const
 
void childrenChanged () override
 
bool childTypeAllowed (unsigned short nodeType) override
 
void clearSelection ()
 
WTF::PassRefPtr< NodeImpl > cloneNode (bool deep) override
 
void close () override
 
QString completeURL (const QString &url) const
 
DOMString contentLanguage () const
 
virtual void contentLoaded ()
 
QHash< DOMString, khtml::CounterNode * > * counters (const khtml::RenderObject *o)
 
virtual AttrImpl * createAttribute (const DOMString &tagName, int *pExceptioncode=nullptr)
 
virtual AttrImpl * createAttributeNS (const DOMString &_namespaceURI, const DOMString &_qualifiedName, int *pExceptioncode=nullptr)
 
CDATASectionImpl * createCDATASection (DOMStringImpl *data, int &exceptioncode)
 
CommentImpl * createComment (DOMStringImpl *data)
 
DocumentFragmentImpl * createDocumentFragment ()
 
EditingTextImpl * createEditingTextNode (const DOMString &text)
 
virtual ElementImpl * createElement (const DOMString &tagName, int *pExceptioncode=nullptr)
 
virtual ElementImpl * createElementNS (const DOMString &_namespaceURI, const DOMString &_qualifiedName, int *pExceptioncode=nullptr)
 
EntityReferenceImpl * createEntityReference (const DOMString &name, int &exceptioncode)
 
EventImpl * createEvent (const DOMString &eventType, int &exceptioncode)
 
khtml::XPathExpressionImpl * createExpression (DOM::DOMString &expression, khtml::XPathNSResolverImpl *resolver, int &exceptioncode)
 
virtual ElementImpl * createHTMLElement (const DOMString &tagName, bool caseInsensitive=true)
 
EventListenercreateHTMLEventListener (const QString &code, const QString &name, NodeImpl *node)
 
EventListenercreateHTMLEventListener (QString code)
 
NodeIteratorImpl * createNodeIterator (NodeImpl *root, unsigned long whatToShow, NodeFilterImpl *filter, bool entityReferenceExpansion, int &exceptioncode)
 
khtml::XPathNSResolverImpl * createNSResolver (NodeImpl *nodeResolver)
 
ProcessingInstructionImpl * createProcessingInstruction (const DOMString &target, DOMStringImpl *data)
 
RangeImpl * createRange ()
 
virtual ElementImpl * createSVGElement (const QualifiedName &name)
 
TextImpl * createTextNode (const char *latin1)
 
TextImpl * createTextNode (const DOMString &data)
 
TextImpl * createTextNode (const QString &data)
 
TextImpl * createTextNode (DOMStringImpl *data)
 
virtual khtml::Tokenizer * createTokenizer ()
 
TreeWalkerImpl * createTreeWalker (NodeImpl *root, unsigned long whatToShow, NodeFilterImpl *filter, bool entityReferenceExpansion, int &exceptioncode)
 
KEncodingDetectordecoder ()
 
void defaultEventHandler (EventImpl *evt) override
 
AbstractViewImpl * defaultView () const
 
void deregisterMaintainsState (NodeImpl *e)
 
bool designMode () const
 
void detach () override
 
void detachNodeIterator (NodeIteratorImpl *ni)
 
virtual void determineParseMode ()
 
void dispatchImageLoadEventsNow ()
 
void dispatchImageLoadEventSoon (HTMLImageElementImpl *)
 
khtml::DocLoaderdocLoader ()
 
QStringList docState ()
 
DocumentTypeImpl * doctype () const
 
ElementImpl * documentElement () const
 
DOMString domain () const
 
unsigned int domTreeVersion (unsigned ver) const
 
khtml::DynamicDomRestylerdynamicDomRestyler ()
 
const khtml::DynamicDomRestylerdynamicDomRestyler () const
 
CSSStyleSheetImpl * elementSheet ()
 
void ensureStyleSheetListUpToDate ()
 
void error (int err, const QString &text) override
 
khtml::XPathResultImpl * evaluate (DOM::DOMString &expression, NodeImpl *contextNode, khtml::XPathNSResolverImpl *resolver, unsigned short type, khtml::XPathResultImpl *result, int &exceptioncode)
 
bool execCommand (const DOMString &command, bool userInterface, const DOMString &value)
 
ElementImpl * findAccessKeyElement (QChar c)
 
void finishParsing ()
 
NodeImpl * focusNode () const
 
NodeImpl * getCSSTarget ()
 
ElementImpl * getElementById (const DOMString &elementId) const
 
ElementMappingCachegetElementByIdCache () const
 
EventListenergetHTMLWindowEventListener (EventName id)
 
EventListenergetHTMLWindowEventListener (unsigned id)
 
CSSStyleDeclarationImpl * getOverrideStyle (ElementImpl *elt, DOMStringImpl *pseudoElt)
 
bool hasListenerType (ListenerType listenerType) const
 
bool hasPendingSheets () const
 
bool hasVariableLength () const
 
bool hasWindowEventListener (EventName id)
 
bool haveStylesheetsLoaded () const
 
NodeImpl * hoverNode () const
 
HTMLMode htmlMode () const
 
DOMImplementationImpl * implementation () const
 
NodeImpl * importNode (NodeImpl *importedNode, bool deep, int &exceptioncode)
 
void incDOMTreeVersion (unsigned ver)
 
bool inCompatMode () const
 
bool inStrictMode () const
 
bool inTransitionalMode () const
 
bool isDocumentChanged ()
 
bool isDocumentNode () const override
 
virtual bool isHTMLDocument () const
 
virtual bool isSVGDocument () const
 
bool isURLAllowed (const QString &url) const
 
JSEditor * jsEditor ()
 
void load (const DOMString &uri)
 
void loadXML (const DOMString &source)
 
LocalStyleRefslocalStyleRefs ()
 
int logicalDpiY ()
 
NodeImpl * nextFocusNode (NodeImpl *fromNode)
 
int nodeAbsIndex (NodeImpl *node)
 
DOMString nodeName () const override
 
unsigned short nodeType () const override
 
NodeImpl * nodeWithAbsIndex (int absIndex)
 
void notifyBeforeNodeRemoval (NodeImpl *n)
 
void open (bool clearEventListeners=true)
 
khtml::SecurityOrigin * origin () const
 
HTMLPartContainerElementImpl * ownerElement () const
 
QPaintDevicepaintDevice () const
 
ParseMode parseMode () const
 
bool parsing () const
 
KHTMLPartpart () const
 
DOMString preferredStylesheetSet () const
 
bool prepareMouseEvent (bool readonly, int x, int y, MouseEvent *ev)
 
NodeImpl * previousFocusNode (NodeImpl *fromNode)
 
QString printStyleSheet () const
 
void processHttpEquiv (const DOMString &equiv, const DOMString &content)
 
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)
 
void quietResetFocus ()
 
bool readyForLayout () const
 
void recalcStyle (StyleChange=NoChange) override
 
void registerMaintainsState (NodeImpl *e)
 
void releaseCachedNodeListInfo (DynamicNodeListImpl::Cache *cache)
 
void removeCounters (const khtml::RenderObject *o)
 
void removedLastRef () override
 
void removeImage (HTMLImageElementImpl *)
 
void removeStyleSheet (StyleSheetImpl *, int *exceptioncode=nullptr)
 
void removeWindowEventListener (EventName id, EventListener *listener, bool useCapture)
 
khtml::RenderArena * renderArena ()
 
DOMString selectedStylesheetSet () const
 
void selfOnlyDeref ()
 
void selfOnlyRef ()
 
void setActiveNode (NodeImpl *newActiveNode)
 
void setAsync (bool b)
 
void setBaseTarget (const QString &baseTarget)
 
void setBaseURL (const QUrl &baseURL)
 
void setContentLanguage (const QString &cl)
 
void setCounters (const khtml::RenderObject *o, QHash< DOMString, khtml::CounterNode * > *dict)
 
void setCSSTarget (NodeImpl *n)
 
void setDecoder (KEncodingDetector *enc)
 
void setDesignMode (bool b)
 
virtual void setDocumentChanged (bool=true)
 
void setDomain (const DOMString &newDomain)
 
void setFocusNode (NodeImpl *newFocusNode)
 
void setHasVariableLength (bool b=true)
 
void setHoverNode (NodeImpl *newHoverNode)
 
void setHTMLWindowEventListener (EventName id, EventListener *listener)
 
void setHTMLWindowEventListener (unsigned id, EventListener *listener)
 
void setOrigin (khtml::SecurityOrigin *)
 
void setPaintDevice (QPaintDevice *dev)
 
void setParseMode (ParseMode m)
 
void setParsing (bool b)
 
void setPreferredStylesheetSet (const DOMString &s)
 
void setPrintStyleSheet (const QString &sheet)
 
void setRestoreState (const QStringList &s)
 
void setSelectedStylesheetSet (const DOMString &)
 
void setSelection (NodeImpl *s, int sp, NodeImpl *e, int ep)
 
void setStyleSheet (const DOM::DOMString &url, const DOM::DOMString &sheet, const DOM::DOMString &charset, const DOM::DOMString &mimetype) override
 
void setTextColor (QColor color)
 
void setTitle (const DOMString &_title)
 
void setURL (const QString &url)
 
void setUserStyleSheet (const QString &sheet)
 
void setVisuallyOrdered ()
 
khtml::CSSStyleSelectorstyleSelector ()
 
void styleSheetLoaded ()
 
StyleSheetListImpl * styleSheets ()
 
const WebCore::SVGDocumentExtensions * svgExtensions ()
 
QColor textColor () const
 
void timerEvent (QTimerEvent *) override
 
DOMString title () const
 
khtml::Tokenizer * tokenizer ()
 
DOMString toString () const override
 
ElementMappingCacheunderDocNamedCache ()
 
bool unsubmittedFormChanges ()
 
void updateLayout ()
 
virtual void updateRendering ()
 
void updateSelection ()
 
void updateStyleSelector (bool shallow=false)
 
QUrl URL () const
 
QString userStyleSheet () const
 
KHTMLViewview () const
 
WindowEventTargetImpl * windowEventTarget () const
 
void write (const DOMString &text)
 
void write (const QString &text)
 
void writeln (const DOMString &text)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static void updateDocumentsRendering ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Attributes

HTMLMode hMode
 
NodeImpl * m_activeNode
 
StyleSheetListImpl * m_addedStyleSheets
 
bool m_async
 
QStringList m_availableSheets
 
QString m_baseTarget
 
QUrl m_baseURL
 
bool m_bParsing
 
bool m_bVariableLength
 
DOMString m_contentLanguage
 
QHash< const khtml::RenderObject *, QHash< DOMString, khtml::CounterNode * > * > m_counterDict
 
NodeImpl * m_cssTarget
 
KEncodingDetectorm_decoder
 
AbstractViewImpl * m_defaultView
 
bool m_docChanged
 
khtml::DocLoaderm_docLoader
 
bool m_docLoading
 
DocumentTypeImpl * m_doctype
 
ElementImpl * m_documentElement
 
unsigned int m_domTreeVersions [NumTreeVersions]
 
khtml::DynamicDomRestylerm_dynamicDomRestyler
 
CSSStyleSheetImpl * m_elemSheet
 
NodeImpl * m_focusNode
 
ElementMappingCache m_getElementByIdCache
 
bool m_hadLoadError
 
NodeImpl * m_hoverNode
 
bool m_ignorePendingStylesheets
 
QLinkedList< HTMLImageElementImpl * > m_imageLoadEventDispatchingList
 
QLinkedList< HTMLImageElementImpl * > m_imageLoadEventDispatchSoonList
 
int m_imageLoadEventTimer
 
DOMImplementationImpl * m_implementation
 
bool m_inStyleRecalc
 
QEventLoopm_inSyncLoad
 
unsigned short m_listenerTypes
 
khtml::CachedCSSStyleSheetm_loadingXMLDoc
 
LocalStyleRefs m_localStyleRefs
 
QList< NodeImpl * > m_maintainsState
 
QList< NodeIteratorImpl * > m_nodeIterators
 
QHash< long, DynamicNodeListImpl::Cache * > m_nodeListCache
 
QPaintDevicem_paintDevice
 
int m_pendingStylesheets
 
DOMString m_preferredStylesheetSet
 
QString m_printSheet
 
SharedPtr< khtml::RenderArena > m_renderArena
 
QStringList m_state
 
int m_stateRestorePos
 
khtml::CSSStyleSelectorm_styleSelector
 
bool m_styleSelectorDirty
 
StyleSheetListImpl * m_styleSheets
 
WebCore::SVGDocumentExtensions * m_svgExtensions
 
QColor m_textColor
 
DOMString m_title
 
khtml::Tokenizer * m_tokenizer
 
ElementMappingCache m_underDocNamedCache
 
QUrl m_url
 
QString m_usersheet
 
KHTMLViewm_view
 
RegisteredListenerList m_windowEventListeners
 
WindowEventTargetImpl * m_windowEventTarget
 
ParseMode pMode
 
bool visuallyOrdered
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 

Detailed Description

Definition at line 199 of file dom_docimpl.h.

Member Function Documentation

◆ addPendingSheet()

void DocumentImpl::addPendingSheet ( )

Increments the number of pending sheets.

The <link> elements invoke this to add themselves to the loading list.

Definition at line 2237 of file dom_docimpl.cpp.

◆ hasPendingSheets()

bool DOM::DocumentImpl::hasPendingSheets ( ) const
inline

Returns true if the document has pending stylesheets loading.

Definition at line 311 of file dom_docimpl.h.

◆ haveStylesheetsLoaded()

bool DOM::DocumentImpl::haveStylesheetsLoaded ( ) const
inline

This method returns true if all top-level stylesheets have loaded (including any @imports that they may be loading).

Definition at line 296 of file dom_docimpl.h.

◆ nextFocusNode()

NodeImpl * DocumentImpl::nextFocusNode ( NodeImpl *  fromNode)

Searches through the document, starting from fromNode, for the next selectable element that comes after fromNode.

The order followed is as specified in section 17.11.1 of the HTML4 spec, which is elements with tab indexes first (from lowest to highest), and then elements without tab indexes (in document order).

Parameters
fromNodeThe node from which to start searching. The node after this will be focused. May be null.
Returns
The focus node that comes after fromNode

See https://www.w3.org/TR/html4/interact/forms.html#h-17.11.1

Definition at line 1807 of file dom_docimpl.cpp.

◆ previousFocusNode()

NodeImpl * DocumentImpl::previousFocusNode ( NodeImpl *  fromNode)

Searches through the document, starting from fromNode, for the previous selectable element (that comes before) fromNode.

The order followed is as specified in section 17.11.1 of the HTML4 spec, which is elements with tab indexes first (from lowest to highest), and then elements without tab indexes (in document order).

Parameters
fromNodeThe node from which to start searching. The node before this will be focused. May be null.
Returns
The focus node that comes before fromNode

See https://www.w3.org/TR/html4/interact/forms.html#h-17.11.1

Definition at line 1901 of file dom_docimpl.cpp.

◆ processHttpEquiv()

void DocumentImpl::processHttpEquiv ( const DOMString equiv,
const DOMString content 
)

Handles a HTTP header equivalent set by a meta tag using <meta http-equiv="..." content="...">.

This is called when a meta tag is encountered during document parsing, and also when a script dynamically changes or adds a meta tag. This enables scripts to use meta tags to perform refreshes and set expiry dates in addition to them being specified in a HTML file.

Parameters
equivThe http header name (value of the meta tag's "equiv" attribute)
contentThe header value (value of the meta tag's "content" attribute)

Definition at line 2053 of file dom_docimpl.cpp.

◆ styleSheetLoaded()

void DocumentImpl::styleSheetLoaded ( )

Updates the pending sheet count and then calls updateStyleSelector.

Definition at line 2225 of file dom_docimpl.cpp.

◆ updateStyleSelector()

void DocumentImpl::updateStyleSelector ( bool  shallow = false)

Called when one or more stylesheets in the document may have been added, removed or changed.

Creates a new style selector and assign it to this document. This is done by iterating through all nodes in document (or those before <BODY> in a HTML document), searching for stylesheets. Stylesheets can be contained in <LINK>, <STYLE> or <BODY> elements, as well as processing instructions (XML documents only). A list is constructed from these which is used to create the a new style selector which collates all of the stylesheets found and is used to calculate the derived styles for all rendering objects.

Parameters
shallowIf the stylesheet list for the document is unchanged, with only added or removed rules in existing sheets, then set this argument to true for efficiency.

Definition at line 2317 of file dom_docimpl.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 Thu Sep 21 2023 04:08:44 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.