Bug 597525 - Remove GetDefaultValueFromContent method; r=ehsan
☠☠ backed out by 9c0816e8ad56 ☠ ☠
authorMounir Lamouri <mounir.lamouri@gmail.com>
Thu, 02 Dec 2010 02:39:46 +0100
changeset 63654 905ba2a1095a85ad14451d760b72a29af75e1edb
parent 63653 4203ab3adfde6258a261f5504a422667998c9999
child 63655 d0742b0dfa151c1a0bfed82465629f24dbb2e503
push idunknown
push userunknown
push dateunknown
reviewersehsan
bugs597525
milestone2.0b13pre
Bug 597525 - Remove GetDefaultValueFromContent method; r=ehsan
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,19 +588,16 @@ 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,19 +1713,17 @@ nsTextEditorState::GetValue(nsAString& a
                               aValue);
     }
     if (canCache) {
       mCachedValue = aValue;
     } else {
       mCachedValue.Truncate();
     }
   } else {
-    if (!mTextCtrlElement->ValueChanged() || !mValue) {
-      mTextCtrlElement->GetDefaultValueFromContent(aValue);
-    } else {
+    if (mValue) {
       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,18 +153,16 @@ 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;
   }