LEFT | RIGHT |
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-2018 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004-2018 Apple Inc. All rights 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 String suggestedMIMEType() const; | 472 String suggestedMIMEType() const; |
473 | 473 |
474 void overrideMIMEType(const String&); | 474 void overrideMIMEType(const String&); |
475 WEBCORE_EXPORT String contentType() const; | 475 WEBCORE_EXPORT String contentType() const; |
476 | 476 |
477 String contentLanguage() const { return m_contentLanguage; } | 477 String contentLanguage() const { return m_contentLanguage; } |
478 void setContentLanguage(const String&); | 478 void setContentLanguage(const String&); |
479 | 479 |
480 String xmlEncoding() const { return m_xmlEncoding; } | 480 String xmlEncoding() const { return m_xmlEncoding; } |
481 String xmlVersion() const { return m_xmlVersion; } | 481 String xmlVersion() const { return m_xmlVersion; } |
482 enum StandaloneStatus { StandaloneUnspecified, Standalone, NotStandalone }; | 482 enum class StandaloneStatus : uint8_t { Unspecified, Standalone, NotStandalo
ne }; |
483 bool xmlStandalone() const { return m_xmlStandalone == Standalone; } | 483 bool xmlStandalone() const { return m_xmlStandalone == StandaloneStatus::Sta
ndalone; } |
484 StandaloneStatus xmlStandaloneStatus() const { return m_xmlStandalone; } | 484 StandaloneStatus xmlStandaloneStatus() const { return m_xmlStandalone; } |
485 bool hasXMLDeclaration() const { return m_hasXMLDeclaration; } | 485 bool hasXMLDeclaration() const { return m_hasXMLDeclaration; } |
486 | 486 |
487 void setXMLEncoding(const String& encoding) { m_xmlEncoding = encoding; } //
read-only property, only to be set from XMLDocumentParser | 487 void setXMLEncoding(const String& encoding) { m_xmlEncoding = encoding; } //
read-only property, only to be set from XMLDocumentParser |
488 WEBCORE_EXPORT ExceptionOr<void> setXMLVersion(const String&); | 488 WEBCORE_EXPORT ExceptionOr<void> setXMLVersion(const String&); |
489 WEBCORE_EXPORT void setXMLStandalone(bool); | 489 WEBCORE_EXPORT void setXMLStandalone(bool); |
490 void setHasXMLDeclaration(bool hasXMLDeclaration) { m_hasXMLDeclaration = ha
sXMLDeclaration; } | 490 void setHasXMLDeclaration(bool hasXMLDeclaration) { m_hasXMLDeclaration = ha
sXMLDeclaration; } |
491 | 491 |
492 String documentURI() const { return m_documentURI; } | 492 String documentURI() const { return m_documentURI; } |
493 WEBCORE_EXPORT void setDocumentURI(const String&); | 493 WEBCORE_EXPORT void setDocumentURI(const String&); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 void textRemoved(Node*, unsigned offset, unsigned length); | 809 void textRemoved(Node*, unsigned offset, unsigned length); |
810 void textNodesMerged(Text* oldNode, unsigned offset); | 810 void textNodesMerged(Text* oldNode, unsigned offset); |
811 void textNodeSplit(Text* oldNode); | 811 void textNodeSplit(Text* oldNode); |
812 | 812 |
813 void createDOMWindow(); | 813 void createDOMWindow(); |
814 void takeDOMWindowFrom(Document*); | 814 void takeDOMWindowFrom(Document*); |
815 | 815 |
816 DOMWindow* domWindow() const { return m_domWindow.get(); } | 816 DOMWindow* domWindow() const { return m_domWindow.get(); } |
817 // In DOM Level 2, the Document's DOMWindow is called the defaultView. | 817 // In DOM Level 2, the Document's DOMWindow is called the defaultView. |
818 WEBCORE_EXPORT WindowProxy* windowProxy() const; | 818 WEBCORE_EXPORT WindowProxy* windowProxy() const; |
| 819 |
| 820 bool hasBrowsingContext() const { return !!frame(); } |
819 | 821 |
820 Document& contextDocument() const; | 822 Document& contextDocument() const; |
821 void setContextDocument(Document& document) { m_contextDocument = makeWeakPt
r(document); } | 823 void setContextDocument(Document& document) { m_contextDocument = makeWeakPt
r(document); } |
822 | 824 |
823 // Helper functions for forwarding DOMWindow event related tasks to the DOMW
indow if it exists. | 825 // Helper functions for forwarding DOMWindow event related tasks to the DOMW
indow if it exists. |
824 void setWindowAttributeEventListener(const AtomicString& eventType, const Qu
alifiedName& attributeName, const AtomicString& value, DOMWrapperWorld&); | 826 void setWindowAttributeEventListener(const AtomicString& eventType, const Qu
alifiedName& attributeName, const AtomicString& value, DOMWrapperWorld&); |
825 void setWindowAttributeEventListener(const AtomicString& eventType, RefPtr<E
ventListener>&&, DOMWrapperWorld&); | 827 void setWindowAttributeEventListener(const AtomicString& eventType, RefPtr<E
ventListener>&&, DOMWrapperWorld&); |
826 EventListener* getWindowAttributeEventListener(const AtomicString& eventType
, DOMWrapperWorld&); | 828 EventListener* getWindowAttributeEventListener(const AtomicString& eventType
, DOMWrapperWorld&); |
827 WEBCORE_EXPORT void dispatchWindowEvent(Event&, EventTarget* = nullptr); | 829 WEBCORE_EXPORT void dispatchWindowEvent(Event&, EventTarget* = nullptr); |
828 void dispatchWindowLoadEvent(); | 830 void dispatchWindowLoadEvent(); |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 #endif | 1357 #endif |
1356 | 1358 |
1357 ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicyToPropagate() const
; | 1359 ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicyToPropagate() const
; |
1358 bool shouldEnforceContentDispositionAttachmentSandbox() const; | 1360 bool shouldEnforceContentDispositionAttachmentSandbox() const; |
1359 void applyContentDispositionAttachmentSandbox(); | 1361 void applyContentDispositionAttachmentSandbox(); |
1360 | 1362 |
1361 void addViewportDependentPicture(HTMLPictureElement&); | 1363 void addViewportDependentPicture(HTMLPictureElement&); |
1362 void removeViewportDependentPicture(HTMLPictureElement&); | 1364 void removeViewportDependentPicture(HTMLPictureElement&); |
1363 | 1365 |
1364 #if ENABLE(INTERSECTION_OBSERVER) | 1366 #if ENABLE(INTERSECTION_OBSERVER) |
1365 void addToIntersectionObserverTargets(Element&); | 1367 void activateIntersectionObserver(IntersectionObserver&); |
1366 void removeFromIntersectionObserverTargets(Element&); | 1368 bool deactivateIntersectionObserver(IntersectionObserver&); |
| 1369 unsigned numberOfActiveIntersectionObservers() const { return m_activeInters
ectionObservers.size(); } |
| 1370 void addViewportIntersectionObserver(IntersectionObserver&); |
| 1371 void removeViewportIntersectionObserver(IntersectionObserver&); |
1367 void updateIntersectionObservations(); | 1372 void updateIntersectionObservations(); |
1368 #endif | 1373 #endif |
1369 | 1374 |
1370 #if ENABLE(MEDIA_STREAM) | 1375 #if ENABLE(MEDIA_STREAM) |
1371 void setHasCaptureMediaStreamTrack() { m_hasHadCaptureMediaStreamTrack = tru
e; } | 1376 void setHasCaptureMediaStreamTrack() { m_hasHadCaptureMediaStreamTrack = tru
e; } |
1372 bool hasHadCaptureMediaStreamTrack() const { return m_hasHadCaptureMediaStre
amTrack; } | 1377 bool hasHadCaptureMediaStreamTrack() const { return m_hasHadCaptureMediaStre
amTrack; } |
1373 void setDeviceIDHashSalt(const String& salt) { m_idHashSalt = salt; } | 1378 void setDeviceIDHashSalt(const String& salt) { m_idHashSalt = salt; } |
1374 String deviceIDHashSalt() const { return m_idHashSalt; } | 1379 String deviceIDHashSalt() const { return m_idHashSalt; } |
1375 void stopMediaCapture(); | 1380 void stopMediaCapture(); |
1376 void registerForMediaStreamStateChangeCallbacks(HTMLMediaElement&); | 1381 void registerForMediaStreamStateChangeCallbacks(HTMLMediaElement&); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 }; | 1486 enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 }; |
1482 Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned const
ructionFlags = 0); | 1487 Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned const
ructionFlags = 0); |
1483 | 1488 |
1484 void clearXMLVersion() { m_xmlVersion = String(); } | 1489 void clearXMLVersion() { m_xmlVersion = String(); } |
1485 | 1490 |
1486 virtual Ref<Document> cloneDocumentWithoutChildren() const; | 1491 virtual Ref<Document> cloneDocumentWithoutChildren() const; |
1487 | 1492 |
1488 private: | 1493 private: |
1489 friend class DocumentParserYieldToken; | 1494 friend class DocumentParserYieldToken; |
1490 friend class Node; | 1495 friend class Node; |
| 1496 friend class ThrowOnDynamicMarkupInsertionCountIncrementer; |
| 1497 friend class IgnoreOpensDuringUnloadCountIncrementer; |
1491 friend class IgnoreDestructiveWriteCountIncrementer; | 1498 friend class IgnoreDestructiveWriteCountIncrementer; |
1492 friend class IgnoreOpensDuringUnloadCountIncrementer; | |
1493 | 1499 |
1494 bool shouldInheritContentSecurityPolicyFromOwner() const; | 1500 bool shouldInheritContentSecurityPolicyFromOwner() const; |
1495 | 1501 |
1496 void detachFromFrame() { observeFrame(nullptr); } | 1502 void detachFromFrame() { observeFrame(nullptr); } |
1497 | 1503 |
1498 void updateTitleElement(Element& changingTitleElement); | 1504 void updateTitleElement(Element& changingTitleElement); |
1499 void frameDestroyed() final; | 1505 void frameDestroyed() final; |
1500 | 1506 |
1501 void commonTeardown(); | 1507 void commonTeardown(); |
1502 | 1508 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1578 void setCachedDOMCookies(const String&); | 1584 void setCachedDOMCookies(const String&); |
1579 bool isDOMCookieCacheValid() const { return m_cookieCacheExpiryTimer.isActiv
e(); } | 1585 bool isDOMCookieCacheValid() const { return m_cookieCacheExpiryTimer.isActiv
e(); } |
1580 void invalidateDOMCookieCache(); | 1586 void invalidateDOMCookieCache(); |
1581 void didLoadResourceSynchronously() final; | 1587 void didLoadResourceSynchronously() final; |
1582 | 1588 |
1583 void checkViewportDependentPictures(); | 1589 void checkViewportDependentPictures(); |
1584 | 1590 |
1585 #if ENABLE(INTERSECTION_OBSERVER) | 1591 #if ENABLE(INTERSECTION_OBSERVER) |
1586 // Return true if any need notifying. | 1592 // Return true if any need notifying. |
1587 bool updateIntersectionObservation(IntersectionObserver&, double timeStamp); | 1593 bool updateIntersectionObservation(IntersectionObserver&, double timeStamp); |
1588 void collectIntersectionObservers(HashSet<IntersectionObserver*>&); | |
1589 void notifyIntersectionObserversTimerFired(); | 1594 void notifyIntersectionObserversTimerFired(); |
1590 #endif | 1595 #endif |
1591 | 1596 |
1592 #if USE(QUICK_LOOK) | 1597 #if USE(QUICK_LOOK) |
1593 bool shouldEnforceQuickLookSandbox() const; | 1598 bool shouldEnforceQuickLookSandbox() const; |
1594 void applyQuickLookSandbox(); | 1599 void applyQuickLookSandbox(); |
1595 #endif | 1600 #endif |
1596 | 1601 |
1597 bool shouldEnforceHTTP09Sandbox() const; | 1602 bool shouldEnforceHTTP09Sandbox() const; |
1598 | 1603 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 void applyPendingXSLTransformsTimerFired(); | 1695 void applyPendingXSLTransformsTimerFired(); |
1691 | 1696 |
1692 std::unique_ptr<TransformSource> m_transformSource; | 1697 std::unique_ptr<TransformSource> m_transformSource; |
1693 RefPtr<Document> m_transformSourceDocument; | 1698 RefPtr<Document> m_transformSourceDocument; |
1694 Timer m_applyPendingXSLTransformsTimer; | 1699 Timer m_applyPendingXSLTransformsTimer; |
1695 bool m_hasPendingXSLTransforms { false }; | 1700 bool m_hasPendingXSLTransforms { false }; |
1696 #endif | 1701 #endif |
1697 | 1702 |
1698 String m_xmlEncoding; | 1703 String m_xmlEncoding; |
1699 String m_xmlVersion; | 1704 String m_xmlVersion; |
1700 StandaloneStatus m_xmlStandalone { StandaloneUnspecified }; | 1705 StandaloneStatus m_xmlStandalone { StandaloneStatus::Unspecified }; |
1701 bool m_hasXMLDeclaration { false }; | 1706 bool m_hasXMLDeclaration { false }; |
1702 | 1707 |
1703 String m_contentLanguage; | 1708 String m_contentLanguage; |
1704 | 1709 |
1705 RefPtr<TextResourceDecoder> m_decoder; | 1710 RefPtr<TextResourceDecoder> m_decoder; |
1706 | 1711 |
1707 HashSet<LiveNodeList*> m_listsInvalidatedAtDocument; | 1712 HashSet<LiveNodeList*> m_listsInvalidatedAtDocument; |
1708 HashSet<HTMLCollection*> m_collectionsInvalidatedAtDocument; | 1713 HashSet<HTMLCollection*> m_collectionsInvalidatedAtDocument; |
1709 unsigned m_nodeListAndCollectionCounts[numNodeListInvalidationTypes]; | 1714 unsigned m_nodeListAndCollectionCounts[numNodeListInvalidationTypes]; |
1710 | 1715 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 std::unique_ptr<RenderStyle> m_savedPlaceholderRenderStyle; | 1770 std::unique_ptr<RenderStyle> m_savedPlaceholderRenderStyle; |
1766 | 1771 |
1767 bool m_areKeysEnabledInFullScreen { false }; | 1772 bool m_areKeysEnabledInFullScreen { false }; |
1768 bool m_isAnimatingFullScreen { false }; | 1773 bool m_isAnimatingFullScreen { false }; |
1769 bool m_areFullscreenControlsHidden { false }; | 1774 bool m_areFullscreenControlsHidden { false }; |
1770 #endif | 1775 #endif |
1771 | 1776 |
1772 HashSet<HTMLPictureElement*> m_viewportDependentPictures; | 1777 HashSet<HTMLPictureElement*> m_viewportDependentPictures; |
1773 | 1778 |
1774 #if ENABLE(INTERSECTION_OBSERVER) | 1779 #if ENABLE(INTERSECTION_OBSERVER) |
1775 HashSet<Element*> m_intersectionObserverTargets; | 1780 HashSet<IntersectionObserver*> m_activeIntersectionObservers; |
| 1781 HashSet<IntersectionObserver*> m_viewportIntersectionObservers; |
1776 Timer m_intersectionObserversNotifyTimer; | 1782 Timer m_intersectionObserversNotifyTimer; |
1777 #endif | 1783 #endif |
1778 | 1784 |
1779 Timer m_loadEventDelayTimer; | 1785 Timer m_loadEventDelayTimer; |
1780 | 1786 |
1781 ViewportArguments m_viewportArguments; | 1787 ViewportArguments m_viewportArguments; |
1782 std::optional<ViewportArguments> m_overrideViewportArguments; | 1788 std::optional<ViewportArguments> m_overrideViewportArguments; |
1783 OptionSet<DisabledAdaptations> m_disabledAdaptations; | 1789 OptionSet<DisabledAdaptations> m_disabledAdaptations; |
1784 | 1790 |
1785 DocumentTiming m_documentTiming; | 1791 DocumentTiming m_documentTiming; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1867 String m_cachedDOMCookies; | 1873 String m_cachedDOMCookies; |
1868 | 1874 |
1869 HashSet<RefPtr<Element>> m_associatedFormControls; | 1875 HashSet<RefPtr<Element>> m_associatedFormControls; |
1870 unsigned m_disabledFieldsetElementsCount { 0 }; | 1876 unsigned m_disabledFieldsetElementsCount { 0 }; |
1871 | 1877 |
1872 unsigned m_listenerTypes { 0 }; | 1878 unsigned m_listenerTypes { 0 }; |
1873 unsigned m_referencingNodeCount { 0 }; | 1879 unsigned m_referencingNodeCount { 0 }; |
1874 int m_loadEventDelayCount { 0 }; | 1880 int m_loadEventDelayCount { 0 }; |
1875 unsigned m_lastStyleUpdateSizeForTesting { 0 }; | 1881 unsigned m_lastStyleUpdateSizeForTesting { 0 }; |
1876 | 1882 |
1877 // https://html.spec.whatwg.org/multipage/webappapis.html#ignore-destructive
-writes-counter | 1883 // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#thro
w-on-dynamic-markup-insertion-counter |
| 1884 unsigned m_throwOnDynamicMarkupInsertionCount { 0 }; |
| 1885 |
| 1886 // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#igno
re-opens-during-unload-counter |
| 1887 unsigned m_ignoreOpensDuringUnloadCount { 0 }; |
| 1888 |
| 1889 // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#igno
re-destructive-writes-counter |
1878 unsigned m_ignoreDestructiveWriteCount { 0 }; | 1890 unsigned m_ignoreDestructiveWriteCount { 0 }; |
1879 | |
1880 // https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-durin
g-unload-counter | |
1881 unsigned m_ignoreOpensDuringUnloadCount { 0 }; | |
1882 | 1891 |
1883 unsigned m_activeParserCount { 0 }; | 1892 unsigned m_activeParserCount { 0 }; |
1884 unsigned m_styleRecalcCount { 0 }; | 1893 unsigned m_styleRecalcCount { 0 }; |
1885 | 1894 |
1886 unsigned m_writeRecursionDepth { 0 }; | 1895 unsigned m_writeRecursionDepth { 0 }; |
1887 | 1896 |
1888 InheritedBool m_designMode { inherit }; | 1897 InheritedBool m_designMode { inherit }; |
1889 MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying }; | 1898 MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying }; |
1890 bool m_userHasInteractedWithMediaElement { false }; | 1899 bool m_userHasInteractedWithMediaElement { false }; |
1891 PageCacheState m_pageCacheState { NotInPageCache }; | 1900 PageCacheState m_pageCacheState { NotInPageCache }; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 { | 2032 { |
2024 return &document().contextDocument(); | 2033 return &document().contextDocument(); |
2025 } | 2034 } |
2026 | 2035 |
2027 } // namespace WebCore | 2036 } // namespace WebCore |
2028 | 2037 |
2029 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Document) | 2038 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Document) |
2030 static bool isType(const WebCore::ScriptExecutionContext& context) { return
context.isDocument(); } | 2039 static bool isType(const WebCore::ScriptExecutionContext& context) { return
context.isDocument(); } |
2031 static bool isType(const WebCore::Node& node) { return node.isDocumentNode()
; } | 2040 static bool isType(const WebCore::Node& node) { return node.isDocumentNode()
; } |
2032 SPECIALIZE_TYPE_TRAITS_END() | 2041 SPECIALIZE_TYPE_TRAITS_END() |
LEFT | RIGHT |