summaryrefslogtreecommitdiffstats
path: root/uriloader/base/nsDocLoader.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-12-22 19:57:30 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-12-22 19:57:30 +0100
commitdfa7af70ce4cd662add88f5e2a881e1054d91ef2 (patch)
treecde1088a23371942359540a12a0c70bf8a85ac50 /uriloader/base/nsDocLoader.h
parent54091ecab46c93c2e1b2c689e9179a980beaabe6 (diff)
downloadUXP-dfa7af70ce4cd662add88f5e2a881e1054d91ef2.tar
UXP-dfa7af70ce4cd662add88f5e2a881e1054d91ef2.tar.gz
UXP-dfa7af70ce4cd662add88f5e2a881e1054d91ef2.tar.lz
UXP-dfa7af70ce4cd662add88f5e2a881e1054d91ef2.tar.xz
UXP-dfa7af70ce4cd662add88f5e2a881e1054d91ef2.zip
Issue #1118 - Part 5: Change the way document.open() works
This changes the work we do for document.open() in the following ways: - We no longer create a new Window when doing document.open(). We use the same Window but remove all the event listeners on the existing DOM tree and Window before removing the document's existing children to provide a clean slate document to use for .write(). - We no longer create a session history entry (previously would be a wyciwyg URI). We now replace the current one, effectively losing the entry for the original document. - We now support document.open() on windowless documents.
Diffstat (limited to 'uriloader/base/nsDocLoader.h')
-rw-r--r--uriloader/base/nsDocLoader.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/uriloader/base/nsDocLoader.h b/uriloader/base/nsDocLoader.h
index 481b1397b..b469b8e07 100644
--- a/uriloader/base/nsDocLoader.h
+++ b/uriloader/base/nsDocLoader.h
@@ -109,6 +109,8 @@ public:
unsigned long mNotifyMask;
};
+ void SetDocumentOpenedButNotLoaded() { mDocumentOpenedButNotLoaded = true; }
+
protected:
virtual ~nsDocLoader();
@@ -302,6 +304,15 @@ protected:
bool mIsFlushingLayout;
private:
+ /**
+ * This flag indicates that the loader is waiting for completion of
+ * a document.open-triggered "document load". This is set when
+ * document.open() happens and sets up a new parser and cleared out
+ * when we go to fire our load event or end up with a new document
+ * channel.
+ */
+ bool mDocumentOpenedButNotLoaded;
+
static const PLDHashTableOps sRequestInfoHashOps;
// A list of kids that are in the middle of their onload calls and will let
@@ -324,10 +335,20 @@ private:
nsRequestInfo *GetRequestInfo(nsIRequest* aRequest);
void ClearRequestInfoHash();
int64_t CalculateMaxProgress();
-/// void DumpChannelInfo(void);
+ /// void DumpChannelInfo(void);
// used to clear our internal progress state between loads...
void ClearInternalProgress();
+
+ /**
+ * Used to test whether we might need to fire a load event. This
+ * can happen when we have a document load going on, or when we've
+ * had document.open() called and haven't fired the corresponding
+ * load event yet.
+ */
+ bool IsBlockingLoadEvent() const {
+ return mIsLoadingDocument || mDocumentOpenedButNotLoaded;
+ }
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsDocLoader, NS_THIS_DOCLOADER_IMPL_CID)