Back out 149a80dafcb8 (bug 686913) due to build failures. a=YUNoTry?
authorRyan VanderMeulen <ryanvm@gmail.com>
Sat, 21 Apr 2012 17:48:31 -0400
changeset 92083 1f41d05f51c662a992b24cb3c97e2e25ddc9a481
parent 92082 8ef46e071f65e0477b29c1ae0e49f496418c795e
child 92084 7a601537cb88002be9f759a4697568e0ea664285
push id8544
push userryanvm@gmail.com
push dateSat, 21 Apr 2012 21:48:40 +0000
treeherdermozilla-inbound@1f41d05f51c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYUNoTry
bugs686913
milestone14.0a1
backs out149a80dafcb8fb761f1d805530059232dc7cbc3f
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 149a80dafcb8 (bug 686913) due to build failures. a=YUNoTry?
content/html/content/public/nsIFormControl.h
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsHTMLFieldSetElement.cpp
content/html/content/src/nsHTMLFormElement.cpp
content/html/content/src/nsHTMLProgressElement.cpp
content/html/content/test/test_bug514437.html
content/html/content/test/test_bug588683-1.html
dom/interfaces/html/nsIDOMHTMLProgressElement.idl
--- a/content/html/content/public/nsIFormControl.h
+++ b/content/html/content/public/nsIFormControl.h
@@ -53,16 +53,17 @@ class Element;
 
 enum FormControlsTypes {
   NS_FORM_FIELDSET = 1,
   NS_FORM_LABEL,
   NS_FORM_OUTPUT,
   NS_FORM_SELECT,
   NS_FORM_TEXTAREA,
   NS_FORM_OBJECT,
+  NS_FORM_PROGRESS,
   eFormControlsWithoutSubTypesMax,
   // After this, all types will have sub-types which introduce new enum lists.
   // eFormControlsWithoutSubTypesMax let us know if the previous types values
   // are not overlapping with sub-types/masks.
 
   // Elements with different types, the value is used as a mask.
   // Adding '_ELEMENT' because NS_FORM_INPUT is used for 'oninput' event.
   // When changing the order, adding or removing elements, be sure to update
@@ -278,16 +279,17 @@ nsIFormControl::IsLabelableControl() con
   // TODO: meter should be added, see bug 555985.
   // TODO: NS_FORM_INPUT_HIDDEN should be removed, see bug 597650.
   PRUint32 type = GetType();
   return type & NS_FORM_INPUT_ELEMENT ||
          type & NS_FORM_BUTTON_ELEMENT ||
          // type == NS_FORM_KEYGEN ||
          // type == NS_FORM_METER ||
          type == NS_FORM_OUTPUT ||
+         type == NS_FORM_PROGRESS ||
          type == NS_FORM_SELECT ||
          type == NS_FORM_TEXTAREA;
 }
 
 bool
 nsIFormControl::IsSubmittableControl() const
 {
   // TODO: keygen should be in that list, see bug 101019.
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -2913,17 +2913,18 @@ nsGenericHTMLFormElement::ForgetFieldSet
 bool
 nsGenericHTMLFormElement::CanBeDisabled() const
 {
   PRInt32 type = GetType();
   // It's easier to test the types that _cannot_ be disabled
   return
     type != NS_FORM_LABEL &&
     type != NS_FORM_OBJECT &&
-    type != NS_FORM_OUTPUT;
+    type != NS_FORM_OUTPUT &&
+    type != NS_FORM_PROGRESS;
 }
 
 bool
 nsGenericHTMLFormElement::IsHTMLFocusable(bool aWithMouse,
                                           bool* aIsFocusable,
                                           PRInt32* aTabIndex)
 {
   if (nsGenericHTMLElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
--- a/content/html/content/src/nsHTMLFieldSetElement.cpp
+++ b/content/html/content/src/nsHTMLFieldSetElement.cpp
@@ -155,17 +155,18 @@ nsHTMLFieldSetElement::GetType(nsAString
 }
 
 /* static */
 bool
 nsHTMLFieldSetElement::MatchListedElements(nsIContent* aContent, PRInt32 aNamespaceID,
                                            nsIAtom* aAtom, void* aData)
 {
   nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(aContent);
-  return formControl && formControl->GetType() != NS_FORM_LABEL;
+  return formControl && formControl->GetType() != NS_FORM_LABEL &&
+                        formControl->GetType() != NS_FORM_PROGRESS;
 }
 
 NS_IMETHODIMP
 nsHTMLFieldSetElement::GetElements(nsIDOMHTMLCollection** aElements)
 {
   if (!mElements) {
     mElements = new nsContentList(this, MatchListedElements, nsnull, nsnull,
                                   true);
--- a/content/html/content/src/nsHTMLFormElement.cpp
+++ b/content/html/content/src/nsHTMLFormElement.cpp
@@ -218,16 +218,17 @@ ShouldBeInElements(nsIFormControl* aForm
     return true;
   }
 
   // These form control types are not supposed to end up in the
   // form.elements array
   //
   // NS_FORM_INPUT_IMAGE
   // NS_FORM_LABEL
+  // NS_FORM_PROGRESS
 
   return false;
 }
 
 // nsHTMLFormElement implementation
 
 // construction, destruction
 nsGenericHTMLElement*
--- a/content/html/content/src/nsHTMLProgressElement.cpp
+++ b/content/html/content/src/nsHTMLProgressElement.cpp
@@ -36,38 +36,43 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIDOMHTMLProgressElement.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValue.h"
 #include "nsEventStateManager.h"
 
 
-class nsHTMLProgressElement : public nsGenericHTMLElement,
+class nsHTMLProgressElement : public nsGenericHTMLFormElement,
                               public nsIDOMHTMLProgressElement
 {
 public:
   nsHTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo);
   virtual ~nsHTMLProgressElement();
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIDOMNode
-  NS_FORWARD_NSIDOMNODE(nsGenericHTMLElement::)
+  NS_FORWARD_NSIDOMNODE(nsGenericHTMLFormElement::)
 
   // nsIDOMElement
-  NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLElement::)
+  NS_FORWARD_NSIDOMELEMENT(nsGenericHTMLFormElement::)
 
   // nsIDOMHTMLElement
-  NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLElement::)
+  NS_FORWARD_NSIDOMHTMLELEMENT(nsGenericHTMLFormElement::)
 
   // nsIDOMHTMLProgressElement
   NS_DECL_NSIDOMHTMLPROGRESSELEMENT
 
+  // nsIFormControl
+  NS_IMETHOD_(PRUint32) GetType() const { return NS_FORM_PROGRESS; }
+  NS_IMETHOD Reset();
+  NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission);
+
   nsEventStates IntrinsicState() const;
 
   nsresult Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const;
 
   bool ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute,
                         const nsAString& aValue, nsAttrValue& aResult);
 
   virtual nsXPCClassInfo* GetClassInfo();
