From 44d057623f9e1f230efad4031de9b069765fb275 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Sat, 21 Feb 2009 03:51:48 +0100 Subject: [PATCH] Reset the editing state when the document is removed from the docshell. b=446483 r+sr=peterv --- content/html/document/src/nsHTMLDocument.cpp | 7 +++ content/html/document/src/nsHTMLDocument.h | 2 + content/html/document/test/Makefile.in | 2 + .../html/document/test/bug446483-iframe.html | 10 +++++ .../html/document/test/test_bug446483.html | 44 +++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 content/html/document/test/bug446483-iframe.html create mode 100644 content/html/document/test/test_bug446483.html diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 9223c017eb4..2a85f478500 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -4154,3 +4154,10 @@ nsHTMLDocument::IsEditingOnAfterFlush() return IsEditingOn(); } + +void +nsHTMLDocument::RemovedFromDocShell() +{ + mEditingState = eOff; + nsDocument::RemovedFromDocShell(); +} diff --git a/content/html/document/src/nsHTMLDocument.h b/content/html/document/src/nsHTMLDocument.h index 03d110861fb..c931290fe85 100644 --- a/content/html/document/src/nsHTMLDocument.h +++ b/content/html/document/src/nsHTMLDocument.h @@ -235,6 +235,8 @@ public: virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; + virtual NS_HIDDEN_(void) RemovedFromDocShell(); + protected: nsresult GetBodySize(PRInt32* aWidth, PRInt32* aHeight); diff --git a/content/html/document/test/Makefile.in b/content/html/document/test/Makefile.in index de58252c511..6170ca830a9 100644 --- a/content/html/document/test/Makefile.in +++ b/content/html/document/test/Makefile.in @@ -81,6 +81,8 @@ _TEST_FILES = test_bug1682.html \ bug445004-outer-abs.html \ bug445004-outer-write.html \ bug445004-inner.html \ + test_bug446483.html \ + bug446483-iframe.html \ test_bug448564.html \ bug448564-iframe-1.html \ bug448564-iframe-2.html \ diff --git a/content/html/document/test/bug446483-iframe.html b/content/html/document/test/bug446483-iframe.html new file mode 100644 index 00000000000..fe5a6cf9f70 --- /dev/null +++ b/content/html/document/test/bug446483-iframe.html @@ -0,0 +1,10 @@ + + diff --git a/content/html/document/test/test_bug446483.html b/content/html/document/test/test_bug446483.html new file mode 100644 index 00000000000..de108d0ddda --- /dev/null +++ b/content/html/document/test/test_bug446483.html @@ -0,0 +1,44 @@ + + + + + Test for Bug 446483 + + + + + +Mozilla Bug 446483 +

+ + +

+ +
+
+
+ +