From e3f2bb3ea42ba40b5771cc03e5e9d5feda915d2e Mon Sep 17 00:00:00 2001 From: "jst%mozilla.org" Date: Thu, 8 Jan 2009 07:47:04 +0000 Subject: [PATCH] Landing fix for bug 441930. Page refresh of textarea disabled through JS fails to display content. Patch by bnewman@mozilla.com, r+sr=bzbarsky@mit.edu, a=dveditz@cruzio.com git-svn-id: svn://10.0.0.236/trunk@255768 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/src/nsHTMLTextAreaElement.cpp | 5 ++-- mozilla/content/html/content/test/Makefile.in | 2 ++ .../html/content/test/bug441930_iframe.html | 27 +++++++++++++++++ .../html/content/test/test_bug441930.html | 30 +++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 mozilla/content/html/content/test/bug441930_iframe.html create mode 100644 mozilla/content/html/content/test/test_bug441930.html diff --git a/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp b/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp index 08f64386175..8a5b9c2257b 100644 --- a/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -948,8 +948,9 @@ nsHTMLTextAreaElement::RestoreState(nsPresState* aState) nsAutoString value; nsresult rv = aState->GetStateProperty(NS_LITERAL_STRING("value"), value); - NS_ASSERTION(NS_SUCCEEDED(rv), "value restore failed!"); - SetValue(value); + if (rv == NS_STATE_PROPERTY_EXISTS) { + SetValue(value); + } nsAutoString disabled; rv = aState->GetStateProperty(NS_LITERAL_STRING("disabled"), disabled); diff --git a/mozilla/content/html/content/test/Makefile.in b/mozilla/content/html/content/test/Makefile.in index 834f57642d6..d4df9efeee1 100644 --- a/mozilla/content/html/content/test/Makefile.in +++ b/mozilla/content/html/content/test/Makefile.in @@ -115,6 +115,8 @@ _TEST_FILES = test_bug589.html \ test_bug421640.html \ test_bug430351.html \ test_bug430392.html \ + bug441930_iframe.html \ + test_bug441930.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/mozilla/content/html/content/test/bug441930_iframe.html b/mozilla/content/html/content/test/bug441930_iframe.html new file mode 100644 index 00000000000..532cd5c36ab --- /dev/null +++ b/mozilla/content/html/content/test/bug441930_iframe.html @@ -0,0 +1,27 @@ + + + The content of this textarea should not disappear on page reload:
+ + + + diff --git a/mozilla/content/html/content/test/test_bug441930.html b/mozilla/content/html/content/test/test_bug441930.html new file mode 100644 index 00000000000..bc5eb85f96b --- /dev/null +++ b/mozilla/content/html/content/test/test_bug441930.html @@ -0,0 +1,30 @@ + + + + + Test for Bug 441930 + + + + + +Mozilla Bug 441930 +
+
+
+

+ +

+ + + +