diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
commit | 49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch) | |
tree | 5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebCore/dom/Document.h | |
parent | b211c645d8ab690f713515dfdc84d80b11c27d2c (diff) | |
download | qtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz |
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebCore/dom/Document.h')
-rw-r--r-- | Source/WebCore/dom/Document.h | 116 |
1 files changed, 47 insertions, 69 deletions
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h index da5abca0b..ab9205a89 100644 --- a/Source/WebCore/dom/Document.h +++ b/Source/WebCore/dom/Document.h @@ -28,7 +28,6 @@ #ifndef Document_h #define Document_h -#include "CheckedRadioButtons.h" #include "CollectionType.h" #include "Color.h" #include "ContainerNode.h" @@ -68,6 +67,7 @@ class CachedScript; class CanvasRenderingContext; class CharacterData; class Comment; +class ContextFeatures; class DOMImplementation; class DOMSelection; class DOMWindow; @@ -76,6 +76,7 @@ class DatabaseThread; class DocumentFragment; class DocumentLoader; class DocumentMarkerController; +class DocumentParser; class DocumentType; class DocumentWeakReference; class EditingText; @@ -83,8 +84,10 @@ class Element; class EntityReference; class Event; class EventListener; +class FloatRect; +class FloatQuad; class FontData; -class FormAssociatedElement; +class FormController; class Frame; class FrameView; class HTMLCanvasElement; @@ -92,11 +95,8 @@ class HTMLCollection; class HTMLAllCollection; class HTMLDocument; class HTMLElement; -class HTMLFormControlElementWithState; -class HTMLFormElement; class HTMLFrameOwnerElement; class HTMLHeadElement; -class HTMLInputElement; class HTMLIFrameElement; class HTMLMapElement; class HTMLNameCollection; @@ -123,6 +123,7 @@ class ScriptableDocumentParser; class ScriptElementData; class ScriptRunner; class SecurityOrigin; +class SelectorQueryCache; class SerializedScriptValue; class SegmentedString; class Settings; @@ -132,8 +133,8 @@ class StyleSheetContents; class StyleSheetList; class Text; class TextResourceDecoder; -class DocumentParser; class TreeWalker; +class UndoManager; class WebKitNamedFlow; class XMLHttpRequest; class XPathEvaluator; @@ -173,46 +174,6 @@ class Prerenderer; typedef int ExceptionCode; -class FormElementKey { -public: - FormElementKey(AtomicStringImpl* = 0, AtomicStringImpl* = 0); - ~FormElementKey(); - FormElementKey(const FormElementKey&); - FormElementKey& operator=(const FormElementKey&); - - AtomicStringImpl* name() const { return m_name; } - AtomicStringImpl* type() const { return m_type; } - - // Hash table deleted values, which are only constructed and never copied or destroyed. - FormElementKey(WTF::HashTableDeletedValueType) : m_name(hashTableDeletedValue()) { } - bool isHashTableDeletedValue() const { return m_name == hashTableDeletedValue(); } - -private: - void ref() const; - void deref() const; - - static AtomicStringImpl* hashTableDeletedValue() { return reinterpret_cast<AtomicStringImpl*>(-1); } - - AtomicStringImpl* m_name; - AtomicStringImpl* m_type; -}; - -inline bool operator==(const FormElementKey& a, const FormElementKey& b) -{ - return a.name() == b.name() && a.type() == b.type(); -} - -struct FormElementKeyHash { - static unsigned hash(const FormElementKey&); - static bool equal(const FormElementKey& a, const FormElementKey& b) { return a == b; } - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -struct FormElementKeyHashTraits : WTF::GenericHashTraits<FormElementKey> { - static void constructDeletedValue(FormElementKey& slot) { new (NotNull, &slot) FormElementKey(WTF::HashTableDeletedValue); } - static bool isDeletedValue(const FormElementKey& value) { return value.isHashTableDeletedValue(); } -}; - enum PageshowEventPersistence { PageshowEventNotPersisted = 0, PageshowEventPersisted = 1 @@ -260,8 +221,6 @@ public: } } - virtual void removedLastRef(); - Element* getElementById(const AtomicString& id) const; virtual bool canContainRangeEndPoint() const { return true; } @@ -269,6 +228,8 @@ public: Element* getElementByAccessKey(const String& key); void invalidateAccessKeyMap(); + SelectorQueryCache* selectorQueryCache(); + // DOM methods & attributes for Document DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); @@ -325,6 +286,10 @@ public: DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenchange); DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitfullscreenerror); #endif +#if ENABLE(POINTER_LOCK) + DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitpointerlockchange); + DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitpointerlockerror); +#endif #if ENABLE(PAGE_VISIBILITY_API) DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitychange); #endif @@ -531,19 +496,10 @@ public: bool usesLinkRules() const { return linkColor() != visitedLinkColor() || m_usesLinkRules; } void setUsesLinkRules(bool b) { m_usesLinkRules = b; } - // Machinery for saving and restoring state when you leave and then go back to a page. - void registerFormElementWithState(HTMLFormControlElementWithState* control) { m_formElementsWithState.add(control); } - void unregisterFormElementWithState(HTMLFormControlElementWithState* control) { m_formElementsWithState.remove(control); } + // Never returns 0. + FormController* formController(); Vector<String> formElementsState() const; void setStateForNewFormElements(const Vector<String>&); - bool hasStateForNewFormElements() const; - bool takeStateForFormElement(AtomicStringImpl* name, AtomicStringImpl* type, String& state); - typedef ListHashSet<HTMLFormControlElementWithState*, 64> FormElementListHashSet; - const FormElementListHashSet* formElements() const { return &m_formElementsWithState; } - - void registerFormElementWithFormAttribute(FormAssociatedElement*); - void unregisterFormElementWithFormAttribute(FormAssociatedElement*); - void resetFormElementsOwner(); FrameView* view() const; // can be NULL Frame* frame() const { return m_frame; } // can be NULL @@ -756,6 +712,9 @@ public: bool isPendingStyleRecalc() const; void styleRecalcTimerFired(Timer<Document>*); + void registerDynamicSubtreeNodeList(DynamicSubtreeNodeList*); + void unregisterDynamicSubtreeNodeList(DynamicSubtreeNodeList*); + void attachNodeIterator(NodeIterator*); void detachNodeIterator(NodeIterator*); void moveNodeIteratorsToNewDocument(Node*, Document*); @@ -1038,8 +997,6 @@ public: virtual void removeAllEventListeners(); - CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; } - #if ENABLE(SVG) const SVGDocumentExtensions* svgExtensions(); SVGDocumentExtensions* accessSVGExtensions(); @@ -1111,6 +1068,11 @@ public: void webkitExitFullscreen(); #endif +#if ENABLE(POINTER_LOCK) + void webkitExitPointerLock(); + Element* webkitPointerLockElement() const; +#endif + // Used to allow element that loads data without going through a FrameLoader to delay the 'load' event. void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } void decrementLoadEventDelayCount(); @@ -1148,6 +1110,10 @@ public: void removeCachedMicroDataItemList(MicroDataItemList*, const String&); #endif +#if ENABLE(UNDO_MANAGER) + PassRefPtr<UndoManager> undoManager(); +#endif + bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } void suspendScheduledTasks(ActiveDOMObject::ReasonForSuspension); @@ -1159,6 +1125,12 @@ public: Prerenderer* prerenderer() { return m_prerenderer.get(); } #endif + void adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(Vector<FloatQuad>&, RenderObject*); + void adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale(FloatRect&, RenderObject*); + + void setContextFeatures(PassRefPtr<ContextFeatures>); + ContextFeatures* contextFeatures() { return m_contextFeatures.get(); } + protected: Document(Frame*, const KURL&, bool isXHTML, bool isHTML); @@ -1167,8 +1139,11 @@ protected: void clearXMLVersion() { m_xmlVersion = String(); } private: + friend class Node; friend class IgnoreDestructiveWriteCountIncrementer; + void removedLastRef(); + void detachParser(); typedef void (*ArgumentsCallback)(const String& keyString, const String& valueString, Document*, void* data); @@ -1250,6 +1225,8 @@ private: Frame* m_frame; OwnPtr<CachedResourceLoader> m_cachedResourceLoader; RefPtr<DocumentParser> m_parser; + RefPtr<ContextFeatures> m_contextFeatures; + bool m_wellFormed; // Document URLs. @@ -1265,6 +1242,8 @@ private: // string by content. Document.documentURI affects m_baseURL unless the // document contains a <base> element, in which case the <base> element // takes precedence. + // + // This property is read-only from JavaScript, but writable from Objective C. String m_documentURI; String m_baseTarget; @@ -1328,13 +1307,8 @@ private: typedef ListHashSet<Node*, 32> StyleSheetCandidateListHashSet; StyleSheetCandidateListHashSet m_styleSheetCandidateNodes; // All of the nodes that could potentially provide stylesheets to the document (<link>, <style>, <?xml-stylesheet>) - FormElementListHashSet m_formElementsWithState; - typedef ListHashSet<RefPtr<FormAssociatedElement>, 32> FormAssociatedElementListHashSet; - FormAssociatedElementListHashSet m_formElementsWithFormAttribute; + OwnPtr<FormController> m_formController; - typedef HashMap<FormElementKey, Vector<String>, FormElementKeyHash, FormElementKeyHashTraits> FormElementStateMap; - FormElementStateMap m_stateForNewFormElements; - Color m_linkColor; Color m_visitedLinkColor; Color m_activeLinkColor; @@ -1417,8 +1391,6 @@ private: InheritedBool m_designMode; - CheckedRadioButtons m_checkedRadioButtons; - OwnPtr<HTMLCollection> m_collections[NumUnnamedDocumentCachedTypes]; OwnPtr<HTMLAllCollection> m_allCollection; @@ -1451,6 +1423,8 @@ private: HashMap<StringImpl*, Element*, CaseFoldingHash> m_elementsByAccessKey; bool m_accessKeyMapValid; + OwnPtr<SelectorQueryCache> m_selectorQueryCache; + bool m_useSecureKeyboardEntryWhenActive; bool m_isXHTML; @@ -1498,6 +1472,10 @@ private: unsigned m_wheelEventHandlerCount; unsigned m_touchEventHandlerCount; + +#if ENABLE(UNDO_MANAGER) + RefPtr<UndoManager> m_undoManager; +#endif #if ENABLE(REQUEST_ANIMATION_FRAME) RefPtr<ScriptedAnimationController> m_scriptedAnimationController; |