summaryrefslogtreecommitdiffstats
path: root/layout
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 /layout
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 'layout')
-rw-r--r--layout/base/nsDocumentViewer.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp
index 5478c61b0..8baf1a464 100644
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -998,6 +998,9 @@ nsDocumentViewer::LoadComplete(nsresult aStatus)
// will depend on whether it's cached!
if(window &&
(NS_SUCCEEDED(aStatus) || aStatus == NS_ERROR_PARSED_DATA_CACHED)) {
+ // If this code changes, the code in nsDocLoader::DocLoaderIsEmpty
+ // that fires load events for document.open() cases might need to
+ // be updated too.
nsEventStatus status = nsEventStatus_eIgnore;
WidgetEvent event(true, eLoad);
event.mFlags.mBubbles = false;
@@ -1063,7 +1066,9 @@ nsDocumentViewer::LoadComplete(nsresult aStatus)
MakeUnique<DocLoadingTimelineMarker>("document::Load"));
}
+ d->SetLoadEventFiring(true);
EventDispatcher::Dispatch(window, mPresContext, &event, nullptr, &status);
+ d->SetLoadEventFiring(false);
if (timing) {
timing->NotifyLoadEventEnd();
}