summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/Document.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/dom/Document.h')
-rw-r--r--WebCore/dom/Document.h408
1 files changed, 229 insertions, 179 deletions
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index fc4dc7e..f2125b1 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -36,15 +36,8 @@
#include "ScriptExecutionContext.h"
#include "Timer.h"
#include <wtf/HashCountedSet.h>
-
-// FIXME: We should move Mac off of the old Frame-based user stylesheet loading
-// code and onto the new code in Page. We can't do that until the code in Page
-// supports non-file: URLs, however.
-#if PLATFORM(MAC) || PLATFORM(QT)
-#define FRAME_LOADS_USER_STYLESHEET 1
-#else
-#define FRAME_LOADS_USER_STYLESHEET 0
-#endif
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -53,7 +46,7 @@ namespace WebCore {
class CDATASection;
class CachedCSSStyleSheet;
class CachedScript;
- class CanvasRenderingContext2D;
+ class CanvasRenderingContext;
class CharacterData;
class CSSStyleDeclaration;
class CSSStyleSelector;
@@ -74,16 +67,20 @@ namespace WebCore {
class EventListener;
class Frame;
class FrameView;
- class HitTestRequest;
class HTMLCanvasElement;
class HTMLCollection;
+ class HTMLAllCollection;
class HTMLDocument;
class HTMLElement;
class HTMLFormElement;
class HTMLHeadElement;
class HTMLInputElement;
class HTMLMapElement;
+ class HistoryItem;
+ class HitTestRequest;
+ class InspectorTimelineAgent;
class IntPoint;
+ class DOMWrapperWorld;
class JSNode;
class MouseEventWithHitTestResults;
class NodeFilter;
@@ -97,6 +94,7 @@ namespace WebCore {
class RenderView;
class ScriptElementData;
class SecurityOrigin;
+ class SerializedScriptValue;
class SegmentedString;
class Settings;
class StyleSheet;
@@ -111,6 +109,10 @@ namespace WebCore {
class SVGDocumentExtensions;
#endif
+#if ENABLE(XSLT)
+ class TransformSource;
+#endif
+
#if ENABLE(XBL)
class XBLBindingManager;
#endif
@@ -172,19 +174,16 @@ class Document : public ContainerNode, public ScriptExecutionContext {
public:
static PassRefPtr<Document> create(Frame* frame)
{
- return new Document(frame, false);
+ return adoptRef(new Document(frame, false));
}
static PassRefPtr<Document> createXHTML(Frame* frame)
{
- return new Document(frame, true);
+ return adoptRef(new Document(frame, true));
}
virtual ~Document();
- virtual bool isDocument() const { return true; }
-
using ContainerNode::ref;
using ContainerNode::deref;
- virtual void removedLastRef();
// Nodes belonging to this document hold "self-only" references -
// these are enough to keep the document from being destroyed, but
@@ -211,10 +210,52 @@ public:
// DOM methods & attributes for Document
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(abort);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(click);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(contextmenu);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(dblclick);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(dragenter);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(dragover);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(dragleave);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(drop);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(dragstart);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(drag);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(dragend);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(input);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(invalid);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(keydown);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(keypress);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(keyup);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(mousedown);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(mousemove);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(mouseout);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(mouseover);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(mouseup);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(mousewheel);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(scroll);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(select);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(submit);
+
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(blur);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(focus);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(load);
+
+ // WebKit extensions
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(cut);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(copy);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(paste);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(reset);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(search);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(selectstart);
+
DocumentType* doctype() const { return m_docType.get(); }
DOMImplementation* implementation() const;
- virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
Element* documentElement() const
{
@@ -240,6 +281,8 @@ public:
bool containsMultipleElementsWithId(const AtomicString& elementId) { return m_duplicateIds.contains(elementId.impl()); }
Element* elementFromPoint(int x, int y) const;
+ PassRefPtr<Range> caretRangeFromPoint(int x, int y);
+
String readyState() const;
String defaultCharset() const;
@@ -276,12 +319,13 @@ public:
PassRefPtr<HTMLCollection> links();
PassRefPtr<HTMLCollection> forms();
PassRefPtr<HTMLCollection> anchors();
- PassRefPtr<HTMLCollection> all();
PassRefPtr<HTMLCollection> objects();
PassRefPtr<HTMLCollection> scripts();
PassRefPtr<HTMLCollection> windowNamedItems(const String& name);
PassRefPtr<HTMLCollection> documentNamedItems(const String& name);
+ PassRefPtr<HTMLAllCollection> all();
+
// Find first anchor with the given name.
// First searches for an element with the given ID, but if that fails, then looks
// for an anchor with the given name. ID matching is always case sensitive, but
@@ -299,11 +343,6 @@ public:
CollectionCache* nameCollectionInfo(CollectionType, const AtomicString& name);
- // DOM methods overridden from parent classes
-
- virtual String nodeName() const;
- virtual NodeType nodeType() const;
-
// Other methods (not part of DOM)
virtual bool isHTMLDocument() const { return false; }
virtual bool isImageDocument() const { return false; }
@@ -392,6 +431,9 @@ public:
Frame* frame() const { return m_frame; } // can be NULL
Page* page() const; // can be NULL
Settings* settings() const; // can be NULL
+#if ENABLE(INSPECTOR)
+ InspectorTimelineAgent* inspectorTimelineAgent() const; // can be NULL
+#endif
PassRefPtr<Range> createRange();
@@ -411,12 +453,12 @@ public:
void updateLayout();
void updateLayoutIgnorePendingStylesheets();
static void updateStyleForAllDocuments(); // FIXME: Try to reduce the # of calls to this function.
- DocLoader* docLoader() { return m_docLoader; }
+ DocLoader* docLoader() { return m_docLoader.get(); }
virtual void attach();
virtual void detach();
- RenderArena* renderArena() { return m_renderArena; }
+ RenderArena* renderArena() { return m_renderArena.get(); }
RenderView* renderView() const;
@@ -436,7 +478,6 @@ public:
void write(const String& text, Document* ownerDocument = 0);
void writeln(const String& text, Document* ownerDocument = 0);
void finishParsing();
- void clear();
bool wellFormed() const { return m_wellFormed; }
@@ -455,29 +496,23 @@ public:
virtual String userAgent(const KURL&) const;
- // from cachedObjectClient
- virtual void setCSSStyleSheet(const String& url, const String& charset, const CachedCSSStyleSheet*);
+ CSSStyleSheet* pageUserSheet();
+ void clearPageUserSheet();
-#if FRAME_LOADS_USER_STYLESHEET
- void setUserStyleSheet(const String& sheet);
-#endif
-
- String userStyleSheet() const;
+ const Vector<RefPtr<CSSStyleSheet> >* pageGroupUserSheets() const;
+ void clearPageGroupUserSheets();
CSSStyleSheet* elementSheet();
CSSStyleSheet* mappedElementSheet();
+
virtual Tokenizer* createTokenizer();
- Tokenizer* tokenizer() { return m_tokenizer; }
+ Tokenizer* tokenizer() { return m_tokenizer.get(); }
bool printing() const { return m_printing; }
void setPrinting(bool p) { m_printing = p; }
enum ParseMode { Compat, AlmostStrict, Strict };
-private:
- virtual void determineParseMode() {}
-
-public:
void setParseMode(ParseMode m) { m_parseMode = m; }
ParseMode parseMode() const { return m_parseMode; }
@@ -488,6 +523,10 @@ public:
void setParsing(bool);
bool parsing() const { return m_bParsing; }
int minimumLayoutDelay();
+
+ // This method is used by Android.
+ void setExtraLayoutDelay(int delay) { m_extraLayoutDelay = delay; }
+
bool shouldScheduleLayout();
int elapsedTime() const;
@@ -506,11 +545,6 @@ public:
MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const IntPoint&, const PlatformMouseEvent&);
- virtual bool childTypeAllowed(NodeType);
- virtual PassRefPtr<Node> cloneNode(bool deep);
-
- virtual bool canReplaceChild(Node* newChild, Node* oldChild);
-
StyleSheetList* styleSheets();
/* Newly proposed CSS3 mechanism for selecting alternate
@@ -570,9 +604,8 @@ public:
// Helper functions for forwarding DOMWindow event related tasks to the DOMWindow if it exists.
void setWindowAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener>);
EventListener* getWindowAttributeEventListener(const AtomicString& eventType);
- void dispatchWindowEvent(PassRefPtr<Event>);
- void dispatchWindowEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg);
- void dispatchLoadEvent();
+ void dispatchWindowEvent(PassRefPtr<Event>, PassRefPtr<EventTarget> = 0);
+ void dispatchWindowLoadEvent();
PassRefPtr<Event> createEvent(const String& eventType, ExceptionCode&);
@@ -590,7 +623,8 @@ public:
ANIMATIONEND_LISTENER = 0x100,
ANIMATIONSTART_LISTENER = 0x200,
ANIMATIONITERATION_LISTENER = 0x400,
- TRANSITIONEND_LISTENER = 0x800
+ TRANSITIONEND_LISTENER = 0x800,
+ BEFORELOAD_LISTENER = 0x1000
};
bool hasListenerType(ListenerType listenerType) const { return (m_listenerTypes & listenerType); }
@@ -655,13 +689,13 @@ public:
void setTitle(const String&, Element* titleElement = 0);
void removeTitle(Element* titleElement);
- String cookie() const;
- void setCookie(const String&);
+ String cookie(ExceptionCode&) const;
+ void setCookie(const String&, ExceptionCode&);
String referrer() const;
String domain() const;
- void setDomain(const String& newDomain);
+ void setDomain(const String& newDomain, ExceptionCode&);
String lastModified() const;
@@ -710,7 +744,7 @@ public:
void removeMarkers(DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void removeMarkers(Node*);
void repaintMarkers(DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
- void setRenderedRectForMarker(Node*, DocumentMarker, const IntRect&);
+ void setRenderedRectForMarker(Node*, const DocumentMarker&, const IntRect&);
void invalidateRenderedRectsForMarkersInRect(const IntRect&);
void shiftMarkers(Node*, unsigned startOffset, int delta, DocumentMarker::MarkerType = DocumentMarker::AllMarkers);
void setMarkersActive(Range*, bool);
@@ -735,15 +769,16 @@ public:
#if ENABLE(XSLT)
void applyXSLTransform(ProcessingInstruction* pi);
- void setTransformSource(void* doc);
- const void* transformSource() { return m_transformSource; }
PassRefPtr<Document> transformSourceDocument() { return m_transformSourceDocument; }
void setTransformSourceDocument(Document* doc) { m_transformSourceDocument = doc; }
+
+ void setTransformSource(PassOwnPtr<TransformSource>);
+ TransformSource* transformSource() const { return m_transformSource.get(); }
#endif
#if ENABLE(XBL)
// XBL methods
- XBLBindingManager* bindingManager() const { return m_bindingManager; }
+ XBLBindingManager* bindingManager() const { return m_bindingManager.get(); }
#endif
void incDOMTreeVersion() { ++m_domtree_version; }
@@ -751,8 +786,6 @@ public:
void setDocType(PassRefPtr<DocumentType>);
- virtual void finishedParsing();
-
#if ENABLE(XPATH)
// XPathEvaluator methods
PassRefPtr<XPathExpression> createExpression(const String& expression,
@@ -785,33 +818,124 @@ public:
void updateFocusAppearanceSoon();
void cancelFocusAppearanceUpdate();
-
-#ifdef ANDROID_MOBILE
- void setExtraLayoutDelay(int delay) { mExtraLayoutDelay = delay; }
- int extraLayoutDelay() { return mExtraLayoutDelay; }
-#endif
-
+
// FF method for accessing the selection added for compatability.
DOMSelection* getSelection() const;
// Extension for manipulating canvas drawing contexts for use in CSS
- CanvasRenderingContext2D* getCSSCanvasContext(const String& type, const String& name, int width, int height);
+ CanvasRenderingContext* getCSSCanvasContext(const String& type, const String& name, int width, int height);
HTMLCanvasElement* getCSSCanvasElement(const String& name);
bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; }
- void initDNSPrefetch();
void parseDNSPrefetchControlHeader(const String&);
virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL);
virtual void addMessage(MessageDestination, MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
virtual void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString);
virtual void scriptImported(unsigned long, const String&);
- virtual void postTask(PassRefPtr<Task>); // Executes the task on context's thread asynchronously.
+ virtual void postTask(PassOwnPtr<Task>); // Executes the task on context's thread asynchronously.
+
+ typedef HashMap<WebCore::Node*, JSNode*> JSWrapperCache;
+ typedef HashMap<DOMWrapperWorld*, JSWrapperCache*> JSWrapperCacheMap;
+ JSWrapperCacheMap& wrapperCacheMap() { return m_wrapperCacheMap; }
+ JSWrapperCache* getWrapperCache(DOMWrapperWorld* world)
+ {
+ if (JSWrapperCache* wrapperCache = m_wrapperCacheMap.get(world))
+ return wrapperCache;
+ return createWrapperCache(world);
+ }
+ JSWrapperCache* createWrapperCache(DOMWrapperWorld*);
+
+ virtual void finishedParsing();
+
+ bool inPageCache() const { return m_inPageCache; }
+ void setInPageCache(bool flag);
+
+ // Elements can register themselves for the "documentWillBecomeInactive()" and
+ // "documentDidBecomeActive()" callbacks
+ void registerForDocumentActivationCallbacks(Element*);
+ void unregisterForDocumentActivationCallbacks(Element*);
+ void documentWillBecomeInactive();
+ void documentDidBecomeActive();
+
+ void registerForMediaVolumeCallbacks(Element*);
+ void unregisterForMediaVolumeCallbacks(Element*);
+ void mediaVolumeDidChange();
+
+ void setShouldCreateRenderers(bool);
+ bool shouldCreateRenderers();
+
+ void setDecoder(PassRefPtr<TextResourceDecoder>);
+ TextResourceDecoder* decoder() const { return m_decoder.get(); }
+
+ String displayStringModifiedByEncoding(const String&) const;
+ PassRefPtr<StringImpl> displayStringModifiedByEncoding(PassRefPtr<StringImpl>) const;
+ void displayBufferModifiedByEncoding(UChar* buffer, unsigned len) const;
+
+ // Quirk for the benefit of Apple's Dictionary application.
+ void setFrameElementsShouldIgnoreScrolling(bool ignore) { m_frameElementsShouldIgnoreScrolling = ignore; }
+ bool frameElementsShouldIgnoreScrolling() const { return m_frameElementsShouldIgnoreScrolling; }
+
+#if ENABLE(DASHBOARD_SUPPORT)
+ void setDashboardRegionsDirty(bool f) { m_dashboardRegionsDirty = f; }
+ bool dashboardRegionsDirty() const { return m_dashboardRegionsDirty; }
+ bool hasDashboardRegions () const { return m_hasDashboardRegions; }
+ void setHasDashboardRegions(bool f) { m_hasDashboardRegions = f; }
+ const Vector<DashboardRegionValue>& dashboardRegions() const;
+ void setDashboardRegions(const Vector<DashboardRegionValue>&);
+#endif
+
+ virtual void removeAllEventListeners();
+
+ CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; }
+
+#if ENABLE(SVG)
+ const SVGDocumentExtensions* svgExtensions();
+ SVGDocumentExtensions* accessSVGExtensions();
+#endif
+
+ void initSecurityContext();
+
+ // Explicitly override the security origin for this document.
+ // Note: It is dangerous to change the security origin of a document
+ // that already contains content.
+ void setSecurityOrigin(SecurityOrigin*);
+
+ void updateURLForPushOrReplaceState(const KURL&);
+ void statePopped(SerializedScriptValue*);
+ void registerHistoryItem(HistoryItem* item);
+ void unregisterHistoryItem(HistoryItem* item);
+
+ void updateSandboxFlags(); // Set sandbox flags as determined by the frame.
+
+ bool processingLoadEvent() const { return m_processingLoadEvent; }
+
+#if ENABLE(DATABASE)
+ void addOpenDatabase(Database*);
+ void removeOpenDatabase(Database*);
+ DatabaseThread* databaseThread(); // Creates the thread as needed, but not if it has been already terminated.
+ void setHasOpenDatabases() { m_hasOpenDatabases = true; }
+ bool hasOpenDatabases() { return m_hasOpenDatabases; }
+ void stopDatabases();
+#endif
+
+ void setUsingGeolocation(bool f) { m_usingGeolocation = f; }
+ bool usingGeolocation() const { return m_usingGeolocation; };
+
+#if ENABLE(WML)
+ void setContainsWMLContent(bool value) { m_containsWMLContent = value; }
+ bool containsWMLContent() const { return m_containsWMLContent; }
+
+ void resetWMLPageState();
+ void initializeWMLPageState();
+#endif
protected:
Document(Frame*, bool isXHTML);
- void setStyleSelector(CSSStyleSelector* styleSelector) { m_styleSelector = styleSelector; }
+ void setStyleSelector(CSSStyleSelector* styleSelector) { m_styleSelector = styleSelector; }
+
+ void clearXMLVersion() { m_xmlVersion = String(); }
#if ENABLE(TOUCH_EVENTS) // Android
public:
@@ -826,22 +950,42 @@ private:
#endif // ENABLE(TOUCH_EVENTS)
private:
+ virtual bool isDocument() const { return true; }
+ virtual void removedLastRef();
+ virtual void determineParseMode() { }
+
+ virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
+
+ virtual String nodeName() const;
+ virtual NodeType nodeType() const;
+ virtual bool childTypeAllowed(NodeType);
+ virtual PassRefPtr<Node> cloneNode(bool deep);
+ virtual bool canReplaceChild(Node* newChild, Node* oldChild);
+
virtual void refScriptExecutionContext() { ref(); }
virtual void derefScriptExecutionContext() { deref(); }
virtual const KURL& virtualURL() const; // Same as url(), but needed for ScriptExecutionContext to implement it without a performance loss for direct calls.
virtual KURL virtualCompleteURL(const String&) const; // Same as completeURL() for the same reason as above.
+ void initDNSPrefetch();
+
String encoding() const;
void executeScriptSoonTimerFired(Timer<Document>*);
+ void updateTitle();
+ void updateFocusAppearanceTimerFired(Timer<Document>*);
+ void updateBaseURL();
+
+ void cacheDocumentElement() const;
+
CSSStyleSelector* m_styleSelector;
bool m_didCalculateStyleSelector;
Frame* m_frame;
- DocLoader* m_docLoader;
- Tokenizer* m_tokenizer;
+ OwnPtr<DocLoader> m_docLoader;
+ OwnPtr<Tokenizer> m_tokenizer;
bool m_wellFormed;
// Document URLs.
@@ -863,11 +1007,6 @@ private:
RefPtr<DocumentType> m_docType;
mutable RefPtr<DOMImplementation> m_implementation;
- RefPtr<StyleSheet> m_sheet;
-#if FRAME_LOADS_USER_STYLESHEET
- String m_usersheet;
-#endif
-
// Track the number of currently loading top-level stylesheets. Sheets
// loaded using the @import directive are not included in this count.
// We use this count of pending sheets to detect when we can begin attaching
@@ -887,6 +1026,9 @@ private:
RefPtr<CSSStyleSheet> m_elemSheet;
RefPtr<CSSStyleSheet> m_mappedElementSheet;
+ RefPtr<CSSStyleSheet> m_pageUserSheet;
+ mutable OwnPtr<Vector<RefPtr<CSSStyleSheet> > > m_pageGroupUserSheets;
+ mutable bool m_pageGroupUserSheetCacheValid;
bool m_printing;
@@ -942,40 +1084,46 @@ private:
String m_title;
bool m_titleSetExplicitly;
RefPtr<Element> m_titleElement;
-
- RenderArena* m_renderArena;
+
+ OwnPtr<RenderArena> m_renderArena;
typedef std::pair<Vector<DocumentMarker>, Vector<IntRect> > MarkerMapVectorPair;
typedef HashMap<RefPtr<Node>, MarkerMapVectorPair*> MarkerMap;
MarkerMap m_markers;
+
#if !PLATFORM(ANDROID)
mutable AXObjectCache* m_axObjectCache;
#endif
+
Timer<Document> m_updateFocusAppearanceTimer;
Element* m_cssTarget;
bool m_processingLoadEvent;
+ RefPtr<SerializedScriptValue> m_pendingStateObject;
+ HashSet<RefPtr<HistoryItem> > m_associatedHistoryItems;
double m_startTime;
bool m_overMinimumLayoutThreshold;
+ // This is used to increase the minimum delay between re-layouts. It is set
+ // using setExtraLayoutDelay to modify the minimum delay used at different
+ // points during the lifetime of the Document.
+ int m_extraLayoutDelay;
Vector<std::pair<ScriptElementData*, CachedResourceHandle<CachedScript> > > m_scriptsToExecuteSoon;
Timer<Document> m_executeScriptSoonTimer;
#if ENABLE(XSLT)
- void* m_transformSource;
+ OwnPtr<TransformSource> m_transformSource;
RefPtr<Document> m_transformSourceDocument;
#endif
#if ENABLE(XBL)
- XBLBindingManager* m_bindingManager; // The access point through which documents and elements communicate with XBL.
+ OwnPtr<XBLBindingManager> m_bindingManager; // The access point through which documents and elements communicate with XBL.
#endif
typedef HashMap<AtomicStringImpl*, HTMLMapElement*> ImageMapsByName;
ImageMapsByName m_imageMapsByName;
- HashSet<Node*> m_disconnectedNodesWithEventListeners;
-
int m_docID; // A unique document identifier used for things like document-specific mapped attributes.
String m_xmlEncoding;
@@ -988,96 +1136,6 @@ private:
bool m_shouldProcessNoScriptElement;
#endif
-public:
- bool inPageCache() const { return m_inPageCache; }
- void setInPageCache(bool flag);
-
- // Elements can register themselves for the "documentWillBecomeInactive()" and
- // "documentDidBecomeActive()" callbacks
- void registerForDocumentActivationCallbacks(Element*);
- void unregisterForDocumentActivationCallbacks(Element*);
- void documentWillBecomeInactive();
- void documentDidBecomeActive();
-
- void registerForMediaVolumeCallbacks(Element*);
- void unregisterForMediaVolumeCallbacks(Element*);
- void mediaVolumeDidChange();
-
- void setShouldCreateRenderers(bool);
- bool shouldCreateRenderers();
-
- void setDecoder(PassRefPtr<TextResourceDecoder>);
- TextResourceDecoder* decoder() const { return m_decoder.get(); }
-
- String displayStringModifiedByEncoding(const String&) const;
- PassRefPtr<StringImpl> displayStringModifiedByEncoding(PassRefPtr<StringImpl>) const;
- void displayBufferModifiedByEncoding(UChar* buffer, unsigned len) const;
-
- // Quirk for the benefit of Apple's Dictionary application.
- void setFrameElementsShouldIgnoreScrolling(bool ignore) { m_frameElementsShouldIgnoreScrolling = ignore; }
- bool frameElementsShouldIgnoreScrolling() const { return m_frameElementsShouldIgnoreScrolling; }
-
-#if ENABLE(DASHBOARD_SUPPORT)
- void setDashboardRegionsDirty(bool f) { m_dashboardRegionsDirty = f; }
- bool dashboardRegionsDirty() const { return m_dashboardRegionsDirty; }
- bool hasDashboardRegions () const { return m_hasDashboardRegions; }
- void setHasDashboardRegions(bool f) { m_hasDashboardRegions = f; }
- const Vector<DashboardRegionValue>& dashboardRegions() const;
- void setDashboardRegions(const Vector<DashboardRegionValue>&);
-#endif
-
- void removeAllEventListeners();
-
- void registerDisconnectedNodeWithEventListeners(Node*);
- void unregisterDisconnectedNodeWithEventListeners(Node*);
-
- CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; }
-
-#if ENABLE(SVG)
- const SVGDocumentExtensions* svgExtensions();
- SVGDocumentExtensions* accessSVGExtensions();
-#endif
-
- void initSecurityContext();
-
- // Explicitly override the security origin for this document.
- // Note: It is dangerous to change the security origin of a document
- // that already contains content.
- void setSecurityOrigin(SecurityOrigin*);
-
- bool processingLoadEvent() const { return m_processingLoadEvent; }
-
-#if ENABLE(DATABASE)
- void addOpenDatabase(Database*);
- void removeOpenDatabase(Database*);
- DatabaseThread* databaseThread(); // Creates the thread as needed, but not if it has been already terminated.
- void setHasOpenDatabases() { m_hasOpenDatabases = true; }
- bool hasOpenDatabases() { return m_hasOpenDatabases; }
- void stopDatabases();
-#endif
-
- void setUsingGeolocation(bool f) { m_usingGeolocation = f; }
- bool usingGeolocation() const { return m_usingGeolocation; };
-
-#if ENABLE(WML)
- void setContainsWMLContent(bool value) { m_containsWMLContent = value; }
- bool containsWMLContent() const { return m_containsWMLContent; }
-
- void resetWMLPageState();
- void initializeWMLPageState();
-#endif
-
-protected:
- void clearXMLVersion() { m_xmlVersion = String(); }
-
-private:
- void updateTitle();
- void removeAllDisconnectedNodeEventListeners();
- void updateFocusAppearanceTimerFired(Timer<Document>*);
- void updateBaseURL();
-
- void cacheDocumentElement() const;
-
RenderObject* m_savedRenderer;
int m_secureForms;
@@ -1131,11 +1189,7 @@ private:
unsigned m_numNodeListCaches;
-public:
- typedef HashMap<WebCore::Node*, JSNode*> JSWrapperCache;
- JSWrapperCache& wrapperCache() { return m_wrapperCache; }
-private:
- JSWrapperCache m_wrapperCache;
+ JSWrapperCacheMap m_wrapperCacheMap;
#if ENABLE(DATABASE)
RefPtr<DatabaseThread> m_databaseThread;
@@ -1146,10 +1200,6 @@ private:
bool m_usingGeolocation;
-#ifdef ANDROID_MOBILE
- int mExtraLayoutDelay;
-#endif
-
#if ENABLE(WML)
bool m_containsWMLContent;
#endif
@@ -1163,7 +1213,7 @@ inline bool Document::hasElementWithId(AtomicStringImpl* id) const
inline bool Node::isDocumentNode() const
{
- return this == m_document.get();
+ return this == m_document;
}
} // namespace WebCore