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 |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) |
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
9 * Copyright (C) 2011 Google Inc. All rights reserved. | 11 * Copyright (C) 2011 Google Inc. All rights reserved. |
10 * | 12 * |
11 * This library is free software; you can redistribute it and/or | 13 * This library is free software; you can redistribute it and/or |
12 * modify it under the terms of the GNU Library General Public | 14 * modify it under the terms of the GNU Library General Public |
13 * License as published by the Free Software Foundation; either | 15 * License as published by the Free Software Foundation; either |
14 * version 2 of the License, or (at your option) any later version. | 16 * version 2 of the License, or (at your option) any later version. |
15 * | 17 * |
16 * This library is distributed in the hope that it will be useful, | 18 * This library is distributed in the hope that it will be useful, |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 struct FocusParams; | 179 struct FocusParams; |
178 struct IconURL; | 180 struct IconURL; |
179 | 181 |
180 using MouseEventWithHitTestResults = | 182 using MouseEventWithHitTestResults = |
181 EventWithHitTestResults<PlatformMouseEvent>; | 183 EventWithHitTestResults<PlatformMouseEvent>; |
182 using ExceptionCode = int; | 184 using ExceptionCode = int; |
183 | 185 |
184 enum StyleResolverUpdateMode { | 186 enum StyleResolverUpdateMode { |
185 // Discards the StyleResolver and rebuilds it. | 187 // Discards the StyleResolver and rebuilds it. |
186 FullStyleUpdate, | 188 FullStyleUpdate, |
187 // Attempts to use StyleInvalidationAnalysis to avoid discarding the entire St
yleResolver. | 189 // Attempts to use StyleInvalidationAnalysis to avoid discarding the entire |
| 190 // StyleResolver. |
188 AnalyzedStyleUpdate | 191 AnalyzedStyleUpdate |
189 }; | 192 }; |
190 | 193 |
191 enum NodeListInvalidationType { | 194 enum NodeListInvalidationType { |
192 DoNotInvalidateOnAttributeChanges = 0, | 195 DoNotInvalidateOnAttributeChanges = 0, |
193 InvalidateOnClassAttrChange, | 196 InvalidateOnClassAttrChange, |
194 InvalidateOnIdNameAttrChange, | 197 InvalidateOnIdNameAttrChange, |
195 InvalidateOnNameAttrChange, | 198 InvalidateOnNameAttrChange, |
196 InvalidateOnForAttrChange, | 199 InvalidateOnForAttrChange, |
197 InvalidateForFormControls, | 200 InvalidateForFormControls, |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 ExceptionState&) const; | 734 ExceptionState&) const; |
732 | 735 |
733 void didInsertText(Node*, unsigned offset, unsigned length); | 736 void didInsertText(Node*, unsigned offset, unsigned length); |
734 void didRemoveText(Node*, unsigned offset, unsigned length); | 737 void didRemoveText(Node*, unsigned offset, unsigned length); |
735 void didMergeTextNodes(Text& oldNode, unsigned offset); | 738 void didMergeTextNodes(Text& oldNode, unsigned offset); |
736 void didSplitTextNode(Text& oldNode); | 739 void didSplitTextNode(Text& oldNode); |
737 | 740 |
738 void clearDOMWindow() { m_domWindow = nullptr; } | 741 void clearDOMWindow() { m_domWindow = nullptr; } |
739 LocalDOMWindow* domWindow() const { return m_domWindow; } | 742 LocalDOMWindow* domWindow() const { return m_domWindow; } |
740 | 743 |
741 // Helper functions for forwarding LocalDOMWindow event related tasks to the L
ocalDOMWindow if it exists. | 744 // Helper functions for forwarding LocalDOMWindow event related tasks to the |
| 745 // LocalDOMWindow if it exists. |
742 void setWindowAttributeEventListener(const AtomicString& eventType, | 746 void setWindowAttributeEventListener(const AtomicString& eventType, |
743 EventListener*); | 747 EventListener*); |
744 EventListener* getWindowAttributeEventListener(const AtomicString& eventType); | 748 EventListener* getWindowAttributeEventListener(const AtomicString& eventType); |
745 | 749 |
746 static void registerEventFactory(std::unique_ptr<EventFactoryBase>); | 750 static void registerEventFactory(std::unique_ptr<EventFactoryBase>); |
747 static Event* createEvent(ExecutionContext*, | 751 static Event* createEvent(ExecutionContext*, |
748 const String& eventType, | 752 const String& eventType, |
749 ExceptionState&); | 753 ExceptionState&); |
750 | 754 |
751 // keep track of what types of event listeners are registered, so we don't | 755 // keep track of what types of event listeners are registered, so we don't |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 // A: The two URLs are the same almost all the time. However, if one | 830 // A: The two URLs are the same almost all the time. However, if one |
827 // document inherits the security context of another document, it | 831 // document inherits the security context of another document, it |
828 // inherits its cookieURL but not its URL. | 832 // inherits its cookieURL but not its URL. |
829 // | 833 // |
830 const KURL& cookieURL() const { return m_cookieURL; } | 834 const KURL& cookieURL() const { return m_cookieURL; } |
831 void setCookieURL(const KURL& url) { m_cookieURL = url; } | 835 void setCookieURL(const KURL& url) { m_cookieURL = url; } |
832 | 836 |
833 const KURL firstPartyForCookies() const; | 837 const KURL firstPartyForCookies() const; |
834 | 838 |
835 // The following implements the rule from HTML 4 for what valid names are. | 839 // The following implements the rule from HTML 4 for what valid names are. |
836 // To get this right for all the XML cases, we probably have to improve this o
r move it | 840 // To get this right for all the XML cases, we probably have to improve this |
837 // and make it sensitive to the type of document. | 841 // or move it and make it sensitive to the type of document. |
838 static bool isValidName(const String&); | 842 static bool isValidName(const String&); |
839 | 843 |
840 // The following breaks a qualified name into a prefix and a local name. | 844 // The following breaks a qualified name into a prefix and a local name. |
841 // It also does a validity check, and returns false if the qualified name | 845 // It also does a validity check, and returns false if the qualified name |
842 // is invalid. It also sets ExceptionCode when name is invalid. | 846 // is invalid. It also sets ExceptionCode when name is invalid. |
843 static bool parseQualifiedName(const AtomicString& qualifiedName, | 847 static bool parseQualifiedName(const AtomicString& qualifiedName, |
844 AtomicString& prefix, | 848 AtomicString& prefix, |
845 AtomicString& localName, | 849 AtomicString& localName, |
846 ExceptionState&); | 850 ExceptionState&); |
847 | 851 |
848 // Checks to make sure prefix and namespace do not conflict (per DOM Core 3) | 852 // Checks to make sure prefix and namespace do not conflict (per DOM Core 3) |
849 static bool hasValidNamespaceForElements(const QualifiedName&); | 853 static bool hasValidNamespaceForElements(const QualifiedName&); |
850 static bool hasValidNamespaceForAttributes(const QualifiedName&); | 854 static bool hasValidNamespaceForAttributes(const QualifiedName&); |
851 | 855 |
852 // "body element" as defined by HTML5 (https://html.spec.whatwg.org/multipage/
dom.html#the-body-element-2). | 856 // "body element" as defined by HTML5 |
| 857 // (https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2). |
853 // That is, the first body or frameset child of the document element. | 858 // That is, the first body or frameset child of the document element. |
854 HTMLElement* body() const; | 859 HTMLElement* body() const; |
855 | 860 |
856 // "HTML body element" as defined by CSSOM View spec (http://dev.w3.org/csswg/
cssom-view/#the-html-body-element). | 861 // "HTML body element" as defined by CSSOM View spec |
| 862 // (http://dev.w3.org/csswg/cssom-view/#the-html-body-element). |
857 // That is, the first body child of the document element. | 863 // That is, the first body child of the document element. |
858 HTMLBodyElement* firstBodyElement() const; | 864 HTMLBodyElement* firstBodyElement() const; |
859 | 865 |
860 void setBody(HTMLElement*, ExceptionState&); | 866 void setBody(HTMLElement*, ExceptionState&); |
861 void willInsertBody(); | 867 void willInsertBody(); |
862 | 868 |
863 HTMLHeadElement* head() const; | 869 HTMLHeadElement* head() const; |
864 | 870 |
865 // Decide which element is to define the viewport's overflow policy. If |rootS
tyle| is set, use | 871 // Decide which element is to define the viewport's overflow policy. If |
866 // that as the style for the root element, rather than obtaining it on our own
. The reason for | 872 // |rootStyle| is set, use that as the style for the root element, rather than |
867 // this is that style may not have been associated with the elements yet - in
which case it may | 873 // obtaining it on our own. The reason for this is that style may not have |
868 // have been calculated on the fly (without associating it with the actual ele
ment) somewhere. | 874 // been associated with the elements yet - in which case it may have been |
| 875 // calculated on the fly (without associating it with the actual element) |
| 876 // somewhere. |
869 Element* viewportDefiningElement( | 877 Element* viewportDefiningElement( |
870 const ComputedStyle* rootStyle = nullptr) const; | 878 const ComputedStyle* rootStyle = nullptr) const; |
871 | 879 |
872 DocumentMarkerController& markers() const { return *m_markers; } | 880 DocumentMarkerController& markers() const { return *m_markers; } |
873 | 881 |
874 bool execCommand(const String& command, | 882 bool execCommand(const String& command, |
875 bool showUI, | 883 bool showUI, |
876 const String& value, | 884 const String& value, |
877 ExceptionState&); | 885 ExceptionState&); |
878 bool isRunningExecCommand() const { return m_isRunningExecCommand; } | 886 bool isRunningExecCommand() const { return m_isRunningExecCommand; } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 | 952 |
945 void setUseSecureKeyboardEntryWhenActive(bool); | 953 void setUseSecureKeyboardEntryWhenActive(bool); |
946 bool useSecureKeyboardEntryWhenActive() const; | 954 bool useSecureKeyboardEntryWhenActive() const; |
947 | 955 |
948 void updateFocusAppearanceSoon(SelectionBehaviorOnFocus); | 956 void updateFocusAppearanceSoon(SelectionBehaviorOnFocus); |
949 void cancelFocusAppearanceUpdate(); | 957 void cancelFocusAppearanceUpdate(); |
950 | 958 |
951 bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; } | 959 bool isDNSPrefetchEnabled() const { return m_isDNSPrefetchEnabled; } |
952 void parseDNSPrefetchControlHeader(const String&); | 960 void parseDNSPrefetchControlHeader(const String&); |
953 | 961 |
954 // FIXME(crbug.com/305497): This should be removed once LocalDOMWindow is an E
xecutionContext. | 962 // FIXME(crbug.com/305497): This should be removed once LocalDOMWindow is an |
| 963 // ExecutionContext. |
955 void postTask(const WebTraceLocation&, | 964 void postTask(const WebTraceLocation&, |
956 std::unique_ptr<ExecutionContextTask>, | 965 std::unique_ptr<ExecutionContextTask>, |
957 const String& taskNameForInstrumentation = emptyString()) | 966 const String& taskNameForInstrumentation = emptyString()) |
958 override; // Executes the task on context's thread asynchronously. | 967 override; // Executes the task on context's thread asynchronously. |
959 void postInspectorTask(const WebTraceLocation&, | 968 void postInspectorTask(const WebTraceLocation&, |
960 std::unique_ptr<ExecutionContextTask>); | 969 std::unique_ptr<ExecutionContextTask>); |
961 | 970 |
962 void tasksWereSuspended() final; | 971 void tasksWereSuspended() final; |
963 void tasksWereResumed() final; | 972 void tasksWereResumed() final; |
964 void suspendScheduledTasks() final; | 973 void suspendScheduledTasks() final; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 bool isJSExecutionForbidden() const final { return false; } | 1047 bool isJSExecutionForbidden() const final { return false; } |
1039 | 1048 |
1040 bool containsValidityStyleRules() const { | 1049 bool containsValidityStyleRules() const { |
1041 return m_containsValidityStyleRules; | 1050 return m_containsValidityStyleRules; |
1042 } | 1051 } |
1043 void setContainsValidityStyleRules() { m_containsValidityStyleRules = true; } | 1052 void setContainsValidityStyleRules() { m_containsValidityStyleRules = true; } |
1044 | 1053 |
1045 void enqueueResizeEvent(); | 1054 void enqueueResizeEvent(); |
1046 void enqueueScrollEventForNode(Node*); | 1055 void enqueueScrollEventForNode(Node*); |
1047 void enqueueAnimationFrameEvent(Event*); | 1056 void enqueueAnimationFrameEvent(Event*); |
1048 // Only one event for a target/event type combination will be dispatched per f
rame. | 1057 // Only one event for a target/event type combination will be dispatched per |
| 1058 // frame. |
1049 void enqueueUniqueAnimationFrameEvent(Event*); | 1059 void enqueueUniqueAnimationFrameEvent(Event*); |
1050 void enqueueMediaQueryChangeListeners( | 1060 void enqueueMediaQueryChangeListeners( |
1051 HeapVector<Member<MediaQueryListListener>>&); | 1061 HeapVector<Member<MediaQueryListListener>>&); |
1052 void enqueueVisualViewportScrollEvent(); | 1062 void enqueueVisualViewportScrollEvent(); |
1053 void enqueueVisualViewportResizeEvent(); | 1063 void enqueueVisualViewportResizeEvent(); |
1054 | 1064 |
1055 void dispatchEventsForPrinting(); | 1065 void dispatchEventsForPrinting(); |
1056 | 1066 |
1057 bool hasFullscreenSupplement() const { return m_hasFullscreenSupplement; } | 1067 bool hasFullscreenSupplement() const { return m_hasFullscreenSupplement; } |
1058 void setHasFullscreenSupplement() { m_hasFullscreenSupplement = true; } | 1068 void setHasFullscreenSupplement() { m_hasFullscreenSupplement = true; } |
1059 | 1069 |
1060 void exitPointerLock(); | 1070 void exitPointerLock(); |
1061 Element* pointerLockElement() const; | 1071 Element* pointerLockElement() const; |
1062 | 1072 |
1063 // Used to allow element that loads data without going through a FrameLoader t
o delay the 'load' event. | 1073 // Used to allow element that loads data without going through a FrameLoader |
| 1074 // to delay the 'load' event. |
1064 void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } | 1075 void incrementLoadEventDelayCount() { ++m_loadEventDelayCount; } |
1065 void decrementLoadEventDelayCount(); | 1076 void decrementLoadEventDelayCount(); |
1066 void checkLoadEventSoon(); | 1077 void checkLoadEventSoon(); |
1067 bool isDelayingLoadEvent(); | 1078 bool isDelayingLoadEvent(); |
1068 void loadPluginsSoon(); | 1079 void loadPluginsSoon(); |
1069 | 1080 |
1070 Touch* createTouch(DOMWindow*, | 1081 Touch* createTouch(DOMWindow*, |
1071 EventTarget*, | 1082 EventTarget*, |
1072 int identifier, | 1083 int identifier, |
1073 double pageX, | 1084 double pageX, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 return *m_compositorPendingAnimations; | 1161 return *m_compositorPendingAnimations; |
1151 } | 1162 } |
1152 | 1163 |
1153 void addToTopLayer(Element*, const Element* before = nullptr); | 1164 void addToTopLayer(Element*, const Element* before = nullptr); |
1154 void removeFromTopLayer(Element*); | 1165 void removeFromTopLayer(Element*); |
1155 const HeapVector<Member<Element>>& topLayerElements() const { | 1166 const HeapVector<Member<Element>>& topLayerElements() const { |
1156 return m_topLayerElements; | 1167 return m_topLayerElements; |
1157 } | 1168 } |
1158 HTMLDialogElement* activeModalDialog() const; | 1169 HTMLDialogElement* activeModalDialog() const; |
1159 | 1170 |
1160 // A non-null m_templateDocumentHost implies that |this| was created by ensure
TemplateDocument(). | 1171 // A non-null m_templateDocumentHost implies that |this| was created by |
| 1172 // ensureTemplateDocument(). |
1161 bool isTemplateDocument() const { return !!m_templateDocumentHost; } | 1173 bool isTemplateDocument() const { return !!m_templateDocumentHost; } |
1162 Document& ensureTemplateDocument(); | 1174 Document& ensureTemplateDocument(); |
1163 Document* templateDocumentHost() { return m_templateDocumentHost; } | 1175 Document* templateDocumentHost() { return m_templateDocumentHost; } |
1164 | 1176 |
1165 // TODO(thestig): Rename these and related functions, since we can call them | 1177 // TODO(thestig): Rename these and related functions, since we can call them |
1166 // for controls outside of forms as well. | 1178 // for controls outside of forms as well. |
1167 void didAssociateFormControl(Element*); | 1179 void didAssociateFormControl(Element*); |
1168 | 1180 |
1169 void addConsoleMessage(ConsoleMessage*) final; | 1181 void addConsoleMessage(ConsoleMessage*) final; |
1170 | 1182 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 String nodeName() const final; | 1344 String nodeName() const final; |
1333 NodeType getNodeType() const final; | 1345 NodeType getNodeType() const final; |
1334 bool childTypeAllowed(NodeType) const final; | 1346 bool childTypeAllowed(NodeType) const final; |
1335 Node* cloneNode(bool deep) final; | 1347 Node* cloneNode(bool deep) final; |
1336 void cloneDataFromDocument(const Document&); | 1348 void cloneDataFromDocument(const Document&); |
1337 bool isSecureContextImpl( | 1349 bool isSecureContextImpl( |
1338 const SecureContextCheck priviligeContextCheck) const; | 1350 const SecureContextCheck priviligeContextCheck) const; |
1339 | 1351 |
1340 ShadowCascadeOrder m_shadowCascadeOrder = ShadowCascadeNone; | 1352 ShadowCascadeOrder m_shadowCascadeOrder = ShadowCascadeNone; |
1341 | 1353 |
1342 const KURL& virtualURL() const | 1354 // Same as url(), but needed for ExecutionContext to implement it without a |
1343 final; // Same as url(), but needed for ExecutionContext to implement it
without a performance loss for direct calls. | 1355 // performance loss for direct calls. |
1344 KURL virtualCompleteURL(const String&) | 1356 const KURL& virtualURL() const final; |
1345 const final; // Same as completeURL() for the same reason as above. | 1357 // Same as completeURL() for the same reason as above. |
| 1358 KURL virtualCompleteURL(const String&) const final; |
1346 | 1359 |
1347 void updateTitle(const String&); | 1360 void updateTitle(const String&); |
1348 void updateFocusAppearanceTimerFired(TimerBase*); | 1361 void updateFocusAppearanceTimerFired(TimerBase*); |
1349 void updateBaseURL(); | 1362 void updateBaseURL(); |
1350 | 1363 |
1351 void executeScriptsWaitingForResources(); | 1364 void executeScriptsWaitingForResources(); |
1352 | 1365 |
1353 void loadEventDelayTimerFired(TimerBase*); | 1366 void loadEventDelayTimerFired(TimerBase*); |
1354 void pluginLoadingTimerFired(TimerBase*); | 1367 void pluginLoadingTimerFired(TimerBase*); |
1355 | 1368 |
(...skipping 22 matching lines...) Expand all Loading... |
1378 } | 1391 } |
1379 | 1392 |
1380 const OriginAccessEntry& accessEntryFromURL(); | 1393 const OriginAccessEntry& accessEntryFromURL(); |
1381 | 1394 |
1382 DocumentLifecycle m_lifecycle; | 1395 DocumentLifecycle m_lifecycle; |
1383 | 1396 |
1384 bool m_hasNodesWithPlaceholderStyle; | 1397 bool m_hasNodesWithPlaceholderStyle; |
1385 bool m_evaluateMediaQueriesOnStyleRecalc; | 1398 bool m_evaluateMediaQueriesOnStyleRecalc; |
1386 | 1399 |
1387 // If we do ignore the pending stylesheet count, then we need to add a boolean | 1400 // If we do ignore the pending stylesheet count, then we need to add a boolean |
1388 // to track that this happened so that we can do a full repaint when the style
sheets | 1401 // to track that this happened so that we can do a full repaint when the |
1389 // do eventually load. | 1402 // stylesheets do eventually load. |
1390 PendingSheetLayout m_pendingSheetLayout; | 1403 PendingSheetLayout m_pendingSheetLayout; |
1391 | 1404 |
1392 Member<LocalFrame> m_frame; | 1405 Member<LocalFrame> m_frame; |
1393 Member<LocalDOMWindow> m_domWindow; | 1406 Member<LocalDOMWindow> m_domWindow; |
1394 Member<HTMLImportsController> m_importsController; | 1407 Member<HTMLImportsController> m_importsController; |
1395 | 1408 |
1396 Member<ResourceFetcher> m_fetcher; | 1409 Member<ResourceFetcher> m_fetcher; |
1397 Member<DocumentParser> m_parser; | 1410 Member<DocumentParser> m_parser; |
1398 Member<ContextFeatures> m_contextFeatures; | 1411 Member<ContextFeatures> m_contextFeatures; |
1399 | 1412 |
1400 bool m_wellFormed; | 1413 bool m_wellFormed; |
1401 | 1414 |
1402 // Document URLs. | 1415 // Document URLs. |
1403 KURL m_url; // Document.URL: The URL from which this document was retrieved. | 1416 KURL m_url; // Document.URL: The URL from which this document was retrieved. |
1404 KURL m_baseURL; // Node.baseURI: The URL to use when resolving relative URLs. | 1417 KURL m_baseURL; // Node.baseURI: The URL to use when resolving relative URLs. |
1405 KURL | 1418 KURL m_baseURLOverride; // An alternative base URL that takes precedence over |
1406 m_baseURLOverride; // An alternative base URL that takes precedence over
m_baseURL (but not m_baseElementURL). | 1419 // m_baseURL (but not m_baseElementURL). |
1407 KURL m_baseElementURL; // The URL set by the <base> element. | 1420 KURL m_baseElementURL; // The URL set by the <base> element. |
1408 KURL m_cookieURL; // The URL to use for cookie access. | 1421 KURL m_cookieURL; // The URL to use for cookie access. |
1409 std::unique_ptr<OriginAccessEntry> m_accessEntryFromURL; | 1422 std::unique_ptr<OriginAccessEntry> m_accessEntryFromURL; |
1410 | 1423 |
1411 AtomicString m_baseTarget; | 1424 AtomicString m_baseTarget; |
1412 | 1425 |
1413 // Mime-type of the document in case it was cloned or created by XHR. | 1426 // Mime-type of the document in case it was cloned or created by XHR. |
1414 AtomicString m_mimeType; | 1427 AtomicString m_mimeType; |
1415 | 1428 |
1416 Member<DocumentType> m_docType; | 1429 Member<DocumentType> m_docType; |
1417 Member<DOMImplementation> m_implementation; | 1430 Member<DOMImplementation> m_implementation; |
1418 | 1431 |
1419 Member<CSSStyleSheet> m_elemSheet; | 1432 Member<CSSStyleSheet> m_elemSheet; |
1420 | 1433 |
1421 bool m_printing; | 1434 bool m_printing; |
1422 bool m_wasPrinting; | 1435 bool m_wasPrinting; |
1423 bool m_paginatedForScreen; | 1436 bool m_paginatedForScreen; |
1424 | 1437 |
1425 CompatibilityMode m_compatibilityMode; | 1438 CompatibilityMode m_compatibilityMode; |
1426 bool | 1439 // This is cheaper than making setCompatibilityMode virtual. |
1427 m_compatibilityModeLocked; // This is cheaper than making setCompatibilit
yMode virtual. | 1440 bool m_compatibilityModeLocked; |
1428 | 1441 |
1429 std::unique_ptr<CancellableTaskFactory> | 1442 std::unique_ptr<CancellableTaskFactory> |
1430 m_executeScriptsWaitingForResourcesTask; | 1443 m_executeScriptsWaitingForResourcesTask; |
1431 | 1444 |
1432 bool m_hasAutofocused; | 1445 bool m_hasAutofocused; |
1433 Timer<Document> m_clearFocusedElementTimer; | 1446 Timer<Document> m_clearFocusedElementTimer; |
1434 Member<Element> m_autofocusElement; | 1447 Member<Element> m_autofocusElement; |
1435 Member<Element> m_focusedElement; | 1448 Member<Element> m_focusedElement; |
1436 Member<Range> m_sequentialFocusNavigationStartingPoint; | 1449 Member<Range> m_sequentialFocusNavigationStartingPoint; |
1437 Member<Node> m_hoverNode; | 1450 Member<Node> m_hoverNode; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 | 1552 |
1540 bool m_isViewSource; | 1553 bool m_isViewSource; |
1541 bool m_sawElementsInKnownNamespaces; | 1554 bool m_sawElementsInKnownNamespaces; |
1542 bool m_isSrcdocDocument; | 1555 bool m_isSrcdocDocument; |
1543 bool m_isMobileDocument; | 1556 bool m_isMobileDocument; |
1544 | 1557 |
1545 LayoutView* m_layoutView; | 1558 LayoutView* m_layoutView; |
1546 | 1559 |
1547 WeakMember<Document> m_contextDocument; | 1560 WeakMember<Document> m_contextDocument; |
1548 | 1561 |
1549 bool | 1562 // For early return in Fullscreen::fromIfExists() |
1550 m_hasFullscreenSupplement; // For early return in Fullscreen::fromIfExist
s() | 1563 bool m_hasFullscreenSupplement; |
1551 | 1564 |
1552 HeapVector<Member<Element>> m_topLayerElements; | 1565 HeapVector<Member<Element>> m_topLayerElements; |
1553 | 1566 |
1554 int m_loadEventDelayCount; | 1567 int m_loadEventDelayCount; |
1555 Timer<Document> m_loadEventDelayTimer; | 1568 Timer<Document> m_loadEventDelayTimer; |
1556 Timer<Document> m_pluginLoadingTimer; | 1569 Timer<Document> m_pluginLoadingTimer; |
1557 | 1570 |
1558 ViewportDescription m_viewportDescription; | 1571 ViewportDescription m_viewportDescription; |
1559 ViewportDescription m_legacyViewportDescription; | 1572 ViewportDescription m_legacyViewportDescription; |
1560 Length m_viewportDefaultMinWidth; | 1573 Length m_viewportDefaultMinWidth; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 | 1631 |
1619 bool m_visibilityWasLogged; | 1632 bool m_visibilityWasLogged; |
1620 | 1633 |
1621 Member<PropertyRegistry> m_propertyRegistry; | 1634 Member<PropertyRegistry> m_propertyRegistry; |
1622 }; | 1635 }; |
1623 | 1636 |
1624 extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Document>; | 1637 extern template class CORE_EXTERN_TEMPLATE_EXPORT Supplement<Document>; |
1625 | 1638 |
1626 inline bool Document::shouldOverrideLegacyDescription( | 1639 inline bool Document::shouldOverrideLegacyDescription( |
1627 ViewportDescription::Type origin) const { | 1640 ViewportDescription::Type origin) const { |
1628 // The different (legacy) meta tags have different priorities based on the typ
e | 1641 // The different (legacy) meta tags have different priorities based on the |
1629 // regardless of which order they appear in the DOM. The priority is given by
the | 1642 // type regardless of which order they appear in the DOM. The priority is |
1630 // ViewportDescription::Type enum. | 1643 // given by the ViewportDescription::Type enum. |
1631 return origin >= m_legacyViewportDescription.type; | 1644 return origin >= m_legacyViewportDescription.type; |
1632 } | 1645 } |
1633 | 1646 |
1634 inline void Document::scheduleLayoutTreeUpdateIfNeeded() { | 1647 inline void Document::scheduleLayoutTreeUpdateIfNeeded() { |
1635 // Inline early out to avoid the function calls below. | 1648 // Inline early out to avoid the function calls below. |
1636 if (hasPendingVisualUpdate()) | 1649 if (hasPendingVisualUpdate()) |
1637 return; | 1650 return; |
1638 if (shouldScheduleLayoutTreeUpdate() && needsLayoutTreeUpdate()) | 1651 if (shouldScheduleLayoutTreeUpdate() && needsLayoutTreeUpdate()) |
1639 scheduleLayoutTreeUpdate(); | 1652 scheduleLayoutTreeUpdate(); |
1640 } | 1653 } |
1641 | 1654 |
1642 DEFINE_TYPE_CASTS(Document, | 1655 DEFINE_TYPE_CASTS(Document, |
1643 ExecutionContext, | 1656 ExecutionContext, |
1644 context, | 1657 context, |
1645 context->isDocument(), | 1658 context->isDocument(), |
1646 context.isDocument()); | 1659 context.isDocument()); |
1647 DEFINE_NODE_TYPE_CASTS(Document, isDocumentNode()); | 1660 DEFINE_NODE_TYPE_CASTS(Document, isDocumentNode()); |
1648 | 1661 |
1649 #define DEFINE_DOCUMENT_TYPE_CASTS(thisType) \ | 1662 #define DEFINE_DOCUMENT_TYPE_CASTS(thisType) \ |
1650 DEFINE_TYPE_CASTS(thisType, Document, document, document->is##thisType(), \ | 1663 DEFINE_TYPE_CASTS(thisType, Document, document, document->is##thisType(), \ |
1651 document.is##thisType()) | 1664 document.is##thisType()) |
1652 | 1665 |
1653 // This is needed to avoid ambiguous overloads with the Node and TreeScope versi
ons. | 1666 // This is needed to avoid ambiguous overloads with the Node and TreeScope |
| 1667 // versions. |
1654 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Document) | 1668 DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(Document) |
1655 | 1669 |
1656 // Put these methods here, because they require the Document definition, but we
really want to inline them. | 1670 // Put these methods here, because they require the Document definition, but we |
| 1671 // really want to inline them. |
1657 | 1672 |
1658 inline bool Node::isDocumentNode() const { | 1673 inline bool Node::isDocumentNode() const { |
1659 return this == document(); | 1674 return this == document(); |
1660 } | 1675 } |
1661 | 1676 |
1662 Node* eventTargetNodeForDocument(Document*); | 1677 Node* eventTargetNodeForDocument(Document*); |
1663 | 1678 |
1664 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); | 1679 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); |
1665 | 1680 |
1666 } // namespace blink | 1681 } // namespace blink |
1667 | 1682 |
1668 #ifndef NDEBUG | 1683 #ifndef NDEBUG |
1669 // Outside the WebCore namespace for ease of invocation from gdb. | 1684 // Outside the WebCore namespace for ease of invocation from gdb. |
1670 CORE_EXPORT void showLiveDocumentInstances(); | 1685 CORE_EXPORT void showLiveDocumentInstances(); |
1671 #endif | 1686 #endif |
1672 | 1687 |
1673 #endif // Document_h | 1688 #endif // Document_h |
OLD | NEW |