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

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

Issue 1198393002: HTMLTableCellElement type changed from signed to unsinged (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reverted cellIndex changes and updated layout test o correspond with the changes. 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/HTMLTableCellElement.h ('k') | Source/core/html/HTMLTableCellElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLTableCellElement.cpp
diff --git a/Source/core/html/HTMLTableCellElement.cpp b/Source/core/html/HTMLTableCellElement.cpp
index 875b6d5b4b681b392fc120510790891c25b7c15e..873a5efcb74aad3208987dfa71b3ffc4fcd7964a 100644
--- a/Source/core/html/HTMLTableCellElement.cpp
+++ b/Source/core/html/HTMLTableCellElement.cpp
@@ -44,7 +44,7 @@ namespace blink {
// (FIXME: We should consider increasing this limit (crbug.com/78577).
// Firefox uses a limit of 1,000 for colspan and resets the value to 1
// but we don't discriminate between rowspan / colspan as it is artificial.
-static const int maxColRowSpan = 8190;
+static const unsigned maxColRowSpan = 8190;
using namespace HTMLNames;
@@ -55,22 +55,22 @@ inline HTMLTableCellElement::HTMLTableCellElement(const QualifiedName& tagName,
DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(HTMLTableCellElement)
-int HTMLTableCellElement::colSpan() const
+unsigned HTMLTableCellElement::colSpan() const
{
const AtomicString& colSpanValue = fastGetAttribute(colspanAttr);
- int value = 0;
- if (colSpanValue.isEmpty() || !parseHTMLInteger(colSpanValue, value))
+ unsigned value = 0;
+ if (colSpanValue.isEmpty() || !parseHTMLNonNegativeInteger(colSpanValue, value))
return 1;
- return max(1, min(value, maxColRowSpan));
+ return max(1u, min(value, maxColRowSpan));
}
-int HTMLTableCellElement::rowSpan() const
+unsigned HTMLTableCellElement::rowSpan() const
{
const AtomicString& rowSpanValue = fastGetAttribute(rowspanAttr);
- int value = 0;
- if (rowSpanValue.isEmpty() || !parseHTMLInteger(rowSpanValue, value))
+ unsigned value = 0;
+ if (rowSpanValue.isEmpty() || !parseHTMLNonNegativeInteger(rowSpanValue, value))
return 1;
- return max(1, min(value, maxColRowSpan));
+ return max(1u, min(value, maxColRowSpan));
}
int HTMLTableCellElement::cellIndex() const
@@ -156,9 +156,9 @@ const AtomicString& HTMLTableCellElement::axis() const
return fastGetAttribute(axisAttr);
}
-void HTMLTableCellElement::setColSpan(int n)
+void HTMLTableCellElement::setColSpan(unsigned n)
{
- setIntegralAttribute(colspanAttr, n);
+ setUnsignedIntegralAttribute(colspanAttr, n);
}
const AtomicString& HTMLTableCellElement::headers() const
@@ -166,9 +166,9 @@ const AtomicString& HTMLTableCellElement::headers() const
return fastGetAttribute(headersAttr);
}
-void HTMLTableCellElement::setRowSpan(int n)
+void HTMLTableCellElement::setRowSpan(unsigned n)
{
- setIntegralAttribute(rowspanAttr, n);
+ setUnsignedIntegralAttribute(rowspanAttr, n);
}
const AtomicString& HTMLTableCellElement::scope() const
« no previous file with comments | « Source/core/html/HTMLTableCellElement.h ('k') | Source/core/html/HTMLTableCellElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698