Backed out changeset 669fdba2ceef (bug 997805) for reftest bustage on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 25 Apr 2014 15:12:22 -0700
changeset 198848 7a633ff64906ef80a8fc5716f4f29d84fc1339d2
parent 198847 97fc047681a2e47741fe604119ee331eac531a1c
child 198849 7f9e0440e61948be00da4aea40bbeb635243feab
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs997805
milestone31.0a1
backs out669fdba2ceef8651844b672b1b3117e5386e54ce
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
Backed out changeset 669fdba2ceef (bug 997805) for reftest bustage on a CLOSED TREE
content/html/content/src/nsTextEditorState.cpp
editor/reftests/997805-ref.html
editor/reftests/997805.html
editor/reftests/reftest.list
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -1934,16 +1934,21 @@ nsTextEditorState::InitializeKeyboardEve
   }
 
   mSelCon->SetScrollableFrame(do_QueryFrame(mBoundFrame->GetFirstPrincipalChild()));
 }
 
 void
 nsTextEditorState::ValueWasChanged(bool aNotify)
 {
+  // placeholder management
+  if (!mPlaceholderDiv) {
+    return;
+  }
+
   UpdatePlaceholderVisibility(aNotify);
 }
 
 void
 nsTextEditorState::UpdatePlaceholderText(bool aNotify)
 {
   NS_ASSERTION(mPlaceholderDiv, "This function should not be called if "
                                 "mPlaceholderDiv isn't set");
@@ -1954,21 +1959,25 @@ nsTextEditorState::UpdatePlaceholderText
 
   nsAutoString placeholderValue;
 
   nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
   content->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, placeholderValue);
   nsContentUtils::RemoveNewlines(placeholderValue);
   NS_ASSERTION(mPlaceholderDiv->GetFirstChild(), "placeholder div has no child");
   mPlaceholderDiv->GetFirstChild()->SetText(placeholderValue, aNotify);
+  ValueWasChanged(aNotify);
 }
 
 void
 nsTextEditorState::UpdatePlaceholderVisibility(bool aNotify)
 {
+  NS_ASSERTION(mPlaceholderDiv, "This function should not be called if "
+                                "mPlaceholderDiv isn't set");
+
   nsAutoString value;
   GetValue(value, true);
 
   mPlaceholderVisibility = value.IsEmpty();
 
   if (mPlaceholderVisibility &&
       !Preferences::GetBool("dom.placeholder.show_on_focus", true)) {
     nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
deleted file mode 100644
--- a/editor/reftests/997805-ref.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<!DOCTYPE html>
-<textarea placeholder="placeholder"></textarea>
deleted file mode 100644
--- a/editor/reftests/997805.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-<textarea placeholder="placeholder"></textarea>
-<script>
-onload = function() {
-  var t = document.querySelector("textarea");
-  t.style.display = "none";
-  t.value = "test";
-  setTimeout(function() {
-    t.style.display = "";
-    t.value = "";
-    document.documentElement.className = "";
-  }, 0);
-};
-</script>
-</html>
--- a/editor/reftests/reftest.list
+++ b/editor/reftests/reftest.list
@@ -121,9 +121,8 @@ needs-focus == spellcheck-contenteditabl
 == spellcheck-contenteditable-attr-dynamic-inherit.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-property-dynamic.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-property-dynamic-inherit.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-attr-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-attr-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-property-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
 == spellcheck-contenteditable-property-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
 needs-focus == 969773.html 969773-ref.html
-== 997805.html 997805-ref.html