Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: Source/core/dom/Document.h

Issue 334283004: Rename DOMWindow to LocalDOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/MediaList.cpp ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 // nodeWillBeRemoved is only safe when removing one node at a time. 671 // nodeWillBeRemoved is only safe when removing one node at a time.
672 void nodeWillBeRemoved(Node&); 672 void nodeWillBeRemoved(Node&);
673 bool canReplaceChild(const Node& newChild, const Node& oldChild) const; 673 bool canReplaceChild(const Node& newChild, const Node& oldChild) const;
674 674
675 void didInsertText(Node*, unsigned offset, unsigned length); 675 void didInsertText(Node*, unsigned offset, unsigned length);
676 void didRemoveText(Node*, unsigned offset, unsigned length); 676 void didRemoveText(Node*, unsigned offset, unsigned length);
677 void didMergeTextNodes(Text& oldNode, unsigned offset); 677 void didMergeTextNodes(Text& oldNode, unsigned offset);
678 void didSplitTextNode(Text& oldNode); 678 void didSplitTextNode(Text& oldNode);
679 679
680 void clearDOMWindow() { m_domWindow = nullptr; } 680 void clearDOMWindow() { m_domWindow = nullptr; }
681 DOMWindow* domWindow() const { return m_domWindow; } 681 LocalDOMWindow* domWindow() const { return m_domWindow; }
682 682
683 // Helper functions for forwarding DOMWindow event related tasks to the DOMW indow if it exists. 683 // Helper functions for forwarding LocalDOMWindow event related tasks to the LocalDOMWindow if it exists.
684 void setWindowAttributeEventListener(const AtomicString& eventType, PassRefP tr<EventListener>); 684 void setWindowAttributeEventListener(const AtomicString& eventType, PassRefP tr<EventListener>);
685 EventListener* getWindowAttributeEventListener(const AtomicString& eventType ); 685 EventListener* getWindowAttributeEventListener(const AtomicString& eventType );
686 686
687 static void registerEventFactory(PassOwnPtr<EventFactoryBase>); 687 static void registerEventFactory(PassOwnPtr<EventFactoryBase>);
688 static PassRefPtrWillBeRawPtr<Event> createEvent(const String& eventType, Ex ceptionState&); 688 static PassRefPtrWillBeRawPtr<Event> createEvent(const String& eventType, Ex ceptionState&);
689 689
690 // keep track of what types of event listeners are registered, so we don't 690 // keep track of what types of event listeners are registered, so we don't
691 // dispatch events unnecessarily 691 // dispatch events unnecessarily
692 enum ListenerType { 692 enum ListenerType {
693 DOMSUBTREEMODIFIED_LISTENER = 1, 693 DOMSUBTREEMODIFIED_LISTENER = 1,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 void updateFocusAppearanceSoon(bool restorePreviousSelection); 861 void updateFocusAppearanceSoon(bool restorePreviousSelection);
862 void cancelFocusAppearanceUpdate(); 862 void cancelFocusAppearanceUpdate();
863 863
864 // Extension for manipulating canvas drawing contexts for use in CSS 864 // Extension for manipulating canvas drawing contexts for use in CSS
865 void getCSSCanvasContext(const String& type, const String& name, int width, int height, bool&, RefPtrWillBeRawPtr<CanvasRenderingContext2D>&, bool&, RefPtrW illBeRawPtr<WebGLRenderingContext>&); 865 void getCSSCanvasContext(const String& type, const String& name, int width, int height, bool&, RefPtrWillBeRawPtr<CanvasRenderingContext2D>&, bool&, RefPtrW illBeRawPtr<WebGLRenderingContext>&);
866 HTMLCanvasElement& getCSSCanvasElement(const String& name); 866 HTMLCanvasElement& getCSSCanvasElement(const String& name);
867 867
868 bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; } 868 bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; }
869 void parseDNSPrefetchControlHeader(const String&); 869 void parseDNSPrefetchControlHeader(const String&);
870 870
871 // FIXME(crbug.com/305497): This should be removed once DOMWindow is an Exec utionContext. 871 // FIXME(crbug.com/305497): This should be removed once LocalDOMWindow is an ExecutionContext.
872 virtual void postTask(PassOwnPtr<ExecutionContextTask>) OVERRIDE; // Execute s the task on context's thread asynchronously. 872 virtual void postTask(PassOwnPtr<ExecutionContextTask>) OVERRIDE; // Execute s the task on context's thread asynchronously.
873 873
874 virtual void tasksWereSuspended() OVERRIDE FINAL; 874 virtual void tasksWereSuspended() OVERRIDE FINAL;
875 virtual void tasksWereResumed() OVERRIDE FINAL; 875 virtual void tasksWereResumed() OVERRIDE FINAL;
876 virtual void suspendScheduledTasks() OVERRIDE FINAL; 876 virtual void suspendScheduledTasks() OVERRIDE FINAL;
877 virtual void resumeScheduledTasks() OVERRIDE FINAL; 877 virtual void resumeScheduledTasks() OVERRIDE FINAL;
878 virtual bool tasksNeedSuspension() OVERRIDE FINAL; 878 virtual bool tasksNeedSuspension() OVERRIDE FINAL;
879 879
880 void finishedParsing(); 880 void finishedParsing();
881 881
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 void exitPointerLock(); 941 void exitPointerLock();
942 Element* pointerLockElement() const; 942 Element* pointerLockElement() const;
943 943
944 // Used to allow element that loads data without going through a FrameLoader to delay the 'load' event. 944 // Used to allow element that loads data without going through a FrameLoader to delay the 'load' event.
945 void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } 945 void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; }
946 void decrementLoadEventDelayCount(); 946 void decrementLoadEventDelayCount();
947 void checkLoadEventSoon(); 947 void checkLoadEventSoon();
948 bool isDelayingLoadEvent(); 948 bool isDelayingLoadEvent();
949 void loadPluginsSoon(); 949 void loadPluginsSoon();
950 950
951 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; 951 PassRefPtrWillBeRawPtr<Touch> createTouch(LocalDOMWindow*, EventTarget*, int identifier, double pageX, double pageY, double screenX, double screenY, double radiusX, double radiusY, float rotationAngle, float force) const;
952 PassRefPtrWillBeRawPtr<TouchList> createTouchList(WillBeHeapVector<RefPtrWil lBeMember<Touch> >&) const; 952 PassRefPtrWillBeRawPtr<TouchList> createTouchList(WillBeHeapVector<RefPtrWil lBeMember<Touch> >&) const;
953 953
954 const DocumentTiming& timing() const { return m_documentTiming; } 954 const DocumentTiming& timing() const { return m_documentTiming; }
955 955
956 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>); 956 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>);
957 void cancelAnimationFrame(int id); 957 void cancelAnimationFrame(int id);
958 void serviceScriptedAnimations(double monotonicAnimationStartTime); 958 void serviceScriptedAnimations(double monotonicAnimationStartTime);
959 959
960 virtual EventTarget* errorEventTarget() OVERRIDE FINAL; 960 virtual EventTarget* errorEventTarget() OVERRIDE FINAL;
961 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS tack>) OVERRIDE FINAL; 961 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS tack>) OVERRIDE FINAL;
962 962
963 void initDNSPrefetch(); 963 void initDNSPrefetch();
964 964
965 bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_ touchEventTargets->size() : false; } 965 bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_ touchEventTargets->size() : false; }
966 966
967 // Called when a single touch event handler has been added or removed for a node. 967 // Called when a single touch event handler has been added or removed for a node.
968 // The Node should always be in this Document, except for child Documents wh ich report 968 // The Node should always be in this Document, except for child Documents wh ich report
969 // themselves to their parent exactly once if they have any touch handlers. 969 // themselves to their parent exactly once if they have any touch handlers.
970 // Handlers added/removed from the DOMWindow are reported as the Document. 970 // Handlers added/removed from the LocalDOMWindow are reported as the Docume nt.
971 void didAddTouchEventHandler(Node*); 971 void didAddTouchEventHandler(Node*);
972 void didRemoveTouchEventHandler(Node* handler) { didRemoveTouchEventHandler( handler, false); } 972 void didRemoveTouchEventHandler(Node* handler) { didRemoveTouchEventHandler( handler, false); }
973 973
974 // Called whenever all touch event handlers have been removed for a node (su ch as when the 974 // Called whenever all touch event handlers have been removed for a node (su ch as when the
975 // node itself is being removed from the document). 975 // node itself is being removed from the document).
976 void didClearTouchEventHandlers(Node* handler) { didRemoveTouchEventHandler( handler, true); } 976 void didClearTouchEventHandlers(Node* handler) { didRemoveTouchEventHandler( handler, true); }
977 977
978 const TouchEventTargetSet* touchEventTargets() const { return m_touchEventTa rgets.get(); } 978 const TouchEventTargetSet* touchEventTargets() const { return m_touchEventTa rgets.get(); }
979 979
980 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } 980 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 1032
1033 // A non-null m_templateDocumentHost implies that |this| was created by ensu reTemplateDocument(). 1033 // A non-null m_templateDocumentHost implies that |this| was created by ensu reTemplateDocument().
1034 bool isTemplateDocument() const { return !!m_templateDocumentHost; } 1034 bool isTemplateDocument() const { return !!m_templateDocumentHost; }
1035 Document& ensureTemplateDocument(); 1035 Document& ensureTemplateDocument();
1036 Document* templateDocumentHost() { return m_templateDocumentHost; } 1036 Document* templateDocumentHost() { return m_templateDocumentHost; }
1037 1037
1038 void didAssociateFormControl(Element*); 1038 void didAssociateFormControl(Element*);
1039 1039
1040 void addConsoleMessageWithRequestIdentifier(MessageSource, MessageLevel, con st String& message, unsigned long requestIdentifier); 1040 void addConsoleMessageWithRequestIdentifier(MessageSource, MessageLevel, con st String& message, unsigned long requestIdentifier);
1041 1041
1042 virtual DOMWindow* executingWindow() OVERRIDE FINAL; 1042 virtual LocalDOMWindow* executingWindow() OVERRIDE FINAL;
1043 LocalFrame* executingFrame(); 1043 LocalFrame* executingFrame();
1044 1044
1045 DocumentLifecycleNotifier& lifecycleNotifier(); 1045 DocumentLifecycleNotifier& lifecycleNotifier();
1046 DocumentLifecycle& lifecycle() { return m_lifecycle; } 1046 DocumentLifecycle& lifecycle() { return m_lifecycle; }
1047 bool isActive() const { return m_lifecycle.isActive(); } 1047 bool isActive() const { return m_lifecycle.isActive(); }
1048 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St opped; } 1048 bool isStopped() const { return m_lifecycle.state() == DocumentLifecycle::St opped; }
1049 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D isposed; } 1049 bool isDisposed() const { return m_lifecycle.state() == DocumentLifecycle::D isposed; }
1050 1050
1051 enum HttpRefreshType { 1051 enum HttpRefreshType {
1052 HttpRefreshFromHeader, 1052 HttpRefreshFromHeader,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 1148
1149 void executeScriptsWaitingForResourcesTimerFired(Timer<Document>*); 1149 void executeScriptsWaitingForResourcesTimerFired(Timer<Document>*);
1150 1150
1151 void loadEventDelayTimerFired(Timer<Document>*); 1151 void loadEventDelayTimerFired(Timer<Document>*);
1152 void pluginLoadingTimerFired(Timer<Document>*); 1152 void pluginLoadingTimerFired(Timer<Document>*);
1153 1153
1154 PageVisibilityState pageVisibilityState() const; 1154 PageVisibilityState pageVisibilityState() const;
1155 1155
1156 PassRefPtrWillBeRawPtr<HTMLCollection> ensureCachedCollection(CollectionType ); 1156 PassRefPtrWillBeRawPtr<HTMLCollection> ensureCachedCollection(CollectionType );
1157 1157
1158 // Note that dispatching a window load event may cause the DOMWindow to be d etached from 1158 // Note that dispatching a window load event may cause the LocalDOMWindow to be detached from
1159 // the LocalFrame, so callers should take a reference to the DOMWindow (whic h owns us) to 1159 // the LocalFrame, so callers should take a reference to the LocalDOMWindow (which owns us) to
1160 // prevent the Document from getting blown away from underneath them. 1160 // prevent the Document from getting blown away from underneath them.
1161 void dispatchWindowLoadEvent(); 1161 void dispatchWindowLoadEvent();
1162 1162
1163 void addListenerType(ListenerType listenerType) { m_listenerTypes |= listene rType; } 1163 void addListenerType(ListenerType listenerType) { m_listenerTypes |= listene rType; }
1164 void addMutationEventListenerTypeIfEnabled(ListenerType); 1164 void addMutationEventListenerTypeIfEnabled(ListenerType);
1165 1165
1166 void didAssociateFormControlsTimerFired(Timer<Document>*); 1166 void didAssociateFormControlsTimerFired(Timer<Document>*);
1167 1167
1168 void clearFocusedElementSoon(); 1168 void clearFocusedElementSoon();
1169 void clearFocusedElementTimerFired(Timer<Document>*); 1169 void clearFocusedElementTimerFired(Timer<Document>*);
(...skipping 18 matching lines...) Expand all
1188 1188
1189 bool m_hasNodesWithPlaceholderStyle; 1189 bool m_hasNodesWithPlaceholderStyle;
1190 bool m_evaluateMediaQueriesOnStyleRecalc; 1190 bool m_evaluateMediaQueriesOnStyleRecalc;
1191 1191
1192 // If we do ignore the pending stylesheet count, then we need to add a boole an 1192 // If we do ignore the pending stylesheet count, then we need to add a boole an
1193 // to track that this happened so that we can do a full repaint when the sty lesheets 1193 // to track that this happened so that we can do a full repaint when the sty lesheets
1194 // do eventually load. 1194 // do eventually load.
1195 PendingSheetLayout m_pendingSheetLayout; 1195 PendingSheetLayout m_pendingSheetLayout;
1196 1196
1197 LocalFrame* m_frame; 1197 LocalFrame* m_frame;
1198 RawPtrWillBeMember<DOMWindow> m_domWindow; 1198 RawPtrWillBeMember<LocalDOMWindow> m_domWindow;
1199 // FIXME: oilpan: when we get rid of the transition types change the 1199 // FIXME: oilpan: when we get rid of the transition types change the
1200 // HTMLImportsController to not be a DocumentSupplement since it is 1200 // HTMLImportsController to not be a DocumentSupplement since it is
1201 // redundant with oilpan. 1201 // redundant with oilpan.
1202 RawPtrWillBeMember<HTMLImportsController> m_importsController; 1202 RawPtrWillBeMember<HTMLImportsController> m_importsController;
1203 1203
1204 RefPtrWillBeMember<ResourceFetcher> m_fetcher; 1204 RefPtrWillBeMember<ResourceFetcher> m_fetcher;
1205 RefPtrWillBeMember<DocumentParser> m_parser; 1205 RefPtrWillBeMember<DocumentParser> m_parser;
1206 unsigned m_activeParserCount; 1206 unsigned m_activeParserCount;
1207 RefPtrWillBeMember<ContextFeatures> m_contextFeatures; 1207 RefPtrWillBeMember<ContextFeatures> m_contextFeatures;
1208 1208
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 inline bool Node::isDocumentNode() const 1451 inline bool Node::isDocumentNode() const
1452 { 1452 {
1453 return this == document(); 1453 return this == document();
1454 } 1454 }
1455 1455
1456 Node* eventTargetNodeForDocument(Document*); 1456 Node* eventTargetNodeForDocument(Document*);
1457 1457
1458 } // namespace WebCore 1458 } // namespace WebCore
1459 1459
1460 #endif // Document_h 1460 #endif // Document_h
OLDNEW
« no previous file with comments | « Source/core/css/MediaList.cpp ('k') | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698