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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 #if ENABLE(WEBGL2) | 314 #if ENABLE(WEBGL2) |
315 RefPtr<WebGL2RenderingContext>, | 315 RefPtr<WebGL2RenderingContext>, |
316 #endif | 316 #endif |
317 #if ENABLE(WEBGPU) | 317 #if ENABLE(WEBGPU) |
318 RefPtr<WebGPURenderingContext>, | 318 RefPtr<WebGPURenderingContext>, |
319 #endif | 319 #endif |
320 RefPtr<ImageBitmapRenderingContext>, | 320 RefPtr<ImageBitmapRenderingContext>, |
321 RefPtr<CanvasRenderingContext2D> | 321 RefPtr<CanvasRenderingContext2D> |
322 >; | 322 >; |
323 | 323 |
| 324 class DocumentParserYieldToken { |
| 325 public: |
| 326 WEBCORE_EXPORT DocumentParserYieldToken(Document&); |
| 327 WEBCORE_EXPORT ~DocumentParserYieldToken(); |
| 328 |
| 329 private: |
| 330 WeakPtr<Document> m_document; |
| 331 }; |
| 332 |
324 class Document | 333 class Document |
325 : public ContainerNode | 334 : public ContainerNode |
326 , public TreeScope | 335 , public TreeScope |
327 , public ScriptExecutionContext | 336 , public ScriptExecutionContext |
328 , public FontSelectorClient | 337 , public FontSelectorClient |
329 , public CanMakeWeakPtr<Document> | 338 , public CanMakeWeakPtr<Document> |
330 , public FrameDestructionObserver | 339 , public FrameDestructionObserver |
331 , public Supplementable<Document> | 340 , public Supplementable<Document> |
332 , public Logger::Observer { | 341 , public Logger::Observer { |
333 WTF_MAKE_ISO_ALLOCATED(Document); | 342 WTF_MAKE_ISO_ALLOCATED(Document); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 String suggestedMIMEType() const; | 472 String suggestedMIMEType() const; |
464 | 473 |
465 void overrideMIMEType(const String&); | 474 void overrideMIMEType(const String&); |
466 WEBCORE_EXPORT String contentType() const; | 475 WEBCORE_EXPORT String contentType() const; |
467 | 476 |
468 String contentLanguage() const { return m_contentLanguage; } | 477 String contentLanguage() const { return m_contentLanguage; } |
469 void setContentLanguage(const String&); | 478 void setContentLanguage(const String&); |
470 | 479 |
471 String xmlEncoding() const { return m_xmlEncoding; } | 480 String xmlEncoding() const { return m_xmlEncoding; } |
472 String xmlVersion() const { return m_xmlVersion; } | 481 String xmlVersion() const { return m_xmlVersion; } |
473 enum StandaloneStatus { StandaloneUnspecified, Standalone, NotStandalone }; | 482 enum class StandaloneStatus : uint8_t { Unspecified, Standalone, NotStandalo
ne }; |
474 bool xmlStandalone() const { return m_xmlStandalone == Standalone; } | 483 bool xmlStandalone() const { return m_xmlStandalone == StandaloneStatus::Sta
ndalone; } |
475 StandaloneStatus xmlStandaloneStatus() const { return m_xmlStandalone; } | 484 StandaloneStatus xmlStandaloneStatus() const { return m_xmlStandalone; } |
476 bool hasXMLDeclaration() const { return m_hasXMLDeclaration; } | 485 bool hasXMLDeclaration() const { return m_hasXMLDeclaration; } |
477 | 486 |
478 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 |
479 WEBCORE_EXPORT ExceptionOr<void> setXMLVersion(const String&); | 488 WEBCORE_EXPORT ExceptionOr<void> setXMLVersion(const String&); |
480 WEBCORE_EXPORT void setXMLStandalone(bool); | 489 WEBCORE_EXPORT void setXMLStandalone(bool); |
481 void setHasXMLDeclaration(bool hasXMLDeclaration) { m_hasXMLDeclaration = ha
sXMLDeclaration; } | 490 void setHasXMLDeclaration(bool hasXMLDeclaration) { m_hasXMLDeclaration = ha
sXMLDeclaration; } |
482 | 491 |
483 String documentURI() const { return m_documentURI; } | 492 String documentURI() const { return m_documentURI; } |
484 WEBCORE_EXPORT void setDocumentURI(const String&); | 493 WEBCORE_EXPORT void setDocumentURI(const String&); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 void setStateForNewFormElements(const Vector<String>&); | 559 void setStateForNewFormElements(const Vector<String>&); |
551 | 560 |
552 WEBCORE_EXPORT FrameView* view() const; // can be NULL | 561 WEBCORE_EXPORT FrameView* view() const; // can be NULL |
553 WEBCORE_EXPORT Page* page() const; // can be NULL | 562 WEBCORE_EXPORT Page* page() const; // can be NULL |
554 const Settings& settings() const { return m_settings.get(); } | 563 const Settings& settings() const { return m_settings.get(); } |
555 Settings& mutableSettings() { return m_settings.get(); } | 564 Settings& mutableSettings() { return m_settings.get(); } |
556 | 565 |
557 float deviceScaleFactor() const; | 566 float deviceScaleFactor() const; |
558 | 567 |
559 bool useSystemAppearance() const; | 568 bool useSystemAppearance() const; |
560 bool useDefaultAppearance() const; | 569 bool useDarkAppearance() const; |
| 570 |
561 OptionSet<StyleColor::Options> styleColorOptions() const; | 571 OptionSet<StyleColor::Options> styleColorOptions() const; |
562 | 572 |
563 WEBCORE_EXPORT Ref<Range> createRange(); | 573 WEBCORE_EXPORT Ref<Range> createRange(); |
564 | 574 |
565 // The last bool parameter is for ObjC bindings. | 575 // The last bool parameter is for ObjC bindings. |
566 WEBCORE_EXPORT Ref<NodeIterator> createNodeIterator(Node& root, unsigned lon
g whatToShow = 0xFFFFFFFF, RefPtr<NodeFilter>&& = nullptr, bool = false); | 576 WEBCORE_EXPORT Ref<NodeIterator> createNodeIterator(Node& root, unsigned lon
g whatToShow = 0xFFFFFFFF, RefPtr<NodeFilter>&& = nullptr, bool = false); |
567 | 577 |
568 // The last bool parameter is for ObjC bindings. | 578 // The last bool parameter is for ObjC bindings. |
569 WEBCORE_EXPORT Ref<TreeWalker> createTreeWalker(Node& root, unsigned long wh
atToShow = 0xFFFFFFFF, RefPtr<NodeFilter>&& = nullptr, bool = false); | 579 WEBCORE_EXPORT Ref<TreeWalker> createTreeWalker(Node& root, unsigned long wh
atToShow = 0xFFFFFFFF, RefPtr<NodeFilter>&& = nullptr, bool = false); |
570 | 580 |
(...skipping 29 matching lines...) Expand all Loading... |
600 WEBCORE_EXPORT void pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageS
ize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft); | 610 WEBCORE_EXPORT void pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageS
ize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft); |
601 | 611 |
602 CachedResourceLoader& cachedResourceLoader() { return m_cachedResourceLoader
; } | 612 CachedResourceLoader& cachedResourceLoader() { return m_cachedResourceLoader
; } |
603 | 613 |
604 void didBecomeCurrentDocumentInFrame(); | 614 void didBecomeCurrentDocumentInFrame(); |
605 void destroyRenderTree(); | 615 void destroyRenderTree(); |
606 void prepareForDestruction(); | 616 void prepareForDestruction(); |
607 | 617 |
608 // Override ScriptExecutionContext methods to do additional work | 618 // Override ScriptExecutionContext methods to do additional work |
609 WEBCORE_EXPORT bool shouldBypassMainWorldContentSecurityPolicy() const final
; | 619 WEBCORE_EXPORT bool shouldBypassMainWorldContentSecurityPolicy() const final
; |
610 void suspendActiveDOMObjects(ActiveDOMObject::ReasonForSuspension) final; | 620 void suspendActiveDOMObjects(ReasonForSuspension) final; |
611 void resumeActiveDOMObjects(ActiveDOMObject::ReasonForSuspension) final; | 621 void resumeActiveDOMObjects(ReasonForSuspension) final; |
612 void stopActiveDOMObjects() final; | 622 void stopActiveDOMObjects() final; |
613 | 623 |
614 void suspendDeviceMotionAndOrientationUpdates(); | 624 void suspendDeviceMotionAndOrientationUpdates(); |
615 void resumeDeviceMotionAndOrientationUpdates(); | 625 void resumeDeviceMotionAndOrientationUpdates(); |
616 | 626 |
617 RenderView* renderView() const { return m_renderView.get(); } | 627 RenderView* renderView() const { return m_renderView.get(); } |
618 | 628 |
619 bool renderTreeBeingDestroyed() const { return m_renderTreeBeingDestroyed; } | 629 bool renderTreeBeingDestroyed() const { return m_renderTreeBeingDestroyed; } |
620 bool hasLivingRenderTree() const { return renderView() && !renderTreeBeingDe
stroyed(); } | 630 bool hasLivingRenderTree() const { return renderView() && !renderTreeBeingDe
stroyed(); } |
621 ···· | 631 ···· |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 // domain. | 936 // domain. |
927 // | 937 // |
928 const URL& firstPartyForCookies() const { return m_firstPartyForCookies; } | 938 const URL& firstPartyForCookies() const { return m_firstPartyForCookies; } |
929 void setFirstPartyForCookies(const URL& url) { m_firstPartyForCookies = url;
} | 939 void setFirstPartyForCookies(const URL& url) { m_firstPartyForCookies = url;
} |
930 | 940 |
931 // The full URL corresponding to the "site for cookies" in the Same-Site Coo
kies spec., | 941 // The full URL corresponding to the "site for cookies" in the Same-Site Coo
kies spec., |
932 // <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>. It
is either | 942 // <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>. It
is either |
933 // the URL of the top-level document or the null URL depending on whether th
e registrable | 943 // the URL of the top-level document or the null URL depending on whether th
e registrable |
934 // domain of this document's URL matches the registrable domain of its paren
t's/opener's | 944 // domain of this document's URL matches the registrable domain of its paren
t's/opener's |
935 // URL. For the top-level document, it is set to the document's URL. | 945 // URL. For the top-level document, it is set to the document's URL. |
936 const URL& firstPartyForSameSiteCookies() const { return m_firstPartyForSame
SiteCookies; } | 946 const URL& siteForCookies() const { return m_siteForCookies; } |
937 void setFirstPartyForSameSiteCookies(const URL& url) { m_firstPartyForSameSi
teCookies = url; } | 947 void setSiteForCookies(const URL& url) { m_siteForCookies = url; } |
938 ···· | 948 ···· |
939 // The following implements the rule from HTML 4 for what valid names are. | 949 // The following implements the rule from HTML 4 for what valid names are. |
940 // To get this right for all the XML cases, we probably have to improve this
or move it | 950 // To get this right for all the XML cases, we probably have to improve this
or move it |
941 // and make it sensitive to the type of document. | 951 // and make it sensitive to the type of document. |
942 static bool isValidName(const String&); | 952 static bool isValidName(const String&); |
943 | 953 |
944 // The following breaks a qualified name into a prefix and a local name. | 954 // The following breaks a qualified name into a prefix and a local name. |
945 // It also does a validity check, and returns an error if the qualified name
is invalid. | 955 // It also does a validity check, and returns an error if the qualified name
is invalid. |
946 static ExceptionOr<std::pair<AtomicString, AtomicString>> parseQualifiedName
(const String& qualifiedName); | 956 static ExceptionOr<std::pair<AtomicString, AtomicString>> parseQualifiedName
(const String& qualifiedName); |
947 static ExceptionOr<QualifiedName> parseQualifiedName(const AtomicString& nam
espaceURI, const String& qualifiedName); | 957 static ExceptionOr<QualifiedName> parseQualifiedName(const AtomicString& nam
espaceURI, const String& qualifiedName); |
(...skipping 30 matching lines...) Expand all Loading... |
978 Document* parentDocument() const; | 988 Document* parentDocument() const; |
979 WEBCORE_EXPORT Document& topDocument() const; | 989 WEBCORE_EXPORT Document& topDocument() const; |
980 ···· | 990 ···· |
981 ScriptRunner* scriptRunner() { return m_scriptRunner.get(); } | 991 ScriptRunner* scriptRunner() { return m_scriptRunner.get(); } |
982 ScriptModuleLoader* moduleLoader() { return m_moduleLoader.get(); } | 992 ScriptModuleLoader* moduleLoader() { return m_moduleLoader.get(); } |
983 | 993 |
984 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEm
pty() ? m_currentScriptStack.last().get() : nullptr; } | 994 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEm
pty() ? m_currentScriptStack.last().get() : nullptr; } |
985 void pushCurrentScript(HTMLScriptElement*); | 995 void pushCurrentScript(HTMLScriptElement*); |
986 void popCurrentScript(); | 996 void popCurrentScript(); |
987 | 997 |
| 998 bool shouldDeferAsynchronousScriptsUntilParsingFinishes() const; |
| 999 |
988 #if ENABLE(XSLT) | 1000 #if ENABLE(XSLT) |
989 void scheduleToApplyXSLTransforms(); | 1001 void scheduleToApplyXSLTransforms(); |
990 void applyPendingXSLTransformsNowIfScheduled(); | 1002 void applyPendingXSLTransformsNowIfScheduled(); |
991 RefPtr<Document> transformSourceDocument() { return m_transformSourceDocumen
t; } | 1003 RefPtr<Document> transformSourceDocument() { return m_transformSourceDocumen
t; } |
992 void setTransformSourceDocument(Document* doc) { m_transformSourceDocument =
doc; } | 1004 void setTransformSourceDocument(Document* doc) { m_transformSourceDocument =
doc; } |
993 | 1005 |
994 void setTransformSource(std::unique_ptr<TransformSource>); | 1006 void setTransformSource(std::unique_ptr<TransformSource>); |
995 TransformSource* transformSource() const { return m_transformSource.get(); } | 1007 TransformSource* transformSource() const { return m_transformSource.get(); } |
996 #endif | 1008 #endif |
997 | 1009 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 | 1044 |
1033 PageCacheState pageCacheState() const { return m_pageCacheState; } | 1045 PageCacheState pageCacheState() const { return m_pageCacheState; } |
1034 void setPageCacheState(PageCacheState); | 1046 void setPageCacheState(PageCacheState); |
1035 | 1047 |
1036 // Elements can register themselves for the "suspend()" and | 1048 // Elements can register themselves for the "suspend()" and |
1037 // "resume()" callbacks | 1049 // "resume()" callbacks |
1038 void registerForDocumentSuspensionCallbacks(Element*); | 1050 void registerForDocumentSuspensionCallbacks(Element*); |
1039 void unregisterForDocumentSuspensionCallbacks(Element*); | 1051 void unregisterForDocumentSuspensionCallbacks(Element*); |
1040 | 1052 |
1041 void documentWillBecomeInactive(); | 1053 void documentWillBecomeInactive(); |
1042 void suspend(ActiveDOMObject::ReasonForSuspension); | 1054 void suspend(ReasonForSuspension); |
1043 void resume(ActiveDOMObject::ReasonForSuspension); | 1055 void resume(ReasonForSuspension); |
1044 | 1056 |
1045 void registerForMediaVolumeCallbacks(Element*); | 1057 void registerForMediaVolumeCallbacks(Element*); |
1046 void unregisterForMediaVolumeCallbacks(Element*); | 1058 void unregisterForMediaVolumeCallbacks(Element*); |
1047 void mediaVolumeDidChange(); | 1059 void mediaVolumeDidChange(); |
1048 | 1060 |
1049 bool audioPlaybackRequiresUserGesture() const; | 1061 bool audioPlaybackRequiresUserGesture() const; |
1050 bool videoPlaybackRequiresUserGesture() const; | 1062 bool videoPlaybackRequiresUserGesture() const; |
1051 | 1063 |
1052 #if ENABLE(MEDIA_SESSION) | 1064 #if ENABLE(MEDIA_SESSION) |
1053 MediaSession& defaultMediaSession(); | 1065 MediaSession& defaultMediaSession(); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 | 1259 |
1248 typedef std::pair<Region, bool> RegionFixedPair; | 1260 typedef std::pair<Region, bool> RegionFixedPair; |
1249 RegionFixedPair absoluteRegionForEventTargets(const EventTargetSet*); | 1261 RegionFixedPair absoluteRegionForEventTargets(const EventTargetSet*); |
1250 | 1262 |
1251 LayoutRect absoluteEventHandlerBounds(bool&) final; | 1263 LayoutRect absoluteEventHandlerBounds(bool&) final; |
1252 | 1264 |
1253 bool visualUpdatesAllowed() const { return m_visualUpdatesAllowed; } | 1265 bool visualUpdatesAllowed() const { return m_visualUpdatesAllowed; } |
1254 | 1266 |
1255 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } | 1267 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } |
1256 | 1268 |
1257 void suspendScheduledTasks(ActiveDOMObject::ReasonForSuspension); | 1269 void suspendScheduledTasks(ReasonForSuspension); |
1258 void resumeScheduledTasks(ActiveDOMObject::ReasonForSuspension); | 1270 void resumeScheduledTasks(ReasonForSuspension); |
1259 | 1271 |
1260 #if ENABLE(CSS_DEVICE_ADAPTATION) | 1272 #if ENABLE(CSS_DEVICE_ADAPTATION) |
1261 IntSize initialViewportSize() const; | 1273 IntSize initialViewportSize() const; |
1262 #endif | 1274 #endif |
1263 | 1275 |
1264 void convertAbsoluteToClientQuads(Vector<FloatQuad>&, const RenderStyle&); | 1276 void convertAbsoluteToClientQuads(Vector<FloatQuad>&, const RenderStyle&); |
1265 void convertAbsoluteToClientRects(Vector<FloatRect>&, const RenderStyle&); | 1277 void convertAbsoluteToClientRects(Vector<FloatRect>&, const RenderStyle&); |
1266 void convertAbsoluteToClientRect(FloatRect&, const RenderStyle&); | 1278 void convertAbsoluteToClientRect(FloatRect&, const RenderStyle&); |
1267 | 1279 |
1268 bool hasActiveParser(); | 1280 bool hasActiveParser(); |
1269 void incrementActiveParserCount() { ++m_activeParserCount; } | 1281 void incrementActiveParserCount() { ++m_activeParserCount; } |
1270 void decrementActiveParserCount(); | 1282 void decrementActiveParserCount(); |
| 1283 |
| 1284 std::unique_ptr<DocumentParserYieldToken> createParserYieldToken() |
| 1285 { |
| 1286 return std::make_unique<DocumentParserYieldToken>(*this); |
| 1287 } |
| 1288 |
| 1289 bool hasActiveParserYieldToken() const { return m_parserYieldTokenCount; } |
1271 | 1290 |
1272 DocumentSharedObjectPool* sharedObjectPool() { return m_sharedObjectPool.get
(); } | 1291 DocumentSharedObjectPool* sharedObjectPool() { return m_sharedObjectPool.get
(); } |
1273 | 1292 |
1274 void invalidateMatchedPropertiesCacheAndForceStyleRecalc(); | 1293 void invalidateMatchedPropertiesCacheAndForceStyleRecalc(); |
1275 | 1294 |
1276 void didRemoveAllPendingStylesheet(); | 1295 void didRemoveAllPendingStylesheet(); |
1277 void didClearStyleResolver(); | 1296 void didClearStyleResolver(); |
1278 | 1297 |
1279 bool inStyleRecalc() const { return m_inStyleRecalc; } | 1298 bool inStyleRecalc() const { return m_inStyleRecalc; } |
1280 bool inRenderTreeUpdate() const { return m_inRenderTreeUpdate; } | 1299 bool inRenderTreeUpdate() const { return m_inRenderTreeUpdate; } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 #endif | 1357 #endif |
1339 | 1358 |
1340 ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicyToPropagate() const
; | 1359 ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicyToPropagate() const
; |
1341 bool shouldEnforceContentDispositionAttachmentSandbox() const; | 1360 bool shouldEnforceContentDispositionAttachmentSandbox() const; |
1342 void applyContentDispositionAttachmentSandbox(); | 1361 void applyContentDispositionAttachmentSandbox(); |
1343 | 1362 |
1344 void addViewportDependentPicture(HTMLPictureElement&); | 1363 void addViewportDependentPicture(HTMLPictureElement&); |
1345 void removeViewportDependentPicture(HTMLPictureElement&); | 1364 void removeViewportDependentPicture(HTMLPictureElement&); |
1346 | 1365 |
1347 #if ENABLE(INTERSECTION_OBSERVER) | 1366 #if ENABLE(INTERSECTION_OBSERVER) |
1348 void addToIntersectionObserverTargets(Element&); | 1367 void activateIntersectionObserver(IntersectionObserver&); |
1349 void removeFromIntersectionObserverTargets(Element&); | 1368 bool deactivateIntersectionObserver(IntersectionObserver&); |
| 1369 unsigned numberOfActiveIntersectionObservers() const { return m_activeInters
ectionObservers.size(); } |
| 1370 void addViewportIntersectionObserver(IntersectionObserver&); |
| 1371 void removeViewportIntersectionObserver(IntersectionObserver&); |
1350 void updateIntersectionObservations(); | 1372 void updateIntersectionObservations(); |
1351 #endif | 1373 #endif |
1352 | 1374 |
1353 #if ENABLE(MEDIA_STREAM) | 1375 #if ENABLE(MEDIA_STREAM) |
1354 void setHasCaptureMediaStreamTrack() { m_hasHadCaptureMediaStreamTrack = tru
e; } | 1376 void setHasCaptureMediaStreamTrack() { m_hasHadCaptureMediaStreamTrack = tru
e; } |
1355 bool hasHadCaptureMediaStreamTrack() const { return m_hasHadCaptureMediaStre
amTrack; } | 1377 bool hasHadCaptureMediaStreamTrack() const { return m_hasHadCaptureMediaStre
amTrack; } |
1356 void setDeviceIDHashSalt(const String& salt) { m_idHashSalt = salt; } | 1378 void setDeviceIDHashSalt(const String& salt) { m_idHashSalt = salt; } |
1357 String deviceIDHashSalt() const { return m_idHashSalt; } | 1379 String deviceIDHashSalt() const { return m_idHashSalt; } |
1358 void stopMediaCapture(); | 1380 void stopMediaCapture(); |
1359 void registerForMediaStreamStateChangeCallbacks(HTMLMediaElement&); | 1381 void registerForMediaStreamStateChangeCallbacks(HTMLMediaElement&); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 | 1470 |
1449 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) | 1471 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) |
1450 bool hasRequestedPageSpecificStorageAccessWithUserInteraction(const String&
primaryDomain); | 1472 bool hasRequestedPageSpecificStorageAccessWithUserInteraction(const String&
primaryDomain); |
1451 void setHasRequestedPageSpecificStorageAccessWithUserInteraction(const Strin
g& primaryDomain); | 1473 void setHasRequestedPageSpecificStorageAccessWithUserInteraction(const Strin
g& primaryDomain); |
1452 #endif | 1474 #endif |
1453 | 1475 |
1454 String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String
& challengeString, const URL&); | 1476 String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String
& challengeString, const URL&); |
1455 | 1477 |
1456 void consumeTemporaryTimeUserGesture(); | 1478 void consumeTemporaryTimeUserGesture(); |
1457 | 1479 |
| 1480 void registerArticleElement(Element&); |
| 1481 void unregisterArticleElement(Element&); |
| 1482 void updateMainArticleElementAfterLayout(); |
| 1483 bool hasMainArticleElement() const { return !!m_mainArticleElement; } |
| 1484 |
1458 protected: | 1485 protected: |
1459 enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 }; | 1486 enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 }; |
1460 Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned const
ructionFlags = 0); | 1487 Document(Frame*, const URL&, unsigned = DefaultDocumentClass, unsigned const
ructionFlags = 0); |
1461 | 1488 |
1462 void clearXMLVersion() { m_xmlVersion = String(); } | 1489 void clearXMLVersion() { m_xmlVersion = String(); } |
1463 | 1490 |
1464 virtual Ref<Document> cloneDocumentWithoutChildren() const; | 1491 virtual Ref<Document> cloneDocumentWithoutChildren() const; |
1465 | 1492 |
1466 private: | 1493 private: |
| 1494 friend class DocumentParserYieldToken; |
1467 friend class Node; | 1495 friend class Node; |
| 1496 friend class ThrowOnDynamicMarkupInsertionCountIncrementer; |
| 1497 friend class IgnoreOpensDuringUnloadCountIncrementer; |
1468 friend class IgnoreDestructiveWriteCountIncrementer; | 1498 friend class IgnoreDestructiveWriteCountIncrementer; |
1469 friend class IgnoreOpensDuringUnloadCountIncrementer; | |
1470 | 1499 |
1471 bool shouldInheritContentSecurityPolicyFromOwner() const; | 1500 bool shouldInheritContentSecurityPolicyFromOwner() const; |
1472 | 1501 |
1473 void detachFromFrame() { observeFrame(nullptr); } | 1502 void detachFromFrame() { observeFrame(nullptr); } |
1474 | 1503 |
1475 void updateTitleElement(Element& changingTitleElement); | 1504 void updateTitleElement(Element& changingTitleElement); |
1476 void frameDestroyed() final; | 1505 void frameDestroyed() final; |
1477 | 1506 |
1478 void commonTeardown(); | 1507 void commonTeardown(); |
1479 | 1508 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1554 const String& cachedDOMCookies() const { return m_cachedDOMCookies; } | 1583 const String& cachedDOMCookies() const { return m_cachedDOMCookies; } |
1555 void setCachedDOMCookies(const String&); | 1584 void setCachedDOMCookies(const String&); |
1556 bool isDOMCookieCacheValid() const { return m_cookieCacheExpiryTimer.isActiv
e(); } | 1585 bool isDOMCookieCacheValid() const { return m_cookieCacheExpiryTimer.isActiv
e(); } |
1557 void invalidateDOMCookieCache(); | 1586 void invalidateDOMCookieCache(); |
1558 void didLoadResourceSynchronously() final; | 1587 void didLoadResourceSynchronously() final; |
1559 | 1588 |
1560 void checkViewportDependentPictures(); | 1589 void checkViewportDependentPictures(); |
1561 | 1590 |
1562 #if ENABLE(INTERSECTION_OBSERVER) | 1591 #if ENABLE(INTERSECTION_OBSERVER) |
1563 // Return true if any need notifying. | 1592 // Return true if any need notifying. |
1564 bool updateIntersectionObserveration(IntersectionObserver&, double timeStamp
); | 1593 bool updateIntersectionObservation(IntersectionObserver&, double timeStamp); |
1565 void collectIntersectionObservers(HashSet<IntersectionObserver*>&); | |
1566 void notifyIntersectionObserversTimerFired(); | 1594 void notifyIntersectionObserversTimerFired(); |
1567 #endif | 1595 #endif |
1568 | 1596 |
1569 #if USE(QUICK_LOOK) | 1597 #if USE(QUICK_LOOK) |
1570 bool shouldEnforceQuickLookSandbox() const; | 1598 bool shouldEnforceQuickLookSandbox() const; |
1571 void applyQuickLookSandbox(); | 1599 void applyQuickLookSandbox(); |
1572 #endif | 1600 #endif |
1573 | 1601 |
1574 bool shouldEnforceHTTP09Sandbox() const; | 1602 bool shouldEnforceHTTP09Sandbox() const; |
1575 | 1603 |
1576 void platformSuspendOrStopActiveDOMObjects(); | 1604 void platformSuspendOrStopActiveDOMObjects(); |
1577 | 1605 |
1578 bool domainIsRegisterable(const String&) const; | 1606 bool domainIsRegisterable(const String&) const; |
1579 | 1607 |
1580 void enableTemporaryTimeUserGesture(); | 1608 void enableTemporaryTimeUserGesture(); |
1581 | 1609 |
1582 const Ref<Settings> m_settings; | 1610 const Ref<Settings> m_settings; |
1583 | 1611 |
1584 std::unique_ptr<StyleResolver> m_userAgentShadowTreeStyleResolver; | 1612 std::unique_ptr<StyleResolver> m_userAgentShadowTreeStyleResolver; |
1585 | 1613 |
1586 RefPtr<DOMWindow> m_domWindow; | 1614 RefPtr<DOMWindow> m_domWindow; |
1587 WeakPtr<Document> m_contextDocument; | 1615 WeakPtr<Document> m_contextDocument; |
1588 | 1616 |
1589 Ref<CachedResourceLoader> m_cachedResourceLoader; | 1617 Ref<CachedResourceLoader> m_cachedResourceLoader; |
1590 RefPtr<DocumentParser> m_parser; | 1618 RefPtr<DocumentParser> m_parser; |
| 1619 |
| 1620 unsigned m_parserYieldTokenCount { 0 }; |
1591 | 1621 |
1592 // Document URLs. | 1622 // Document URLs. |
1593 URL m_url; // Document.URL: The URL from which this document was retrieved. | 1623 URL m_url; // Document.URL: The URL from which this document was retrieved. |
1594 URL m_baseURL; // Node.baseURI: The URL to use when resolving relative URLs. | 1624 URL m_baseURL; // Node.baseURI: The URL to use when resolving relative URLs. |
1595 URL m_baseURLOverride; // An alternative base URL that takes precedence over
m_baseURL (but not m_baseElementURL). | 1625 URL m_baseURLOverride; // An alternative base URL that takes precedence over
m_baseURL (but not m_baseElementURL). |
1596 URL m_baseElementURL; // The URL set by the <base> element. | 1626 URL m_baseElementURL; // The URL set by the <base> element. |
1597 URL m_cookieURL; // The URL to use for cookie access. | 1627 URL m_cookieURL; // The URL to use for cookie access. |
1598 URL m_firstPartyForCookies; // The policy URL for third-party cookie blockin
g. | 1628 URL m_firstPartyForCookies; // The policy URL for third-party cookie blockin
g. |
1599 URL m_firstPartyForSameSiteCookies; // The policy URL for Same-Site cookies. | 1629 URL m_siteForCookies; // The policy URL for Same-Site cookies. |
1600 | 1630 |
1601 // Document.documentURI: | 1631 // Document.documentURI: |
1602 // Although URL-like, Document.documentURI can actually be set to any | 1632 // Although URL-like, Document.documentURI can actually be set to any |
1603 // string by content. Document.documentURI affects m_baseURL unless the | 1633 // string by content. Document.documentURI affects m_baseURL unless the |
1604 // document contains a <base> element, in which case the <base> element | 1634 // document contains a <base> element, in which case the <base> element |
1605 // takes precedence. | 1635 // takes precedence. |
1606 // | 1636 // |
1607 // This property is read-only from JavaScript, but writable from Objective C
. | 1637 // This property is read-only from JavaScript, but writable from Objective C
. |
1608 String m_documentURI; | 1638 String m_documentURI; |
1609 | 1639 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 void applyPendingXSLTransformsTimerFired(); | 1695 void applyPendingXSLTransformsTimerFired(); |
1666 | 1696 |
1667 std::unique_ptr<TransformSource> m_transformSource; | 1697 std::unique_ptr<TransformSource> m_transformSource; |
1668 RefPtr<Document> m_transformSourceDocument; | 1698 RefPtr<Document> m_transformSourceDocument; |
1669 Timer m_applyPendingXSLTransformsTimer; | 1699 Timer m_applyPendingXSLTransformsTimer; |
1670 bool m_hasPendingXSLTransforms { false }; | 1700 bool m_hasPendingXSLTransforms { false }; |
1671 #endif | 1701 #endif |
1672 | 1702 |
1673 String m_xmlEncoding; | 1703 String m_xmlEncoding; |
1674 String m_xmlVersion; | 1704 String m_xmlVersion; |
1675 StandaloneStatus m_xmlStandalone { StandaloneUnspecified }; | 1705 StandaloneStatus m_xmlStandalone { StandaloneStatus::Unspecified }; |
1676 bool m_hasXMLDeclaration { false }; | 1706 bool m_hasXMLDeclaration { false }; |
1677 | 1707 |
1678 String m_contentLanguage; | 1708 String m_contentLanguage; |
1679 | 1709 |
1680 RefPtr<TextResourceDecoder> m_decoder; | 1710 RefPtr<TextResourceDecoder> m_decoder; |
1681 | 1711 |
1682 HashSet<LiveNodeList*> m_listsInvalidatedAtDocument; | 1712 HashSet<LiveNodeList*> m_listsInvalidatedAtDocument; |
1683 HashSet<HTMLCollection*> m_collectionsInvalidatedAtDocument; | 1713 HashSet<HTMLCollection*> m_collectionsInvalidatedAtDocument; |
1684 unsigned m_nodeListAndCollectionCounts[numNodeListInvalidationTypes]; | 1714 unsigned m_nodeListAndCollectionCounts[numNodeListInvalidationTypes]; |
1685 | 1715 |
1686 RefPtr<XPathEvaluator> m_xpathEvaluator; | 1716 RefPtr<XPathEvaluator> m_xpathEvaluator; |
1687 | 1717 |
1688 std::unique_ptr<SVGDocumentExtensions> m_svgExtensions; | 1718 std::unique_ptr<SVGDocumentExtensions> m_svgExtensions; |
1689 HashSet<SVGUseElement*> m_svgUseElements; | 1719 HashSet<SVGUseElement*> m_svgUseElements; |
1690 | 1720 |
1691 #if ENABLE(DASHBOARD_SUPPORT) | 1721 #if ENABLE(DASHBOARD_SUPPORT) |
1692 Vector<AnnotatedRegionValue> m_annotatedRegions; | 1722 Vector<AnnotatedRegionValue> m_annotatedRegions; |
1693 bool m_hasAnnotatedRegions { false }; | 1723 bool m_hasAnnotatedRegions { false }; |
1694 bool m_annotatedRegionsDirty { false }; | 1724 bool m_annotatedRegionsDirty { false }; |
1695 #endif | 1725 #endif |
1696 | 1726 |
1697 HashMap<String, RefPtr<HTMLCanvasElement>> m_cssCanvasElements; | 1727 HashMap<String, RefPtr<HTMLCanvasElement>> m_cssCanvasElements; |
1698 | 1728 |
1699 HashSet<Element*> m_documentSuspensionCallbackElements; | 1729 HashSet<Element*> m_documentSuspensionCallbackElements; |
1700 HashSet<Element*> m_mediaVolumeCallbackElements; | 1730 HashSet<Element*> m_mediaVolumeCallbackElements; |
1701 HashSet<Element*> m_privateBrowsingStateChangedElements; | 1731 HashSet<Element*> m_privateBrowsingStateChangedElements; |
1702 #if ENABLE(VIDEO_TRACK) | 1732 #if ENABLE(VIDEO_TRACK) |
1703 HashSet<Element*> m_captionPreferencesChangedElements; | 1733 HashSet<Element*> m_captionPreferencesChangedElements; |
1704 #endif | 1734 #endif |
| 1735 |
| 1736 Element* m_mainArticleElement { nullptr }; |
| 1737 HashSet<Element*> m_articleElements; |
1705 | 1738 |
1706 #if ENABLE(MEDIA_CONTROLS_SCRIPT) | 1739 #if ENABLE(MEDIA_CONTROLS_SCRIPT) |
1707 HashSet<HTMLMediaElement*> m_pageScaleFactorChangedElements; | 1740 HashSet<HTMLMediaElement*> m_pageScaleFactorChangedElements; |
1708 HashSet<HTMLMediaElement*> m_userInterfaceLayoutDirectionChangedElements; | 1741 HashSet<HTMLMediaElement*> m_userInterfaceLayoutDirectionChangedElements; |
1709 #endif | 1742 #endif |
1710 | 1743 |
1711 HashSet<VisibilityChangeClient*> m_visibilityStateCallbackClients; | 1744 HashSet<VisibilityChangeClient*> m_visibilityStateCallbackClients; |
1712 #if ENABLE(VIDEO) | 1745 #if ENABLE(VIDEO) |
1713 HashSet<HTMLMediaElement*> m_allowsMediaDocumentInlinePlaybackElements; | 1746 HashSet<HTMLMediaElement*> m_allowsMediaDocumentInlinePlaybackElements; |
1714 #endif | 1747 #endif |
(...skipping 22 matching lines...) Expand all Loading... |
1737 std::unique_ptr<RenderStyle> m_savedPlaceholderRenderStyle; | 1770 std::unique_ptr<RenderStyle> m_savedPlaceholderRenderStyle; |
1738 | 1771 |
1739 bool m_areKeysEnabledInFullScreen { false }; | 1772 bool m_areKeysEnabledInFullScreen { false }; |
1740 bool m_isAnimatingFullScreen { false }; | 1773 bool m_isAnimatingFullScreen { false }; |
1741 bool m_areFullscreenControlsHidden { false }; | 1774 bool m_areFullscreenControlsHidden { false }; |
1742 #endif | 1775 #endif |
1743 | 1776 |
1744 HashSet<HTMLPictureElement*> m_viewportDependentPictures; | 1777 HashSet<HTMLPictureElement*> m_viewportDependentPictures; |
1745 | 1778 |
1746 #if ENABLE(INTERSECTION_OBSERVER) | 1779 #if ENABLE(INTERSECTION_OBSERVER) |
1747 HashSet<Element*> m_intersectionObserverTargets; | 1780 HashSet<IntersectionObserver*> m_activeIntersectionObservers; |
| 1781 HashSet<IntersectionObserver*> m_viewportIntersectionObservers; |
1748 Timer m_intersectionObserversNotifyTimer; | 1782 Timer m_intersectionObserversNotifyTimer; |
1749 #endif | 1783 #endif |
1750 | 1784 |
1751 Timer m_loadEventDelayTimer; | 1785 Timer m_loadEventDelayTimer; |
1752 | 1786 |
1753 ViewportArguments m_viewportArguments; | 1787 ViewportArguments m_viewportArguments; |
1754 std::optional<ViewportArguments> m_overrideViewportArguments; | 1788 std::optional<ViewportArguments> m_overrideViewportArguments; |
1755 OptionSet<DisabledAdaptations> m_disabledAdaptations; | 1789 OptionSet<DisabledAdaptations> m_disabledAdaptations; |
1756 | 1790 |
1757 DocumentTiming m_documentTiming; | 1791 DocumentTiming m_documentTiming; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 String m_cachedDOMCookies; | 1873 String m_cachedDOMCookies; |
1840 | 1874 |
1841 HashSet<RefPtr<Element>> m_associatedFormControls; | 1875 HashSet<RefPtr<Element>> m_associatedFormControls; |
1842 unsigned m_disabledFieldsetElementsCount { 0 }; | 1876 unsigned m_disabledFieldsetElementsCount { 0 }; |
1843 | 1877 |
1844 unsigned m_listenerTypes { 0 }; | 1878 unsigned m_listenerTypes { 0 }; |
1845 unsigned m_referencingNodeCount { 0 }; | 1879 unsigned m_referencingNodeCount { 0 }; |
1846 int m_loadEventDelayCount { 0 }; | 1880 int m_loadEventDelayCount { 0 }; |
1847 unsigned m_lastStyleUpdateSizeForTesting { 0 }; | 1881 unsigned m_lastStyleUpdateSizeForTesting { 0 }; |
1848 | 1882 |
1849 // 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 |
1850 unsigned m_ignoreDestructiveWriteCount { 0 }; | 1890 unsigned m_ignoreDestructiveWriteCount { 0 }; |
1851 | |
1852 // https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-durin
g-unload-counter | |
1853 unsigned m_ignoreOpensDuringUnloadCount { 0 }; | |
1854 | 1891 |
1855 unsigned m_activeParserCount { 0 }; | 1892 unsigned m_activeParserCount { 0 }; |
1856 unsigned m_styleRecalcCount { 0 }; | 1893 unsigned m_styleRecalcCount { 0 }; |
1857 | 1894 |
1858 unsigned m_writeRecursionDepth { 0 }; | 1895 unsigned m_writeRecursionDepth { 0 }; |
1859 | 1896 |
1860 InheritedBool m_designMode { inherit }; | 1897 InheritedBool m_designMode { inherit }; |
1861 MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying }; | 1898 MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying }; |
1862 bool m_userHasInteractedWithMediaElement { false }; | 1899 bool m_userHasInteractedWithMediaElement { false }; |
1863 PageCacheState m_pageCacheState { NotInPageCache }; | 1900 PageCacheState m_pageCacheState { NotInPageCache }; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 { | 2032 { |
1996 return &document().contextDocument(); | 2033 return &document().contextDocument(); |
1997 } | 2034 } |
1998 | 2035 |
1999 } // namespace WebCore | 2036 } // namespace WebCore |
2000 | 2037 |
2001 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Document) | 2038 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::Document) |
2002 static bool isType(const WebCore::ScriptExecutionContext& context) { return
context.isDocument(); } | 2039 static bool isType(const WebCore::ScriptExecutionContext& context) { return
context.isDocument(); } |
2003 static bool isType(const WebCore::Node& node) { return node.isDocumentNode()
; } | 2040 static bool isType(const WebCore::Node& node) { return node.isDocumentNode()
; } |
2004 SPECIALIZE_TYPE_TRAITS_END() | 2041 SPECIALIZE_TYPE_TRAITS_END() |
LEFT | RIGHT |