2 * This file is part of the DOM implementation for KDE.
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
5 * (C) 1999 Antti Koivisto (koivisto@kde.org)
6 * (C) 2001 Dirk Mueller (mueller@kde.org)
7 * Copyright (C) 2004 Apple Computer, Inc.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details.
19 * You should have received a copy of the GNU Library General Public License
20 * along with this library; see the file COPYING.LIB. If not, write to
21 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 * Boston, MA 02111-1307, USA.
25 #ifndef _DOM_DocumentImpl_h_
26 #define _DOM_DocumentImpl_h_
28 #include "xml/dom_elementimpl.h"
29 #include "xml/dom2_traversalimpl.h"
30 #include "misc/shared.h"
32 #include <qstringlist.h>
38 #include <qdatetime.h>
43 #include "KWQSignal.h"
48 class QPaintDeviceMetrics;
54 class KWQAccObjectCache;
58 class CSSStyleSelector;
64 struct DashboardRegionValue;
70 class XBLBindingManager;
75 class AbstractViewImpl;
77 class CDATASectionImpl;
78 class CSSStyleSheetImpl;
79 class CSSMappedAttributeDeclarationImpl;
81 class DocumentFragmentImpl;
84 class DocumentTypeImpl;
86 class DOMImplementation;
88 class EditingTextImpl;
90 class EntityReferenceImpl;
93 class GenericRONamedNodeMapImpl;
94 class HTMLDocumentImpl;
95 class HTMLElementImpl;
96 class HTMLImageLoader;
97 class HTMLMapElementImpl;
100 class NodeFilterImpl;
101 class NodeIteratorImpl;
103 class ProcessingInstructionImpl;
106 class RegisteredEventListener;
107 class StyleSheetImpl;
108 class StyleSheetListImpl;
110 class TreeWalkerImpl;
112 class XSLStyleSheetImpl;
115 // A range of a node within a document that is "marked", such as being misspelled
116 struct DocumentMarker
120 // Not doing grammar yet, but this is a placeholder for it
124 enum MarkerType type;
125 ulong startOffset, endOffset;
127 bool operator == (const DocumentMarker &o) const {
128 return type == o.type && startOffset == o.startOffset && endOffset == o.endOffset;
130 bool operator != (const DocumentMarker &o) const {
131 return !(*this == o);
135 class DOMImplementationImpl : public khtml::Shared<DOMImplementationImpl>
138 DOMImplementationImpl();
139 ~DOMImplementationImpl();
141 MAIN_THREAD_ALLOCATED;
143 // DOM methods & attributes for DOMImplementation
144 bool hasFeature ( const DOMString &feature, const DOMString &version );
145 DocumentTypeImpl *createDocumentType( const DOMString &qualifiedName, const DOMString &publicId,
146 const DOMString &systemId, int &exceptioncode );
147 DocumentImpl *createDocument( const DOMString &namespaceURI, const DOMString &qualifiedName,
148 const DocumentType &doctype, int &exceptioncode );
150 DOMImplementationImpl* getInterface(const DOMString& feature) const;
152 // From the DOMImplementationCSS interface
153 CSSStyleSheetImpl *createCSSStyleSheet(DOMStringImpl *title, DOMStringImpl *media, int &exceptioncode);
155 // From the HTMLDOMImplementation interface
156 HTMLDocumentImpl* createHTMLDocument( const DOMString& title);
158 // Other methods (not part of DOM)
159 DocumentImpl *createDocument( KHTMLView *v = 0 );
160 HTMLDocumentImpl *createHTMLDocument( KHTMLView *v = 0 );
162 // Returns the static instance of this class - only one instance of this class should
163 // ever be present, and is used as a factory method for creating DocumentImpl objects
164 static DOMImplementationImpl *instance();
167 static DOMImplementation createInstance (DOMImplementationImpl *impl);
171 static DOMImplementationImpl *m_instance;
178 class DocumentImpl : public QObject, public ContainerNodeImpl
182 DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v);
185 // DOM methods & attributes for Document
187 DocumentTypeImpl *doctype() const;
189 DOMImplementationImpl *implementation() const;
190 virtual ElementImpl *documentElement() const;
191 virtual ElementImpl *createElement ( const DOMString &tagName, int &exceptioncode );
192 DocumentFragmentImpl *createDocumentFragment ();
193 TextImpl *createTextNode ( const DOMString &data );
194 CommentImpl *createComment ( const DOMString &data );
195 CDATASectionImpl *createCDATASection ( const DOMString &data );
196 ProcessingInstructionImpl *createProcessingInstruction ( const DOMString &target, const DOMString &data );
197 Attr createAttribute(NodeImpl::Id id);
198 EntityReferenceImpl *createEntityReference ( const DOMString &name );
199 NodeImpl *importNode( NodeImpl *importedNode, bool deep, int &exceptioncode );
200 virtual ElementImpl *createElementNS ( const DOMString &_namespaceURI, const DOMString &_qualifiedName, int &exceptioncode );
201 ElementImpl *getElementById ( const DOMString &elementId ) const;
202 ElementImpl *elementFromPoint ( const int _x, const int _y ) const;
204 // Actually part of HTMLDocument, but used for giving XML documents a window title as well
205 DOMString title() const { return m_title; }
206 void setTitle(DOMString _title);
208 // DOM methods overridden from parent classes
210 virtual DOMString nodeName() const;
211 virtual unsigned short nodeType() const;
213 // Other methods (not part of DOM)
214 virtual bool isDocumentNode() const { return true; }
215 virtual bool isHTMLDocument() const { return false; }
217 ElementImpl *createHTMLElement(const DOMString &tagName, int &exceptioncode);
218 ElementImpl *createHTMLElement(unsigned short tagID);
220 khtml::CSSStyleSelector *styleSelector() { return m_styleSelector; }
222 ElementImpl *DocumentImpl::getElementByAccessKey( const DOMString &key );
225 * Updates the pending sheet count and then calls updateStyleSelector.
227 void stylesheetLoaded();
230 * This method returns true if all top-level stylesheets have loaded (including
231 * any @imports that they may be loading).
233 bool haveStylesheetsLoaded() { return m_pendingStylesheets <= 0 || m_ignorePendingStylesheets; }
236 * Increments the number of pending sheets. The <link> elements
237 * invoke this to add themselves to the loading list.
239 void addPendingSheet() { m_pendingStylesheets++; }
242 * Called when one or more stylesheets in the document may have been added, removed or changed.
244 * Creates a new style selector and assign it to this document. This is done by iterating through all nodes in
245 * document (or those before <BODY> in a HTML document), searching for stylesheets. Stylesheets can be contained in
246 * <LINK>, <STYLE> or <BODY> elements, as well as processing instructions (XML documents only). A list is
247 * constructed from these which is used to create the a new style selector which collates all of the stylesheets
248 * found and is used to calculate the derived styles for all rendering objects.
250 void updateStyleSelector();
252 void recalcStyleSelector();
254 bool usesDescendantRules() { return m_usesDescendantRules; }
255 void setUsesDescendantRules(bool b) { m_usesDescendantRules = b; }
256 bool usesSiblingRules() { return m_usesSiblingRules; }
257 void setUsesSiblingRules(bool b) { m_usesSiblingRules = b; }\
261 // Query all registered elements for their state
262 QStringList docState();
263 void registerMaintainsState(NodeImpl* e) { m_maintainsState.append(e); }
264 void deregisterMaintainsState(NodeImpl* e) { m_maintainsState.removeRef(e); }
266 // Set the state the document should restore to
267 void setRestoreState( const QStringList &s) { m_state = s; }
268 QStringList &restoreState( ) { return m_state; }
270 KHTMLView *view() const { return m_view; }
271 KHTMLPart *part() const;
273 RangeImpl *createRange();
275 NodeIteratorImpl *createNodeIterator(NodeImpl *root, unsigned long whatToShow,
276 NodeFilterImpl *filter, bool expandEntityReferences, int &exceptioncode);
278 TreeWalkerImpl *createTreeWalker(NodeImpl *root, unsigned long whatToShow,
279 NodeFilterImpl *filter, bool expandEntityReferences, int &exceptioncode);
281 // Special support for editing
282 CSSStyleDeclarationImpl *createCSSStyleDeclaration();
283 EditingTextImpl *createEditingTextNode(const DOMString &text);
285 virtual void recalcStyle( StyleChange = NoChange );
286 static QPtrList<DocumentImpl> * changedDocuments;
287 virtual void updateRendering();
289 void updateLayoutIgnorePendingStylesheets();
290 static void updateDocumentsRendering();
291 khtml::DocLoader *docLoader() { return m_docLoader; }
293 virtual void attach();
294 virtual void detach();
296 RenderArena* renderArena() { return m_renderArena; }
299 KWQAccObjectCache* getAccObjectCache();
302 // to get visually ordered hebrew and arabic pages right
303 void setVisuallyOrdered();
305 void updateSelection();
310 void implicitClose();
311 void write ( const DOMString &text );
312 void write ( const QString &text );
313 void writeln ( const DOMString &text );
314 void finishParsing ( );
317 QString URL() const { return m_url; }
318 void setURL(const QString& url);
320 QString baseURL() const { return m_baseURL.isEmpty() ? m_url : m_baseURL; }
321 void setBaseURL(const QString& baseURL) { m_baseURL = baseURL; }
323 QString baseTarget() const { return m_baseTarget; }
324 void setBaseTarget(const QString& baseTarget) { m_baseTarget = baseTarget; }
327 QString completeURL(const QString &);
329 QString completeURL(const QString& url) { return KURL(baseURL(),url).url(); };
332 // from cachedObjectClient
333 virtual void setStyleSheet(const DOMString &url, const DOMString &sheetStr);
334 void setUserStyleSheet(const QString& sheet);
335 QString userStyleSheet() const { return m_usersheet; }
336 void setPrintStyleSheet(const QString& sheet) { m_printSheet = sheet; }
337 QString printStyleSheet() const { return m_printSheet; }
339 CSSStyleSheetImpl* elementSheet();
340 virtual khtml::Tokenizer *createTokenizer();
341 khtml::Tokenizer *tokenizer() { return m_tokenizer; }
343 QPaintDeviceMetrics *paintDeviceMetrics() { return m_paintDeviceMetrics; }
344 QPaintDevice *paintDevice() const { return m_paintDevice; }
345 void setPaintDevice( QPaintDevice *dev );
359 virtual void determineParseMode( const QString &str );
360 void setParseMode( ParseMode m ) { pMode = m; }
361 ParseMode parseMode() const { return pMode; }
363 bool inCompatMode() { return pMode == Compat; }
364 bool inAlmostStrictMode() { return pMode == AlmostStrict; }
365 bool inStrictMode() { return pMode == Strict; }
367 void setHTMLMode( HTMLMode m ) { hMode = m; }
368 HTMLMode htmlMode() const { return hMode; }
370 void setParsing(bool b);
371 bool parsing() const { return m_bParsing; }
372 int minimumLayoutDelay();
373 bool shouldScheduleLayout();
374 int elapsedTime() const;
376 void setTextColor( QColor color ) { m_textColor = color; }
377 QColor textColor() const { return m_textColor; }
379 const QColor& linkColor() const { return m_linkColor; }
380 const QColor& visitedLinkColor() const { return m_visitedLinkColor; }
381 const QColor& activeLinkColor() const { return m_activeLinkColor; }
382 void setLinkColor(const QColor& c) { m_linkColor = c; }
383 void setVisitedLinkColor(const QColor& c) { m_visitedLinkColor = c; }
384 void setActiveLinkColor(const QColor& c) { m_activeLinkColor = c; }
385 void resetLinkColor();
386 void resetVisitedLinkColor();
387 void resetActiveLinkColor();
390 NodeImpl *findElement( Id id );
392 bool prepareMouseEvent( bool readonly, int x, int y, MouseEvent *ev );
394 virtual bool childAllowed( NodeImpl *newChild );
395 virtual bool childTypeAllowed( unsigned short nodeType );
396 virtual NodeImpl *cloneNode ( bool deep );
398 // ### think about implementing ref'counting for the id's
399 // in order to be able to reassign those that are no longer in use
400 // (could make problems when it is still kept somewhere around, i.e. styleselector)
401 NodeImpl::Id tagId(DOMStringImpl* _namespaceURI, DOMStringImpl *_name, bool readonly);
402 DOMString tagName(NodeImpl::Id _id) const;
404 NodeImpl::Id attrId(DOMStringImpl* _namespaceURI, DOMStringImpl *_name, bool readonly);
405 DOMString attrName(NodeImpl::Id _id) const;
407 // the namespace uri is mapped to the same id for both
408 // tagnames as well as attributes.
409 DOMStringImpl* namespaceURI(NodeImpl::Id _id) const;
411 StyleSheetListImpl* styleSheets();
413 /* Newly proposed CSS3 mechanism for selecting alternate
414 stylesheets using the DOM. May be subject to change as
417 DOMString preferredStylesheetSet();
418 DOMString selectedStylesheetSet();
419 void setSelectedStylesheetSet(const DOMString& aString);
421 QStringList availableStyleSheets() const;
423 NodeImpl *focusNode() const { return m_focusNode; }
424 bool setFocusNode(NodeImpl *newFocusNode);
426 NodeImpl *hoverNode() const { return m_hoverNode; }
427 void setHoverNode(NodeImpl *newHoverNode);
429 // Updates for :target (CSS3 selector).
430 void setCSSTarget(NodeImpl* n);
431 NodeImpl* getCSSTarget();
433 void setDocumentChanged(bool);
435 void attachNodeIterator(NodeIteratorImpl *ni);
436 void detachNodeIterator(NodeIteratorImpl *ni);
437 void notifyBeforeNodeRemoval(NodeImpl *n);
438 AbstractViewImpl *defaultView() const;
439 EventImpl *createEvent(const DOMString &eventType, int &exceptioncode);
441 // keep track of what types of event listeners are registered, so we don't
442 // dispatch events unnecessarily
444 DOMSUBTREEMODIFIED_LISTENER = 0x01,
445 DOMNODEINSERTED_LISTENER = 0x02,
446 DOMNODEREMOVED_LISTENER = 0x04,
447 DOMNODEREMOVEDFROMDOCUMENT_LISTENER = 0x08,
448 DOMNODEINSERTEDINTODOCUMENT_LISTENER = 0x10,
449 DOMATTRMODIFIED_LISTENER = 0x20,
450 DOMCHARACTERDATAMODIFIED_LISTENER = 0x40
453 bool hasListenerType(ListenerType listenerType) const { return (m_listenerTypes & listenerType); }
454 void addListenerType(ListenerType listenerType) { m_listenerTypes = m_listenerTypes | listenerType; }
456 CSSStyleDeclarationImpl *getOverrideStyle(ElementImpl *elt, DOMStringImpl *pseudoElt);
458 typedef QMap<QString, ProcessingInstructionImpl*> LocalStyleRefs;
459 LocalStyleRefs* localStyleRefs() { return &m_localStyleRefs; }
461 virtual void defaultEventHandler(EventImpl *evt);
462 void setHTMLWindowEventListener(int id, EventListener *listener);
463 EventListener *getHTMLWindowEventListener(int id);
464 void removeHTMLWindowEventListener(int id);
466 void addWindowEventListener(int id, EventListener *listener, const bool useCapture);
467 void removeWindowEventListener(int id, EventListener *listener, bool useCapture);
468 bool hasWindowEventListener(int id);
470 EventListener *createHTMLEventListener(QString code, NodeImpl *node);
473 * Searches through the document, starting from fromNode, for the next selectable element that comes after fromNode.
474 * The order followed is as specified in section 17.11.1 of the HTML4 spec, which is elements with tab indexes
475 * first (from lowest to highest), and then elements without tab indexes (in document order).
477 * @param fromNode The node from which to start searching. The node after this will be focused. May be null.
479 * @return The focus node that comes after fromNode
481 * See http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1
483 NodeImpl *nextFocusNode(NodeImpl *fromNode);
486 * Searches through the document, starting from fromNode, for the previous selectable element (that comes _before_)
487 * fromNode. The order followed is as specified in section 17.11.1 of the HTML4 spec, which is elements with tab
488 * indexes first (from lowest to highest), and then elements without tab indexes (in document order).
490 * @param fromNode The node from which to start searching. The node before this will be focused. May be null.
492 * @return The focus node that comes before fromNode
494 * See http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1
496 NodeImpl *previousFocusNode(NodeImpl *fromNode);
498 int nodeAbsIndex(NodeImpl *node);
499 NodeImpl *nodeWithAbsIndex(int absIndex);
502 * Handles a HTTP header equivalent set by a meta tag using <meta http-equiv="..." content="...">. This is called
503 * when a meta tag is encountered during document parsing, and also when a script dynamically changes or adds a meta
504 * tag. This enables scripts to use meta tags to perform refreshes and set expiry dates in addition to them being
505 * specified in a HTML file.
507 * @param equiv The http header name (value of the meta tag's "equiv" attribute)
508 * @param content The header value (value of the meta tag's "content" attribute)
510 void processHttpEquiv(const DOMString &equiv, const DOMString &content);
512 void dispatchImageLoadEventSoon(HTMLImageLoader*);
513 void dispatchImageLoadEventsNow();
514 void removeImage(HTMLImageLoader*);
515 virtual void timerEvent(QTimerEvent *);
517 // Returns the owning element in the parent document.
518 // Returns 0 if this is the top level document.
519 ElementImpl *ownerElement();
521 DOMString domain() const;
522 void setDomain( const DOMString &newDomain, bool force = false ); // not part of the DOM
524 DOMString policyBaseURL() const { return m_policyBaseURL; }
525 void setPolicyBaseURL(const DOMString &s) { m_policyBaseURL = s; }
527 // The following implements the rule from HTML 4 for what valid names are.
528 // To get this right for all the XML cases, we probably have to improve this or move it
529 // and make it sensitive to the type of document.
530 static bool isValidName(const DOMString &);
532 void addElementById(const DOMString &elementId, ElementImpl *element);
533 void removeElementById(const DOMString &elementId, ElementImpl *element);
535 void addImageMap(HTMLMapElementImpl *);
536 void removeImageMap(HTMLMapElementImpl *);
537 HTMLMapElementImpl *getImageMap(const DOMString &URL) const;
539 HTMLElementImpl* body();
541 DOMString toString() const;
543 bool execCommand(const DOMString &command, bool userInterface, const DOMString &value);
544 bool queryCommandEnabled(const DOMString &command);
545 bool queryCommandIndeterm(const DOMString &command);
546 bool queryCommandState(const DOMString &command);
547 bool queryCommandSupported(const DOMString &command);
548 DOMString queryCommandValue(const DOMString &command);
550 void addMarker(Range range, DocumentMarker::MarkerType type);
551 void removeMarker(Range range, DocumentMarker::MarkerType type);
552 void addMarker(NodeImpl *node, DocumentMarker marker);
553 void removeMarker(NodeImpl *node, DocumentMarker marker);
554 void removeAllMarkers(NodeImpl *node, ulong startOffset, long length);
555 void removeAllMarkers(NodeImpl *node);
556 void removeAllMarkers();
557 void shiftMarkers(NodeImpl *node, ulong startOffset, long delta);
558 QValueList<DocumentMarker> markersForNode(NodeImpl *node);
569 void setDesignMode(InheritedBool value);
570 InheritedBool getDesignMode() const;
571 bool inDesignMode() const;
572 DocumentImpl *parentDocument() const;
573 DocumentImpl *topDocument() const;
575 int docID() const { return m_docID; }
578 void applyXSLTransform(ProcessingInstructionImpl* pi);
579 void setTransformSource(void* doc) { m_transformSource = doc; }
580 const void* transformSource() { return m_transformSource; }
581 DocumentImpl* transformSourceDocument() { return m_transformSourceDocument; }
582 void setTransformSourceDocument(DocumentImpl* doc);
587 XBL::XBLBindingManager* bindingManager() const { return m_bindingManager; }
590 void incDOMTreeVersion() { ++m_domtree_version; }
591 unsigned int domTreeVersion() const { return m_domtree_version; }
594 void finishedParsing();
597 khtml::CSSStyleSelector *m_styleSelector;
601 khtml::DocLoader *m_docLoader;
602 khtml::Tokenizer *m_tokenizer;
605 QString m_baseTarget;
607 DocumentTypeImpl *m_doctype;
608 DOMImplementationImpl *m_implementation;
610 StyleSheetImpl *m_sheet;
612 QString m_printSheet;
613 QStringList m_availableSheets;
615 // Track the number of currently loading top-level stylesheets. Sheets
616 // loaded using the @import directive are not included in this count.
617 // We use this count of pending sheets to detect when we can begin attaching
619 int m_pendingStylesheets;
621 // But sometimes you need to ignore pending stylesheet count to
622 // force an immediate layout when requested by JS.
623 bool m_ignorePendingStylesheets;
625 CSSStyleSheetImpl *m_elemSheet;
627 QPaintDevice *m_paintDevice;
628 QPaintDeviceMetrics *m_paintDeviceMetrics;
634 NodeImpl *m_focusNode;
635 NodeImpl *m_hoverNode;
637 unsigned int m_domtree_version;
639 // ### replace me with something more efficient
640 // in lookup and insertion.
641 DOMStringImpl **m_elementNames;
642 unsigned short m_elementNameAlloc;
643 unsigned short m_elementNameCount;
645 DOMStringImpl **m_attrNames;
646 unsigned short m_attrNameAlloc;
647 unsigned short m_attrNameCount;
649 DOMStringImpl** m_namespaceURIs;
650 unsigned short m_namespaceURIAlloc;
651 unsigned short m_namespaceURICount;
653 QPtrList<NodeIteratorImpl> m_nodeIterators;
654 AbstractViewImpl *m_defaultView;
656 unsigned short m_listenerTypes;
657 StyleSheetListImpl* m_styleSheets;
658 LocalStyleRefs m_localStyleRefs; // references to inlined style elements
659 QPtrList<RegisteredEventListener> m_windowEventListeners;
660 QPtrList<NodeImpl> m_maintainsState;
663 QColor m_visitedLinkColor;
664 QColor m_activeLinkColor;
666 DOMString m_preferredStylesheetSet;
669 bool visuallyOrdered;
671 bool m_bAllDataReceived;
673 bool m_styleSelectorDirty;
674 bool m_inStyleRecalc;
675 bool m_usesDescendantRules;
676 bool m_usesSiblingRules;
680 RenderArena* m_renderArena;
682 QPtrDict< QValueList<DocumentMarker> > m_markers;
685 KWQAccObjectCache* m_accCache;
688 QPtrList<HTMLImageLoader> m_imageLoadEventDispatchSoonList;
689 QPtrList<HTMLImageLoader> m_imageLoadEventDispatchingList;
690 int m_imageLoadEventTimer;
692 NodeImpl* m_cssTarget;
694 bool m_processingLoadEvent;
696 bool m_overMinimumLayoutThreshold;
699 void* m_transformSource;
700 DocumentImpl* m_transformSourceDocument;
704 XBL::XBLBindingManager* m_bindingManager; // The access point through which documents and elements communicate with XBL.
707 QMap<QString, HTMLMapElementImpl *> m_imageMapsByName;
709 DOMString m_policyBaseURL;
711 QPtrDict<NodeImpl> m_disconnectedNodesWithEventListeners;
713 int m_docID; // A unique document identifier used for things like document-specific mapped attributes.
717 KWQSignal m_finishedParsing;
719 static Document createInstance (DocumentImpl *impl);
722 void setInPageCache(bool flag);
723 void restoreRenderer(khtml::RenderObject* render);
725 void passwordFieldAdded();
726 void passwordFieldRemoved();
727 bool hasPasswordField() const;
729 void secureFormAdded();
730 void secureFormRemoved();
731 bool hasSecureForm() const;
733 void setShouldCreateRenderers(bool f);
734 bool shouldCreateRenderers();
736 void setDecoder(khtml::Decoder *);
737 khtml::Decoder *decoder() const { return m_decoder; }
739 void setDashboardRegionsDirty(bool f) { m_dashboardRegionsDirty = f; }
740 bool dashboardRegionsDirty() const { return m_dashboardRegionsDirty; }
741 bool hasDashboardRegions () const { return m_hasDashboardRegions; }
742 void setHasDashboardRegions (bool f) { m_hasDashboardRegions = f; }
743 const QValueList<khtml::DashboardRegionValue> & dashboardRegions() const;
744 void setDashboardRegions (const QValueList<khtml::DashboardRegionValue>& regions);
746 void removeAllEventListenersFromAllNodes();
748 void registerDisconnectedNodeWithEventListeners(NodeImpl *node);
749 void unregisterDisconnectedNodeWithEventListeners(NodeImpl *node);
752 void removeAllDisconnectedNodeEventListeners();
754 JSEditor *jsEditor();
756 JSEditor *m_jsEditor;
757 bool relinquishesEditingFocus(NodeImpl *node);
758 bool acceptsEditingFocus(NodeImpl *node);
760 mutable DOMString m_domain;
762 khtml::RenderObject *m_savedRenderer;
763 int m_passwordFields;
766 khtml::Decoder *m_decoder;
768 QDict<ElementImpl> m_elementsById;
770 QDict<ElementImpl> m_elementsByAccessKey;
771 bool m_accessKeyDictValid;
773 bool m_createRenderers;
775 InheritedBool m_designMode;
777 QValueList<khtml::DashboardRegionValue> m_dashboardRegions;
778 bool m_hasDashboardRegions;
779 bool m_dashboardRegionsDirty;
783 class DocumentFragmentImpl : public ContainerNodeImpl
786 DocumentFragmentImpl(DocumentPtr *doc);
788 // DOM methods overridden from parent classes
789 virtual DOMString nodeName() const;
790 virtual unsigned short nodeType() const;
791 virtual NodeImpl *cloneNode ( bool deep );
793 // Other methods (not part of DOM)
794 virtual bool childTypeAllowed( unsigned short type );
796 virtual DOMString toString() const;
800 class DocumentTypeImpl : public NodeImpl
803 DocumentTypeImpl(DOMImplementationImpl *_implementation, DocumentPtr *doc,
804 const DOMString &qualifiedName, const DOMString &publicId,
805 const DOMString &systemId);
808 // DOM methods & attributes for DocumentType
809 NamedNodeMapImpl *entities() const { return m_entities; }
810 NamedNodeMapImpl *notations() const { return m_notations; }
812 DOMString name() const { return m_qualifiedName; }
813 DOMString publicId() const { return m_publicId; }
814 DOMString systemId() const { return m_systemId; }
815 DOMString internalSubset() const { return m_subset; }
817 // DOM methods overridden from parent classes
818 virtual DOMString nodeName() const;
819 virtual unsigned short nodeType() const;
820 virtual bool childTypeAllowed( unsigned short type );
821 virtual NodeImpl *cloneNode ( bool deep );
823 // Other methods (not part of DOM)
824 void setName(const DOMString& n) { m_qualifiedName = n; }
825 void setPublicId(const DOMString& publicId) { m_publicId = publicId; }
826 void setSystemId(const DOMString& systemId) { m_systemId = systemId; }
827 DOMImplementationImpl *implementation() const { return m_implementation; }
828 void copyFrom(const DocumentTypeImpl&);
830 virtual DOMString toString() const;
833 static DocumentType createInstance (DocumentTypeImpl *impl);
837 DOMImplementationImpl *m_implementation;
838 NamedNodeMapImpl* m_entities;
839 NamedNodeMapImpl* m_notations;
841 DOMString m_qualifiedName;
842 DOMString m_publicId;
843 DOMString m_systemId;