OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
9 * Copyright (C) 2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2011 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 class CSSStyleSheetResource; | 73 class CSSStyleSheetResource; |
74 class CanvasRenderingContext2D; | 74 class CanvasRenderingContext2D; |
75 class CharacterData; | 75 class CharacterData; |
76 class Chrome; | 76 class Chrome; |
77 class Comment; | 77 class Comment; |
78 class ContentSecurityPolicyResponseHeaders; | 78 class ContentSecurityPolicyResponseHeaders; |
79 class ContextFeatures; | 79 class ContextFeatures; |
80 class CustomElementRegistrationContext; | 80 class CustomElementRegistrationContext; |
81 class DOMImplementation; | 81 class DOMImplementation; |
82 class DOMSelection; | 82 class DOMSelection; |
83 class DOMWindow; | 83 class LocalDOMWindow; |
84 class Database; | 84 class Database; |
85 class DatabaseThread; | 85 class DatabaseThread; |
86 class DocumentFragment; | 86 class DocumentFragment; |
87 class DocumentLifecycleNotifier; | 87 class DocumentLifecycleNotifier; |
88 class DocumentLifecycleObserver; | 88 class DocumentLifecycleObserver; |
89 class DocumentLoader; | 89 class DocumentLoader; |
90 class DocumentMarkerController; | 90 class DocumentMarkerController; |
91 class DocumentParser; | 91 class DocumentParser; |
92 class DocumentState; | 92 class DocumentState; |
93 class AnimationTimeline; | 93 class AnimationTimeline; |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 // nodeWillBeRemoved is only safe when removing one node at a time. | 680 // nodeWillBeRemoved is only safe when removing one node at a time. |
681 void nodeWillBeRemoved(Node&); | 681 void nodeWillBeRemoved(Node&); |
682 bool canReplaceChild(const Node& newChild, const Node& oldChild) const; | 682 bool canReplaceChild(const Node& newChild, const Node& oldChild) const; |
683 | 683 |
684 void didInsertText(Node*, unsigned offset, unsigned length); | 684 void didInsertText(Node*, unsigned offset, unsigned length); |
685 void didRemoveText(Node*, unsigned offset, unsigned length); | 685 void didRemoveText(Node*, unsigned offset, unsigned length); |
686 void didMergeTextNodes(Text& oldNode, unsigned offset); | 686 void didMergeTextNodes(Text& oldNode, unsigned offset); |
687 void didSplitTextNode(Text& oldNode); | 687 void didSplitTextNode(Text& oldNode); |
688 | 688 |
689 void clearDOMWindow() { m_domWindow = nullptr; } | 689 void clearDOMWindow() { m_domWindow = nullptr; } |
690 DOMWindow* domWindow() const { return m_domWindow; } | 690 LocalDOMWindow* domWindow() const { return m_domWindow; } |
691 | 691 |
692 // Helper functions for forwarding DOMWindow event related tasks to the DOMW
indow if it exists. | 692 // Helper functions for forwarding LocalDOMWindow event related tasks to the
LocalDOMWindow if it exists. |
693 void setWindowAttributeEventListener(const AtomicString& eventType, PassRefP
tr<EventListener>); | 693 void setWindowAttributeEventListener(const AtomicString& eventType, PassRefP
tr<EventListener>); |
694 EventListener* getWindowAttributeEventListener(const AtomicString& eventType
); | 694 EventListener* getWindowAttributeEventListener(const AtomicString& eventType
); |
695 | 695 |
696 static void registerEventFactory(PassOwnPtr<EventFactoryBase>); | 696 static void registerEventFactory(PassOwnPtr<EventFactoryBase>); |
697 static PassRefPtrWillBeRawPtr<Event> createEvent(const String& eventType, Ex
ceptionState&); | 697 static PassRefPtrWillBeRawPtr<Event> createEvent(const String& eventType, Ex
ceptionState&); |
698 | 698 |
699 // keep track of what types of event listeners are registered, so we don't | 699 // keep track of what types of event listeners are registered, so we don't |
700 // dispatch events unnecessarily | 700 // dispatch events unnecessarily |
701 enum ListenerType { | 701 enum ListenerType { |
702 DOMSUBTREEMODIFIED_LISTENER = 1, | 702 DOMSUBTREEMODIFIED_LISTENER = 1, |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 void updateFocusAppearanceSoon(bool restorePreviousSelection); | 869 void updateFocusAppearanceSoon(bool restorePreviousSelection); |
870 void cancelFocusAppearanceUpdate(); | 870 void cancelFocusAppearanceUpdate(); |
871 | 871 |
872 // Extension for manipulating canvas drawing contexts for use in CSS | 872 // Extension for manipulating canvas drawing contexts for use in CSS |
873 void getCSSCanvasContext(const String& type, const String& name, int width,
int height, bool&, RefPtrWillBeRawPtr<CanvasRenderingContext2D>&, bool&, RefPtrW
illBeRawPtr<WebGLRenderingContext>&); | 873 void getCSSCanvasContext(const String& type, const String& name, int width,
int height, bool&, RefPtrWillBeRawPtr<CanvasRenderingContext2D>&, bool&, RefPtrW
illBeRawPtr<WebGLRenderingContext>&); |
874 HTMLCanvasElement& getCSSCanvasElement(const String& name); | 874 HTMLCanvasElement& getCSSCanvasElement(const String& name); |
875 | 875 |
876 bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; } | 876 bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; } |
877 void parseDNSPrefetchControlHeader(const String&); | 877 void parseDNSPrefetchControlHeader(const String&); |
878 | 878 |
879 // FIXME(crbug.com/305497): This should be removed once DOMWindow is an Exec
utionContext. | 879 // FIXME(crbug.com/305497): This should be removed once LocalDOMWindow is an
ExecutionContext. |
880 virtual void postTask(PassOwnPtr<ExecutionContextTask>) OVERRIDE; // Execute
s the task on context's thread asynchronously. | 880 virtual void postTask(PassOwnPtr<ExecutionContextTask>) OVERRIDE; // Execute
s the task on context's thread asynchronously. |
881 | 881 |
882 virtual void tasksWereSuspended() OVERRIDE FINAL; | 882 virtual void tasksWereSuspended() OVERRIDE FINAL; |
883 virtual void tasksWereResumed() OVERRIDE FINAL; | 883 virtual void tasksWereResumed() OVERRIDE FINAL; |
884 virtual void suspendScheduledTasks() OVERRIDE FINAL; | 884 virtual void suspendScheduledTasks() OVERRIDE FINAL; |
885 virtual void resumeScheduledTasks() OVERRIDE FINAL; | 885 virtual void resumeScheduledTasks() OVERRIDE FINAL; |
886 virtual bool tasksNeedSuspension() OVERRIDE FINAL; | 886 virtual bool tasksNeedSuspension() OVERRIDE FINAL; |
887 | 887 |
888 void finishedParsing(); | 888 void finishedParsing(); |
889 | 889 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 void exitPointerLock(); | 949 void exitPointerLock(); |
950 Element* pointerLockElement() const; | 950 Element* pointerLockElement() const; |
951 | 951 |
952 // Used to allow element that loads data without going through a FrameLoader
to delay the 'load' event. | 952 // Used to allow element that loads data without going through a FrameLoader
to delay the 'load' event. |
953 void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } | 953 void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } |
954 void decrementLoadEventDelayCount(); | 954 void decrementLoadEventDelayCount(); |
955 void checkLoadEventSoon(); | 955 void checkLoadEventSoon(); |
956 bool isDelayingLoadEvent(); | 956 bool isDelayingLoadEvent(); |
957 void loadPluginsSoon(); | 957 void loadPluginsSoon(); |
958 | 958 |
959 PassRefPtrWillBeRawPtr<Touch> createTouch(DOMWindow*, EventTarget*, int iden
tifier, double pageX, double pageY, double screenX, double screenY, double radiu
sX, double radiusY, float rotationAngle, float force) const; | 959 PassRefPtrWillBeRawPtr<Touch> createTouch(LocalDOMWindow*, EventTarget*, int
identifier, double pageX, double pageY, double screenX, double screenY, double
radiusX, double radiusY, float rotationAngle, float force) const; |
960 PassRefPtrWillBeRawPtr<TouchList> createTouchList(WillBeHeapVector<RefPtrWil
lBeMember<Touch> >&) const; | 960 PassRefPtrWillBeRawPtr<TouchList> createTouchList(WillBeHeapVector<RefPtrWil
lBeMember<Touch> >&) const; |
961 | 961 |
962 const DocumentTiming& timing() const { return m_documentTiming; } | 962 const DocumentTiming& timing() const { return m_documentTiming; } |
963 | 963 |
964 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>); | 964 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>); |
965 void cancelAnimationFrame(int id); | 965 void cancelAnimationFrame(int id); |
966 void serviceScriptedAnimations(double monotonicAnimationStartTime); | 966 void serviceScriptedAnimations(double monotonicAnimationStartTime); |
967 | 967 |
968 virtual EventTarget* errorEventTarget() OVERRIDE FINAL; | 968 virtual EventTarget* errorEventTarget() OVERRIDE FINAL; |
969 virtual void logExceptionToConsole(const String& errorMessage, const String&
sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS
tack>) OVERRIDE FINAL; | 969 virtual void logExceptionToConsole(const String& errorMessage, const String&
sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS
tack>) OVERRIDE FINAL; |
970 | 970 |
971 void initDNSPrefetch(); | 971 void initDNSPrefetch(); |
972 | 972 |
973 bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_
touchEventTargets->size() : false; } | 973 bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_
touchEventTargets->size() : false; } |
974 | 974 |
975 // Called when a single touch event handler has been added or removed for a
node. | 975 // Called when a single touch event handler has been added or removed for a
node. |
976 // The Node should always be in this Document, except for child Documents wh
ich report | 976 // The Node should always be in this Document, except for child Documents wh
ich report |
977 // themselves to their parent exactly once if they have any touch handlers. | 977 // themselves to their parent exactly once if they have any touch handlers. |
978 // Handlers added/removed from the DOMWindow are reported as the Document. | 978 // Handlers added/removed from the LocalDOMWindow are reported as the Docume
nt. |
979 void didAddTouchEventHandler(Node*); | 979 void didAddTouchEventHandler(Node*); |
980 void didRemoveTouchEventHandler(Node* handler) { didRemoveTouchEventHandler(
handler, false); } | 980 void didRemoveTouchEventHandler(Node* handler) { didRemoveTouchEventHandler(
handler, false); } |
981 | 981 |
982 // Called whenever all touch event handlers have been removed for a node (su
ch as when the | 982 // Called whenever all touch event handlers have been removed for a node (su
ch as when the |
983 // node itself is being removed from the document). | 983 // node itself is being removed from the document). |
984 void didClearTouchEventHandlers(Node* handler) { didRemoveTouchEventHandler(
handler, true); } | 984 void didClearTouchEventHandlers(Node* handler) { didRemoveTouchEventHandler(
handler, true); } |
985 | 985 |
986 const TouchEventTargetSet* touchEventTargets() const { return m_touchEventTa
rgets.get(); } | 986 const TouchEventTargetSet* touchEventTargets() const { return m_touchEventTa
rgets.get(); } |
987 | 987 |
988 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } | 988 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 | 1040 |
1041 // A non-null m_templateDocumentHost implies that |this| was created by ensu
reTemplateDocument(). | 1041 // A non-null m_templateDocumentHost implies that |this| was created by ensu
reTemplateDocument(). |
1042 bool isTemplateDocument() const { return !!m_templateDocumentHost; } | 1042 bool isTemplateDocument() const { return !!m_templateDocumentHost; } |
1043 Document& ensureTemplateDocument(); | 1043 Document& ensureTemplateDocument(); |
1044 Document* templateDocumentHost() { return m_templateDocumentHost; } | 1044 Document* templateDocumentHost() { return m_templateDocumentHost; } |
1045 | 1045 |
1046 void didAssociateFormControl(Element*); | 1046 void didAssociateFormControl(Element*); |
1047 | 1047 |
1048 void addConsoleMessageWithRequestIdentifier(MessageSource, MessageLevel, con
st String& message, unsigned long requestIdentifier); | 1048 void addConsoleMessageWithRequestIdentifier(MessageSource, MessageLevel, con
st String& message, unsigned long requestIdentifier); |
1049 | 1049 |
1050 virtual DOMWindow* executingWindow() OVERRIDE FINAL; | 1050 virtual LocalDOMWindow* executingWindow() OVERRIDE FINAL; |
1051 LocalFrame* executingFrame(); | 1051 LocalFrame* executingFrame(); |
1052 | 1052 |
1053 DocumentLifecycleNotifier& lifecycleNotifier(); | 1053 DocumentLifecycleNotifier& lifecycleNotifier(); |
1054 DocumentLifecycle& lifecycle() { return m_lifecycle; } | 1054 DocumentLifecycle& lifecycle() { return m_lifecycle; } |
1055 bool isActive() const { return m_lifecycle.isActive(); } | 1055 bool isActive() const { return m_lifecycle.isActive(); } |
1056 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St
opped; } | 1056 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St
opped; } |
1057 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D
isposed; } | 1057 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D
isposed; } |
1058 | 1058 |
1059 enum HttpRefreshType { | 1059 enum HttpRefreshType { |
1060 HttpRefreshFromHeader, | 1060 HttpRefreshFromHeader, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 | 1158 |
1159 PassRefPtrWillBeRawPtr<NodeList> handleZeroPadding(const HitTestRequest&, Hi
tTestResult&) const; | 1159 PassRefPtrWillBeRawPtr<NodeList> handleZeroPadding(const HitTestRequest&, Hi
tTestResult&) const; |
1160 | 1160 |
1161 void loadEventDelayTimerFired(Timer<Document>*); | 1161 void loadEventDelayTimerFired(Timer<Document>*); |
1162 void pluginLoadingTimerFired(Timer<Document>*); | 1162 void pluginLoadingTimerFired(Timer<Document>*); |
1163 | 1163 |
1164 PageVisibilityState pageVisibilityState() const; | 1164 PageVisibilityState pageVisibilityState() const; |
1165 | 1165 |
1166 PassRefPtrWillBeRawPtr<HTMLCollection> ensureCachedCollection(CollectionType
); | 1166 PassRefPtrWillBeRawPtr<HTMLCollection> ensureCachedCollection(CollectionType
); |
1167 | 1167 |
1168 // Note that dispatching a window load event may cause the DOMWindow to be d
etached from | 1168 // Note that dispatching a window load event may cause the LocalDOMWindow to
be detached from |
1169 // the LocalFrame, so callers should take a reference to the DOMWindow (whic
h owns us) to | 1169 // the LocalFrame, so callers should take a reference to the LocalDOMWindow
(which owns us) to |
1170 // prevent the Document from getting blown away from underneath them. | 1170 // prevent the Document from getting blown away from underneath them. |
1171 void dispatchWindowLoadEvent(); | 1171 void dispatchWindowLoadEvent(); |
1172 | 1172 |
1173 void addListenerType(ListenerType listenerType) { m_listenerTypes |= listene
rType; } | 1173 void addListenerType(ListenerType listenerType) { m_listenerTypes |= listene
rType; } |
1174 void addMutationEventListenerTypeIfEnabled(ListenerType); | 1174 void addMutationEventListenerTypeIfEnabled(ListenerType); |
1175 | 1175 |
1176 void didAssociateFormControlsTimerFired(Timer<Document>*); | 1176 void didAssociateFormControlsTimerFired(Timer<Document>*); |
1177 | 1177 |
1178 void clearFocusedElementSoon(); | 1178 void clearFocusedElementSoon(); |
1179 void clearFocusedElementTimerFired(Timer<Document>*); | 1179 void clearFocusedElementTimerFired(Timer<Document>*); |
(...skipping 18 matching lines...) Expand all Loading... |
1198 | 1198 |
1199 bool m_hasNodesWithPlaceholderStyle; | 1199 bool m_hasNodesWithPlaceholderStyle; |
1200 bool m_evaluateMediaQueriesOnStyleRecalc; | 1200 bool m_evaluateMediaQueriesOnStyleRecalc; |
1201 | 1201 |
1202 // If we do ignore the pending stylesheet count, then we need to add a boole
an | 1202 // If we do ignore the pending stylesheet count, then we need to add a boole
an |
1203 // to track that this happened so that we can do a full repaint when the sty
lesheets | 1203 // to track that this happened so that we can do a full repaint when the sty
lesheets |
1204 // do eventually load. | 1204 // do eventually load. |
1205 PendingSheetLayout m_pendingSheetLayout; | 1205 PendingSheetLayout m_pendingSheetLayout; |
1206 | 1206 |
1207 LocalFrame* m_frame; | 1207 LocalFrame* m_frame; |
1208 RawPtrWillBeMember<DOMWindow> m_domWindow; | 1208 RawPtrWillBeMember<LocalDOMWindow> m_domWindow; |
1209 // FIXME: oilpan: when we get rid of the transition types change the | 1209 // FIXME: oilpan: when we get rid of the transition types change the |
1210 // HTMLImportsController to not be a DocumentSupplement since it is | 1210 // HTMLImportsController to not be a DocumentSupplement since it is |
1211 // redundant with oilpan. | 1211 // redundant with oilpan. |
1212 RawPtrWillBeMember<HTMLImportsController> m_importsController; | 1212 RawPtrWillBeMember<HTMLImportsController> m_importsController; |
1213 | 1213 |
1214 RefPtrWillBeMember<ResourceFetcher> m_fetcher; | 1214 RefPtrWillBeMember<ResourceFetcher> m_fetcher; |
1215 RefPtrWillBeMember<DocumentParser> m_parser; | 1215 RefPtrWillBeMember<DocumentParser> m_parser; |
1216 unsigned m_activeParserCount; | 1216 unsigned m_activeParserCount; |
1217 RefPtrWillBeMember<ContextFeatures> m_contextFeatures; | 1217 RefPtrWillBeMember<ContextFeatures> m_contextFeatures; |
1218 | 1218 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 inline bool Node::isDocumentNode() const | 1461 inline bool Node::isDocumentNode() const |
1462 { | 1462 { |
1463 return this == document(); | 1463 return this == document(); |
1464 } | 1464 } |
1465 | 1465 |
1466 Node* eventTargetNodeForDocument(Document*); | 1466 Node* eventTargetNodeForDocument(Document*); |
1467 | 1467 |
1468 } // namespace WebCore | 1468 } // namespace WebCore |
1469 | 1469 |
1470 #endif // Document_h | 1470 #endif // Document_h |
OLD | NEW |