Bug 595447 - Add type IDL attribute for HTMLFieldSetElement. r=smaug a=jst
authorMounir Lamouri <mounir.lamouri@gmail.com>
Wed, 15 Sep 2010 09:55:06 +0200
changeset 53884 82373b028ee02b096739017e0b24e476e5e71ad7
parent 53883 9405497abe4e10d3951a588102d0bcf25a2ac4e0
child 53885 275d86ec7eee508569f6885453bdad000b348551
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, jst
bugs595447
milestone2.0b7pre
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
Bug 595447 - Add type IDL attribute for HTMLFieldSetElement. r=smaug a=jst
content/html/content/src/nsHTMLFieldSetElement.cpp
content/html/content/test/Makefile.in
content/html/content/test/test_bug595447.html
dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
--- a/content/html/content/src/nsHTMLFieldSetElement.cpp
+++ b/content/html/content/src/nsHTMLFieldSetElement.cpp
@@ -121,16 +121,23 @@ NS_IMPL_NSICONSTRAINTVALIDATION(nsHTMLFi
 // nsIDOMHTMLFieldSetElement
 
 NS_IMETHODIMP
 nsHTMLFieldSetElement::GetForm(nsIDOMHTMLFormElement** aForm)
 {
   return nsGenericHTMLFormElement::GetForm(aForm);
 }
 
+NS_IMETHODIMP
+nsHTMLFieldSetElement::GetType(nsAString& aType)
+{
+  aType.AssignLiteral("fieldset");
+  return NS_OK;
+}
+
 // nsIFormControl
 
 nsresult
 nsHTMLFieldSetElement::Reset()
 {
   return NS_OK;
 }
 
--- a/content/html/content/test/Makefile.in
+++ b/content/html/content/test/Makefile.in
@@ -221,12 +221,13 @@ include $(topsrcdir)/config/rules.mk
 		test_bug561636.html \
 		test_bug556013.html \
 		test_bug590363.html \
 		test_bug557628-1.html \
 		test_bug557628-2.html \
 		test_bug592802.html \
 		test_bug589696.html \
 		test_bug595429.html \
+		test_bug595447.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/content/html/content/test/test_bug595447.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=595447
+-->
+<head>
+  <title>Test for Bug 595447</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=595447">Mozilla Bug 595447</a>
+<p id="display"></p>
+<pre id="test">
+<script type="application/javascript">
+
+/** Test for Bug 595447 **/
+
+var fieldset = document.createElement("fieldset");
+
+ok("type" in fieldset, "fieldset element should have a type IDL attribute");
+is(fieldset.type, "fieldset", "fieldset.type should return 'fieldset'");
+fieldset.type = "foo";
+is(fieldset.type, "fieldset", "fieldset.type is readonly");
+
+</script>
+</pre>
+</body>
+</html>
--- a/dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLFieldSetElement.idl
@@ -44,22 +44,23 @@
  * [X]HTML fieldset element.
  *
  * For more information on this interface please see
  * http://www.w3.org/TR/DOM-Level-2-HTML/
  */
 
 interface nsIDOMValidityState;
 
-[scriptable, uuid(7d66ab6c-61fb-459f-8e3b-f8bd67991786)]
+[scriptable, uuid(8e89ae21-c666-4027-a1c7-bbc8f3d0a37a)]
 interface nsIDOMHTMLFieldSetElement : nsIDOMHTMLElement
 {
   readonly attribute nsIDOMHTMLFormElement  form;
            attribute DOMString              name;
 
+  readonly attribute DOMString              type;
 
   // The following lines are parte of the constraint validation API, see:
   // http://dev.w3.org/html5/spec/forms.html#the-constraint-validation-api
   readonly attribute boolean               willValidate;
   readonly attribute nsIDOMValidityState   validity;
   readonly attribute DOMString             validationMessage;
   boolean checkValidity();
   void setCustomValidity(in DOMString error);