Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(833)

Unified Diff: Source/core/html/HTMLTextAreaElement.cpp

Issue 1181093009: Changed cols and rows to unsigned long for HTMLTextAreaElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update LayoutTests to handle unsigned values Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.h ('k') | Source/core/html/HTMLTextAreaElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTextAreaElement.cpp
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp
index 9dac3f2bbcf0f0e7a2f67c1062d1820906b0dd4f..a96291166fb9a21783b02efb226bb503c1dfd1c4 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -56,8 +56,8 @@ namespace blink {
using namespace HTMLNames;
-static const int defaultRows = 2;
-static const int defaultCols = 20;
+static const unsigned defaultRows = 2;
+static const unsigned defaultCols = 20;
// On submission, LF characters are converted into CRLF.
// This function returns number of characters considering this.
@@ -155,8 +155,8 @@ void HTMLTextAreaElement::collectStyleForPresentationAttribute(const QualifiedNa
void HTMLTextAreaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == rowsAttr) {
- int rows = 0;
- if (value.isEmpty() || !parseHTMLInteger(value, rows) || rows <= 0)
+ unsigned rows = 0;
+ if (value.isEmpty() || !parseHTMLNonNegativeInteger(value, rows) || rows <= 0)
rows = defaultRows;
if (m_rows != rows) {
m_rows = rows;
@@ -164,8 +164,8 @@ void HTMLTextAreaElement::parseAttribute(const QualifiedName& name, const Atomic
layoutObject()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::AttributeChanged);
}
} else if (name == colsAttr) {
- int cols = 0;
- if (value.isEmpty() || !parseHTMLInteger(value, cols) || cols <= 0)
+ unsigned cols = 0;
+ if (value.isEmpty() || !parseHTMLNonNegativeInteger(value, cols) || cols <= 0)
cols = defaultCols;
if (m_cols != cols) {
m_cols = cols;
@@ -583,14 +583,14 @@ void HTMLTextAreaElement::accessKeyAction(bool)
focus();
}
-void HTMLTextAreaElement::setCols(int cols)
+void HTMLTextAreaElement::setCols(unsigned cols)
{
- setIntegralAttribute(colsAttr, cols);
+ setUnsignedIntegralAttribute(colsAttr, cols);
}
-void HTMLTextAreaElement::setRows(int rows)
+void HTMLTextAreaElement::setRows(unsigned rows)
{
- setIntegralAttribute(rowsAttr, rows);
+ setUnsignedIntegralAttribute(rowsAttr, rows);
}
bool HTMLTextAreaElement::matchesReadOnlyPseudoClass() const
« no previous file with comments | « Source/core/html/HTMLTextAreaElement.h ('k') | Source/core/html/HTMLTextAreaElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698