summaryrefslogtreecommitdiffstats
path: root/dom/base/nsDocument.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2019-12-28 10:14:29 +0000
committerGitHub <noreply@github.com>2019-12-28 10:14:29 +0000
commit357405f6356e28e5fa94cecc078b65c20433d236 (patch)
tree9716965ca2d9d03446fc9290d37e5ef42f80558e /dom/base/nsDocument.h
parentf60bbaf9e49733e61aaec675276fcd898ef6bc73 (diff)
parent8b88623463bf30ae7e5fcc64ef7d8d5fb62354c9 (diff)
downloadUXP-357405f6356e28e5fa94cecc078b65c20433d236.tar
UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.gz
UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.lz
UXP-357405f6356e28e5fa94cecc078b65c20433d236.tar.xz
UXP-357405f6356e28e5fa94cecc078b65c20433d236.zip
Merge pull request #1335 from MoonchildProductions/document_open
Align document.open() with the overhauled specification
Diffstat (limited to 'dom/base/nsDocument.h')
-rw-r--r--dom/base/nsDocument.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h
index ac600eb43..8ea4993f0 100644
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -704,7 +704,11 @@ public:
virtual void BeginLoad() override;
virtual void EndLoad() override;
- virtual void SetReadyStateInternal(ReadyState rs) override;
+ // Set the readystate of the document. If updateTimingInformation is true,
+ // this will record relevant timestamps in the document's performance timing.
+ // Some consumers like document.open() don't want to do that.
+ virtual void SetReadyStateInternal(ReadyState rs,
+ bool updateTimingInformation = true) override;
virtual void ContentStateChanged(nsIContent* aContent,
mozilla::EventStates aStateMask)
@@ -916,6 +920,14 @@ public:
UpdateFrameRequestCallbackSchedulingState();
}
+ void SetLoadEventFiring(bool aFiring) override { mLoadEventFiring = aFiring; }
+
+ bool SkipLoadEventAfterClose() override {
+ bool skip = mSkipLoadEventAfterClose;
+ mSkipLoadEventAfterClose = false;
+ return skip;
+ }
+
virtual nsIDocument* GetTemplateContentsOwner() override;
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsDocument,
@@ -1255,6 +1267,11 @@ protected:
*/
Element* GetTitleElement();
+ /**
+ * Perform tree disconnection needed by ResetToURI and document.open()
+ */
+ void DisconnectNodeTree();
+
public:
// Get our title
virtual void GetTitle(nsString& aTitle) override;
@@ -1458,6 +1475,20 @@ public:
// additional sheets and sheets from the nsStyleSheetService.
bool mStyleSetFilled:1;
+ // The HTML spec has a "iframe load in progress" flag, but that doesn't seem
+ // to have the right semantics. See <https://github.com/whatwg/html/issues/4292>.
+ // What we have instead is a flag that is set while the window's 'load' event is
+ // firing if this document is the window's document.
+ bool mLoadEventFiring : 1;
+
+ // The HTML spec has a "mute iframe load" flag, but that doesn't seem to have
+ // the right semantics. See <https://github.com/whatwg/html/issues/4292>.
+ // What we have instead is a flag that is set if completion of our document
+ // via document.close() should skip firing the load event. Note that this
+ // flag is only relevant for HTML documents, but lives here for reasons that
+ // are documented above on SkipLoadEventAfterClose().
+ bool mSkipLoadEventAfterClose : 1;
+
uint8_t mPendingFullscreenRequests;
uint8_t mXMLDeclarationBits;
@@ -1615,11 +1646,6 @@ private:
// Set to true when the document is possibly controlled by the ServiceWorker.
// Used to prevent multiple requests to ServiceWorkerManager.
bool mMaybeServiceWorkerControlled;
-
-#ifdef DEBUG
-public:
- bool mWillReparent;
-#endif
};
class nsDocumentOnStack