diff --git a/content/html/content/src/nsHTMLTextAreaElement.cpp b/content/html/content/src/nsHTMLTextAreaElement.cpp index a3202bffe9aa..b65543cf5358 100644 --- a/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -456,13 +456,13 @@ nsHTMLTextAreaElement::IsHTMLFocusable(PRBool aWithMouse, NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, AccessKey, accesskey) NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Autofocus, autofocus) -NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTextAreaElement, Cols, cols, 20) +NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(nsHTMLTextAreaElement, Cols, cols, DEFAULT_COLS) NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Disabled, disabled) NS_IMPL_NON_NEGATIVE_INT_ATTR(nsHTMLTextAreaElement, MaxLength, maxlength) NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, Name, name) NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, ReadOnly, readonly) NS_IMPL_BOOL_ATTR(nsHTMLTextAreaElement, Required, required) -NS_IMPL_INT_ATTR_DEFAULT_VALUE(nsHTMLTextAreaElement, Rows, rows, 2) +NS_IMPL_UINT_ATTR_NON_ZERO_DEFAULT_VALUE(nsHTMLTextAreaElement, Rows, rows, DEFAULT_ROWS_TEXTAREA) NS_IMPL_INT_ATTR(nsHTMLTextAreaElement, TabIndex, tabindex) NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, Wrap, wrap) NS_IMPL_STRING_ATTR(nsHTMLTextAreaElement, Placeholder, placeholder) @@ -641,12 +641,9 @@ nsHTMLTextAreaElement::ParseAttribute(PRInt32 aNamespaceID, if (aNamespaceID == kNameSpaceID_None) { if (aAttribute == nsGkAtoms::maxlength) { return aResult.ParseNonNegativeIntValue(aValue); - } - if (aAttribute == nsGkAtoms::cols) { - return aResult.ParseIntWithBounds(aValue, 0); - } - if (aAttribute == nsGkAtoms::rows) { - return aResult.ParseIntWithBounds(aValue, 0); + } else if (aAttribute == nsGkAtoms::cols || + aAttribute == nsGkAtoms::rows) { + return aResult.ParsePositiveIntValue(aValue); } } return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue, diff --git a/content/html/content/test/Makefile.in b/content/html/content/test/Makefile.in index 0f23dc44f0de..4a43894c6594 100644 --- a/content/html/content/test/Makefile.in +++ b/content/html/content/test/Makefile.in @@ -255,6 +255,7 @@ _TEST_FILES = \ test_bug622558.html \ test_bug622597.html \ test_bug636336.html \ + test_bug630889.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/content/html/content/test/test_bug630889.html b/content/html/content/test/test_bug630889.html new file mode 100644 index 000000000000..6a7aae84824a --- /dev/null +++ b/content/html/content/test/test_bug630889.html @@ -0,0 +1,28 @@ + + + + + Test for Bug 630889 + + + + + + +Mozilla Bug 630889 +

+
+
+
+ + diff --git a/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl b/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl index d12fcd77a941..11a48cd0affd 100644 --- a/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl +++ b/dom/interfaces/html/nsIDOMHTMLTextAreaElement.idl @@ -50,18 +50,18 @@ * http://www.whatwg.org/specs/web-apps/current-work/ */ -[scriptable, uuid(a6cf9094-15b3-11d2-932e-00805f8add32)] +[scriptable, uuid(7a403df9-8911-499b-afbf-98a1bbc20dd1)] interface nsIDOMHTMLTextAreaElement : nsIDOMHTMLElement { // Modified in DOM Level 2: attribute DOMString defaultValue; readonly attribute nsIDOMHTMLFormElement form; attribute DOMString accessKey; - attribute long cols; + attribute unsigned long cols; attribute boolean disabled; attribute DOMString name; attribute boolean readOnly; - attribute long rows; + attribute unsigned long rows; attribute long tabIndex; readonly attribute DOMString type; attribute DOMString value;