Backing out a patch that has been accidentally pushed with a merge. a=backout
authorMounir Lamouri <mounir.lamouri@gmail.com>
Fri, 15 Oct 2010 15:05:04 +0200
changeset 55862 19b35fde8b4dbaeaad343f131952eb904902c8db
parent 55861 eb674a183386b262da821e55846e85cd7a6d1476
child 55863 188670e40942536658cace813752c2b6cb85ca91
push idunknown
push userunknown
push dateunknown
reviewersbackout
milestone2.0b8pre
Backing out a patch that has been accidentally pushed with a merge. a=backout
browser/base/content/test/browser_bug561636.js
content/base/src/nsGkAtomList.h
content/html/content/src/nsIConstraintValidation.cpp
content/html/content/test/Makefile.in
content/html/content/test/test_bug600155.html
--- a/browser/base/content/test/browser_bug561636.js
+++ b/browser/base/content/test/browser_bug561636.js
@@ -350,60 +350,25 @@ function test9()
       checkPopupHide();
 
       // Clean-up
       Services.obs.removeObserver(gObserver, "invalidformsubmit");
       gObserver.notifyInvalidSubmit = function () {};
       gBrowser.removeTab(tab, {animate: false});
 
       // Next test
-      executeSoon(test10);
+      executeSoon(finish);
     });
   };
 
   Services.obs.addObserver(gObserver, "invalidformsubmit", false);
 
   tab.linkedBrowser.addEventListener("load", function(aEvent) {
     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
 
     isnot(gBrowser.selectedTab, tab,
           "This tab should have been loaded in background");
 
     tab.linkedBrowser.contentDocument.getElementById('s').click();
   }, true);
 
   tab.linkedBrowser.loadURI(uri);
 }
-
-/**
- * In this test, we check that the author defined error message is shown.
- */
-function test10()
-{
-  let uri = "data:text/html,<iframe name='t'></iframe><form target='t' action='data:text/html,'><input x-moz-errormessage='foo' required id='i'><input id='s' type='submit'></form>";
-  let tab = gBrowser.addTab();
-
-  gInvalidFormPopup.addEventListener("popupshown", function() {
-    gInvalidFormPopup.removeEventListener("popupshown", arguments.callee, false);
-
-    let doc = gBrowser.contentDocument;
-    is(doc.activeElement, doc.getElementById('i'),
-       "First invalid element should be focused");
-
-    checkPopupShow();
-
-    is(gInvalidFormPopup.firstChild.nodeValue, "foo",
-       "The panel should show the author defined error message");
-
-    // Clean-up and next test.
-    gBrowser.removeTab(gBrowser.selectedTab, {animate: false});
-    executeSoon(finish);
-  }, false);
-
-  tab.linkedBrowser.addEventListener("load", function(aEvent) {
-    tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
-
-    gBrowser.contentDocument.getElementById('s').click();
-  }, true);
-
-  gBrowser.selectedTab = tab;
-  gBrowser.selectedTab.linkedBrowser.loadURI(uri);
-}
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -583,17 +583,16 @@ GK_ATOM(modifiers, "modifiers")
 GK_ATOM(monochrome, "monochrome")
 GK_ATOM(mousedown, "mousedown")
 GK_ATOM(mousemove, "mousemove")
 GK_ATOM(mouseout, "mouseout")
 GK_ATOM(mouseover, "mouseover")
 GK_ATOM(mousethrough, "mousethrough")
 GK_ATOM(mouseup, "mouseup")
 GK_ATOM(moz_opaque, "moz-opaque")
-GK_ATOM(x_moz_errormessage, "x-moz-errormessage")
 GK_ATOM(msthemecompatible, "msthemecompatible")
 GK_ATOM(multicol, "multicol")
 GK_ATOM(multiple, "multiple")
 GK_ATOM(name, "name")
 GK_ATOM(_namespace, "namespace")
 GK_ATOM(namespaceAlias, "namespace-alias")
 GK_ATOM(namespaceUri, "namespace-uri")
 GK_ATOM(NaN, "NaN")
--- a/content/html/content/src/nsIConstraintValidation.cpp
+++ b/content/html/content/src/nsIConstraintValidation.cpp
@@ -73,26 +73,17 @@ nsIConstraintValidation::GetValidity(nsI
 }
 
 NS_IMETHODIMP
 nsIConstraintValidation::GetValidationMessage(nsAString& aValidationMessage)
 {
   aValidationMessage.Truncate();
 
   if (IsCandidateForConstraintValidation() && !IsValid()) {
-    nsCOMPtr<nsIContent> content = do_QueryInterface(this);
-    NS_ASSERTION(content, "This class should be inherited by HTML elements only!");
-
-    nsAutoString authorMessage;
-    content->GetAttr(kNameSpaceID_None, nsGkAtoms::x_moz_errormessage,
-                     authorMessage);
-
-    if (!authorMessage.IsEmpty()) {
-      aValidationMessage.Assign(authorMessage);
-    } else if (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR)) {
+    if (GetValidityState(VALIDITY_STATE_CUSTOM_ERROR)) {
       aValidationMessage.Assign(mCustomValidity);
     } else if (GetValidityState(VALIDITY_STATE_TOO_LONG)) {
       GetValidationMessage(aValidationMessage, VALIDITY_STATE_TOO_LONG);
     } else if (GetValidityState(VALIDITY_STATE_VALUE_MISSING)) {
       GetValidationMessage(aValidationMessage, VALIDITY_STATE_VALUE_MISSING);
     } else if (GetValidityState(VALIDITY_STATE_TYPE_MISMATCH)) {
       GetValidationMessage(aValidationMessage, VALIDITY_STATE_TYPE_MISMATCH);
     } else if (GetValidityState(VALIDITY_STATE_PATTERN_MISMATCH)) {
--- a/content/html/content/test/Makefile.in
+++ b/content/html/content/test/Makefile.in
@@ -225,15 +225,14 @@ include $(topsrcdir)/config/rules.mk
 		test_bug595449.html \
 		test_bug595457.html \
 		test_bug557087-1.html \
 		test_bug557087-2.html \
 		test_bug557087-3.html \
 		test_bug557087-4.html \
 		test_bug557087-5.html \
 		test_bug557087-6.html \
-		test_bug600155.html \
 		test_bug598643.html \
 		test_bug596350.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
deleted file mode 100644
--- a/content/html/content/test/test_bug600155.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=600155
--->
-<head>
-  <title>Test for Bug 600155</title>
-  <script type="application/javascript" src="/MochiKit/packed.js"></script>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=600155">Mozilla Bug 600155</a>
-<p id="display"></p>
-<div id='content' style='display:none;'>
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-/** Test for Bug 600155 **/
-
-var subjectForConstraintValidation = [ "button", "input", "select", "textarea" ];
-var content = document.getElementById('content');
-
-for each (var eName in subjectForConstraintValidation) {
-  var e = document.createElement(eName);
-  content.appendChild(e);
-  e.setAttribute("x-moz-errormessage", "foo");
-  if ("required" in e) {
-    e.required = true;
-  } else {
-    e.setCustomValidity("bar");
-  }
-
-  // At this point, the element is invalid.
-  is(e.validationMessage, "foo",
-     "the validation message should be the author one");
-
-  content.removeChild(e);
-}
-
-</script>
-</pre>
-</body>
-</html>