@@ -90,17 +95,17 @@ protected:
 const double nsHTMLProgressElement::kIndeterminatePosition = -1.0;
 const double nsHTMLProgressElement::kDefaultValue          =  0.0;
 const double nsHTMLProgressElement::kDefaultMax            =  1.0;
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Progress)
 
 
 nsHTMLProgressElement::nsHTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo)
-  : nsGenericHTMLElement(aNodeInfo)
+  : nsGenericHTMLFormElement(aNodeInfo)
 {
   // We start out indeterminate
   AddStatesSilently(NS_EVENT_STATE_INDETERMINATE);
 }
 
 nsHTMLProgressElement::~nsHTMLProgressElement()
 {
 }
@@ -109,17 +114,17 @@ NS_IMPL_ADDREF_INHERITED(nsHTMLProgressE
 NS_IMPL_RELEASE_INHERITED(nsHTMLProgressElement, nsGenericElement)
 
 DOMCI_NODE_DATA(HTMLProgressElement, nsHTMLProgressElement)
 
 NS_INTERFACE_TABLE_HEAD(nsHTMLProgressElement)
   NS_HTML_CONTENT_INTERFACE_TABLE1(nsHTMLProgressElement,
                                    nsIDOMHTMLProgressElement)
   NS_HTML_CONTENT_INTERFACE_TABLE_TO_MAP_SEGUE(nsHTMLProgressElement,
-                                               nsGenericHTMLElement)
+                                               nsGenericHTMLFormElement)
 NS_HTML_CONTENT_INTERFACE_TABLE_TAIL_CLASSINFO(HTMLProgressElement)
 
 NS_IMPL_ELEMENT_CLONE(nsHTMLProgressElement)
 
 
 NS_IMETHODIMP
 nsHTMLProgressElement::Reset()
 {
@@ -132,17 +137,17 @@ nsHTMLProgressElement::SubmitNamesValues
 {
   // The progress element is not submittable.
   return NS_OK;
 }
 
 nsEventStates
 nsHTMLProgressElement::IntrinsicState() const
 {
-  nsEventStates state = nsGenericHTMLElement::IntrinsicState();
+  nsEventStates state = nsGenericHTMLFormElement::IntrinsicState();
 
   if (IsIndeterminate()) {
     state |= NS_EVENT_STATE_INDETERMINATE;
   }
 
   return state;
 }
 
@@ -151,18 +156,24 @@ nsHTMLProgressElement::ParseAttribute(PR
                                       const nsAString& aValue, nsAttrValue& aResult)
 {
   if (aNamespaceID == kNameSpaceID_None) {
     if (aAttribute == nsGkAtoms::value || aAttribute == nsGkAtoms::max) {
       return aResult.ParseDoubleValue(aValue);
     }
   }
 
-  return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute,
-                                              aValue, aResult);
+  return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute,
+                                                  aValue, aResult);
+}
+
+NS_IMETHODIMP
+nsHTMLProgressElement::GetForm(nsIDOMHTMLFormElement** aForm)
+{
+  return nsGenericHTMLFormElement::GetForm(aForm);
 }
 
 NS_IMETHODIMP
 nsHTMLProgressElement::GetValue(double* aValue)
 {
   const nsAttrValue* attrValue = mAttrsAndChildren.GetAttr(nsGkAtoms::value);
   if (!attrValue || attrValue->Type() != nsAttrValue::eDoubleValue ||
       attrValue->GetDoubleValue() < 0.0) {
--- a/content/html/content/test/test_bug514437.html
+++ b/content/html/content/test/test_bug514437.html
@@ -24,16 +24,17 @@ and
 <script type="application/javascript">
 
 /** Test for Bug 514437 and Bug 633913 **/
 
 function checkFormIDLAttribute(aElement)
 {
   var form = document.forms[0];
   var content = document.getElementById('content');
+  is(aElement.form, form, "The form IDL attribute should be the parent form");
 
   content.removeChild(form);
   content.appendChild(aElement);
   is(aElement.form, null, "The form IDL attribute should be null");
 
   // Cleaning-up.
   content.appendChild(form);
   form.appendChild(aElement);
@@ -220,16 +221,30 @@ function checkIndeterminatePseudoClass()
   }
 }
 
 function checkFormListedElement(aElement)
 {
   is(document.forms[0].elements.length, 0, "the form should have no element");
 }
 
+function checkLabelable(aElement)
+{
+  var content = document.getElementById('content');
+  var label = document.createElement('label');
+
+  content.appendChild(label);
+  label.appendChild(aElement);
+  is(label.control, aElement, "progress should be labelable");
+
+  // Cleaning-up.
+  content.removeChild(label);
+  content.appendChild(aElement);
+}
+
 function checkNotResetableAndFormSubmission(aElement)
 {
   // Creating an input element to check the submission worked.
   var form = document.forms[0];
   var input = document.createElement('input');
 
   input.name = 'a';
   input.value = 'tulip';
@@ -292,14 +307,16 @@ checkValueAttribute();
 checkMaxAttribute();
 
 checkPositionAttribute();
 
 checkIndeterminatePseudoClass();
 
 checkFormListedElement(p);
 
+checkLabelable(p);
+
 checkNotResetableAndFormSubmission(p);
 
 </script>
 </pre>
 </body>
 </html>
--- a/content/html/content/test/test_bug588683-1.html
+++ b/content/html/content/test/test_bug588683-1.html
@@ -395,17 +395,17 @@ var content = document.getElementById('c
 var forms = [
   document.createElement('form'),
   document.createElement('form'),
   document.createElement('form'),
 ];
 
 var elementNames = [
   'button', 'fieldset', 'input', 'label', 'object', 'output', 'select',
-  'textarea',
+  'textarea', 'progress',
 ];
 
 var todoElements = [
   ['keygen', 'Keygen'],
   ['meter', 'Meter'],
 ];
 
 for each(var e in todoElements) {
--- a/dom/interfaces/html/nsIDOMHTMLProgressElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLProgressElement.idl
@@ -42,20 +42,21 @@
  * <progress> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#the-progress-element
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(275851c9-c3e2-4427-a770-3d2aaad6c546)]
+[scriptable, uuid(842AEE33-8381-4DA4-A347-9E70C797BC3E)]
 interface nsIDOMHTMLProgressElement : nsIDOMHTMLElement
 {
            attribute double value;
            attribute double max;
   readonly attribute double position;
+  readonly attribute nsIDOMHTMLFormElement form;
   /**
    * The labels attribute will be done with bug 567740.
    */
   //readonly attribute NodeList labels;
 };