diff --git a/toolkit/content/tests/chrome/test_bug418874.xul b/toolkit/content/tests/chrome/test_bug418874.xul
index 78aa0a6a8db..6b29371186b 100644
--- a/toolkit/content/tests/chrome/test_bug418874.xul
+++ b/toolkit/content/tests/chrome/test_bug418874.xul
@@ -68,8 +68,6 @@
diff --git a/toolkit/content/tests/widgets/test_textbox_emptytext.xul b/toolkit/content/tests/widgets/test_textbox_emptytext.xul
index 45cfc1e1ea9..e79b1776a0b 100644
--- a/toolkit/content/tests/widgets/test_textbox_emptytext.xul
+++ b/toolkit/content/tests/widgets/test_textbox_emptytext.xul
@@ -43,16 +43,13 @@ function doTests() {
ok("1" === t1.emptyText, "emptyText persists after setting value");
t1.value = "";
- // More tests after a timeout, because the emptyText is displayed asynchronously.
- setTimeout(function () {
- is(t1.inputField.value, 1, "emptyText is displayed");
- is(t1.textLength, 0, "textLength while emptyText is displayed");
+ is(t1.inputField.value, 1, "emptyText is displayed");
+ is(t1.textLength, 0, "textLength while emptyText is displayed");
- t1.focus();
- is(t1.inputField.value, "", "emptyText is not displayed as the textbox has focus");
+ t1.focus();
+ is(t1.inputField.value, "", "emptyText is not displayed as the textbox has focus");
- SimpleTest.finish();
- }, 100);
+ SimpleTest.finish();
}
]]>
diff --git a/toolkit/content/widgets/textbox.xml b/toolkit/content/widgets/textbox.xml
index 320ac6c2d6f..266501b9790 100644
--- a/toolkit/content/widgets/textbox.xml
+++ b/toolkit/content/widgets/textbox.xml
@@ -164,23 +164,24 @@
@@ -204,13 +205,8 @@
this.boxObject.removeProperty("value");
}
- // this.editor may not be initialized yet in
- // bindings that inherit from xul:textbox, so
- // do this after construction
- setTimeout(function (a) {
- a._updateVisibleText();
- a._setNewlineHandling();
- }, 0, this);
+ this._updateVisibleText();
+ this._setNewlineHandling();
]]>
@@ -226,27 +222,34 @@
diff --git a/toolkit/content/xul.css b/toolkit/content/xul.css
index 888dafabffc..867d5e7556b 100644
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -658,6 +658,11 @@ html|*.textbox-textarea {
text-shadow: inherit;
}
+textbox[empty="true"] html|*.textbox-input[emptytextdelay="true"] ,
+textbox[empty="true"] html|*.textbox-textarea[emptytextdelay="true"] {
+ color: transparent !important;
+}
+
.textbox-input-box {
-moz-binding: url("chrome://global/content/bindings/textbox.xml#input-box");
}