summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/Document.h
diff options
context:
space:
mode:
authorAndrei Popescu <andreip@google.com>2009-08-19 14:09:30 +0100
committerAndrei Popescu <andreip@google.com>2009-08-19 14:09:30 +0100
commit058ccc7ba0a4d59b9f6e92808332aa9895425fc7 (patch)
tree276aad5a2bbc2fd7d65d21bfca42c9de88b3dd20 /WebCore/dom/Document.h
parent2796dd1bf3b4b01e7e1d96ea91bd3a212f647579 (diff)
downloadexternal_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.zip
external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.gz
external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.bz2
Revert "Merge WebKit r47420"
This reverts commit d227fc870c7a697500a3c900c31baf05fb9a8524.
Diffstat (limited to 'WebCore/dom/Document.h')
-rw-r--r--WebCore/dom/Document.h233
1 files changed, 122 insertions, 111 deletions
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index c18a864..fc4dc7e 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -172,16 +172,19 @@ class Document : public ContainerNode, public ScriptExecutionContext {
public:
static PassRefPtr<Document> create(Frame* frame)
{
- return adoptRef(new Document(frame, false));
+ return new Document(frame, false);
}
static PassRefPtr<Document> createXHTML(Frame* frame)
{
- return adoptRef(new Document(frame, true));
+ return 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,6 +214,7 @@ public:
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
{
@@ -295,6 +299,11 @@ 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; }
@@ -446,6 +455,9 @@ public:
virtual String userAgent(const KURL&) const;
+ // from cachedObjectClient
+ virtual void setCSSStyleSheet(const String& url, const String& charset, const CachedCSSStyleSheet*);
+
#if FRAME_LOADS_USER_STYLESHEET
void setUserStyleSheet(const String& sheet);
#endif
@@ -462,6 +474,10 @@ public:
enum ParseMode { Compat, AlmostStrict, Strict };
+private:
+ virtual void determineParseMode() {}
+
+public:
void setParseMode(ParseMode m) { m_parseMode = m; }
ParseMode parseMode() const { return m_parseMode; }
@@ -490,6 +506,11 @@ 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
@@ -730,6 +751,8 @@ public:
void setDocType(PassRefPtr<DocumentType>);
+ virtual void finishedParsing();
+
#if ENABLE(XPATH)
// XPathEvaluator methods
PassRefPtr<XPathExpression> createExpression(const String& expression,
@@ -776,6 +799,7 @@ public:
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);
@@ -784,95 +808,10 @@ public:
virtual void scriptImported(unsigned long, const String&);
virtual void postTask(PassRefPtr<Task>); // Executes the task on context's thread asynchronously.
- typedef HashMap<WebCore::Node*, JSNode*> JSWrapperCache;
- JSWrapperCache& wrapperCache() { return m_wrapperCache; }
-
- 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
-
- 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:
Document(Frame*, bool isXHTML);
- void setStyleSelector(CSSStyleSelector* styleSelector) { m_styleSelector = styleSelector; }
-
- void clearXMLVersion() { m_xmlVersion = String(); }
+ void setStyleSelector(CSSStyleSelector* styleSelector) { m_styleSelector = styleSelector; }
#if ENABLE(TOUCH_EVENTS) // Android
public:
@@ -887,38 +826,16 @@ 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 void setCSSStyleSheet(const String& url, const String& charset, const CachedCSSStyleSheet*);
- 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 removeAllDisconnectedNodeEventListeners();
- void updateFocusAppearanceTimerFired(Timer<Document>*);
- void updateBaseURL();
-
- void cacheDocumentElement() const;
-
CSSStyleSelector* m_styleSelector;
bool m_didCalculateStyleSelector;
@@ -1071,6 +988,96 @@ 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;
@@ -1124,6 +1131,10 @@ private:
unsigned m_numNodeListCaches;
+public:
+ typedef HashMap<WebCore::Node*, JSNode*> JSWrapperCache;
+ JSWrapperCache& wrapperCache() { return m_wrapperCache; }
+private:
JSWrapperCache m_wrapperCache;
#if ENABLE(DATABASE)
@@ -1152,7 +1163,7 @@ inline bool Document::hasElementWithId(AtomicStringImpl* id) const
inline bool Node::isDocumentNode() const
{
- return this == m_document;
+ return this == m_document.get();
}
} // namespace WebCore