Use plain int for borders widths when possible
Chromium coding style (not overridden by Blink's in this case)
states:
Do not use unsigned types to mean "this value should never be < 0".
The BorderValue width storage is currently 26 bits wide so it's easily
contained in a plain int.
No functional change expected.
BUG=496033
Review URL: https://codereview.chromium.org/1182053003
git-svn-id: svn://svn.chromium.org/blink/trunk@197111 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index cd71ed7..f0015591 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -917,7 +917,7 @@
if (!numEffCols())
return 0;
- unsigned borderWidth = 0;
+ int borderWidth = 0;
const BorderValue& tableStartBorder = style()->borderStart();
if (tableStartBorder.style() == BHIDDEN)
@@ -971,7 +971,7 @@
if (!numEffCols())
return 0;
- unsigned borderWidth = 0;
+ int borderWidth = 0;
const BorderValue& tableEndBorder = style()->borderEnd();
if (tableEndBorder.style() == BHIDDEN)
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index 1d2f5d3e..fd923b71 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1150,7 +1150,7 @@
if (!m_grid.size() || !totalCols)
return 0;
- unsigned borderWidth = 0;
+ int borderWidth = 0;
const BorderValue& sb = side == BorderBefore ? style()->borderBefore() : style()->borderAfter();
if (sb.style() == BHIDDEN)
@@ -1205,7 +1205,7 @@
return 0;
unsigned colIndex = side == BorderStart ? 0 : totalCols - 1;
- unsigned borderWidth = 0;
+ int borderWidth = 0;
const BorderValue& sb = side == BorderStart ? style()->borderStart() : style()->borderEnd();
if (sb.style() == BHIDDEN)
diff --git a/third_party/WebKit/Source/core/style/BorderData.h b/third_party/WebKit/Source/core/style/BorderData.h
index cc7910a..768f36a 100644
--- a/third_party/WebKit/Source/core/style/BorderData.h
+++ b/third_party/WebKit/Source/core/style/BorderData.h
@@ -66,28 +66,28 @@
return false;
}
- unsigned borderLeftWidth() const
+ int borderLeftWidth() const
{
if (!m_image.hasImage() && (m_left.style() == BNONE || m_left.style() == BHIDDEN))
return 0;
return m_left.width();
}
- unsigned borderRightWidth() const
+ int borderRightWidth() const
{
if (!m_image.hasImage() && (m_right.style() == BNONE || m_right.style() == BHIDDEN))
return 0;
return m_right.width();
}
- unsigned borderTopWidth() const
+ int borderTopWidth() const
{
if (!m_image.hasImage() && (m_top.style() == BNONE || m_top.style() == BHIDDEN))
return 0;
return m_top.width();
}
- unsigned borderBottomWidth() const
+ int borderBottomWidth() const
{
if (!m_image.hasImage() && (m_bottom.style() == BNONE || m_bottom.style() == BHIDDEN))
return 0;
diff --git a/third_party/WebKit/Source/core/style/BorderValue.h b/third_party/WebKit/Source/core/style/BorderValue.h
index 8cf40e1..cc630904 100644
--- a/third_party/WebKit/Source/core/style/BorderValue.h
+++ b/third_party/WebKit/Source/core/style/BorderValue.h
@@ -86,7 +86,7 @@
StyleColor color() const { return m_colorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_color); }
- unsigned width() const { return m_width; }
+ int width() const { return m_width; }
EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
void setStyle(EBorderStyle style) { m_style = style; }
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 41df5fa..1052451 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -505,13 +505,13 @@
const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
- unsigned borderLeftWidth() const { return surround->border.borderLeftWidth(); }
+ int borderLeftWidth() const { return surround->border.borderLeftWidth(); }
EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
- unsigned borderRightWidth() const { return surround->border.borderRightWidth(); }
+ int borderRightWidth() const { return surround->border.borderRightWidth(); }
EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
- unsigned borderTopWidth() const { return surround->border.borderTopWidth(); }
+ int borderTopWidth() const { return surround->border.borderTopWidth(); }
EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
- unsigned borderBottomWidth() const { return surround->border.borderBottomWidth(); }
+ int borderBottomWidth() const { return surround->border.borderBottomWidth(); }
EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
unsigned short borderBeforeWidth() const;