Back out changeset 905ba2a1095a (bug 597525) because it breaks accessibility tests
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 22 Mar 2011 17:42:45 -0400
changeset 63657 9c0816e8ad5664491b1a7d02ae23fd0d0335217e
parent 63656 3803428ad6414a184a950f603e439c6d306f67fb
child 63658 9a935a225b1a30b3d49152f9e86d6188cb2f902a
child 63659 1d50cf645e9aed89d65cbf7535fa3f5d4a118b48
push id19248
push usereakhgari@mozilla.com
push dateWed, 23 Mar 2011 23:19:35 +0000
treeherdermozilla-central@ab95ab9e389b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs597525
milestone2.0b13pre
backs out905ba2a1095a85ad14451d760b72a29af75e1edb
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out changeset 905ba2a1095a (bug 597525) because it breaks accessibility tests
content/html/content/src/nsHTMLTextAreaElement.cpp
content/html/content/src/nsTextEditorState.cpp
content/html/content/src/nsTextEditorState.h
--- a/content/html/content/src/nsHTMLTextAreaElement.cpp
+++ b/content/html/content/src/nsHTMLTextAreaElement.cpp
@@ -588,16 +588,19 @@ nsHTMLTextAreaElement::SetUserInput(cons
 }
 
 NS_IMETHODIMP
 nsHTMLTextAreaElement::SetValueChanged(PRBool aValueChanged)
 {
   PRBool previousValue = mValueChanged;
 
   mValueChanged = aValueChanged;
+  if (!aValueChanged && !mState->IsEmpty()) {
+    mState->EmptyValue();
+  }
 
   if (mValueChanged != previousValue) {
     nsEventStates states = NS_EVENT_STATE_MOZ_UI_VALID |
                            NS_EVENT_STATE_MOZ_UI_INVALID;
 
     if (HasAttr(kNameSpaceID_None, nsGkAtoms::placeholder)) {
       states |= NS_EVENT_STATE_MOZ_PLACEHOLDER;
     }
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -1713,17 +1713,19 @@ nsTextEditorState::GetValue(nsAString& a
                               aValue);
     }
     if (canCache) {
       mCachedValue = aValue;
     } else {
       mCachedValue.Truncate();
     }
   } else {
-    if (mValue) {
+    if (!mTextCtrlElement->ValueChanged() || !mValue) {
+      mTextCtrlElement->GetDefaultValueFromContent(aValue);
+    } else {
       aValue = NS_ConvertUTF8toUTF16(*mValue);
     }
   }
 }
 
 void
 nsTextEditorState::SetValue(const nsAString& aValue, PRBool aUserInput)
 {
--- a/content/html/content/src/nsTextEditorState.h
+++ b/content/html/content/src/nsTextEditorState.h
@@ -153,16 +153,18 @@ public:
   nsFrameSelection* GetConstFrameSelection();
   nsresult BindToFrame(nsTextControlFrame* aFrame);
   void UnbindFromFrame(nsTextControlFrame* aFrame);
   nsresult PrepareEditor(const nsAString *aValue = nsnull);
   void InitializeKeyboardEventListeners();
 
   void SetValue(const nsAString& aValue, PRBool aUserInput);
   void GetValue(nsAString& aValue, PRBool aIgnoreWrap) const;
+  void EmptyValue() { if (mValue) mValue->Truncate(); }
+  PRBool IsEmpty() const { return mValue ? mValue->IsEmpty() : PR_TRUE; }
 
   nsresult CreatePlaceholderNode();
 
   nsIContent* GetRootNode() {
     if (!mRootNode)
       CreateRootNode();
     return mRootNode;
   }