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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 1574933002: Changed type of border-width longhands from unsigned to float. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made transitions use fractional border widths, added assert that border widths are positive, and r… Created 4 years, 11 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
Index: third_party/WebKit/Source/core/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index e44f182d5d4ebe55bb09ec6a67bed842cc87a865..6066ff9ed09ca98ce20e01b214b1a12c98ab1811 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -521,22 +521,23 @@ public:
const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
- int borderLeftWidth() const { return surround->border.borderLeftWidth(); }
+ float borderLeftWidth() const { return surround->border.borderLeftWidth(); }
EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
- int borderRightWidth() const { return surround->border.borderRightWidth(); }
+ float borderRightWidth() const { return surround->border.borderRightWidth(); }
EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
- int borderTopWidth() const { return surround->border.borderTopWidth(); }
+ float borderTopWidth() const { return surround->border.borderTopWidth(); }
EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
- int borderBottomWidth() const { return surround->border.borderBottomWidth(); }
+ float borderBottomWidth() const { return surround->border.borderBottomWidth(); }
EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
- int borderBeforeWidth() const;
- int borderAfterWidth() const;
- int borderStartWidth() const;
- int borderEndWidth() const;
- int borderOverWidth() const;
- int borderUnderWidth() const;
+ float borderBeforeWidth() const;
+ float borderAfterWidth() const;
+ float borderStartWidth() const;
+ float borderEndWidth() const;
+ float borderOverWidth() const;
+ float borderUnderWidth() const;
+ // TODO(bugsnash): change return type to float when outline offset is changed to float
int outlineWidth() const
{
if (m_background->outline().style() == BNONE)
@@ -1100,16 +1101,32 @@ public:
FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect,
const LayoutRectOutsets insets, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
- void setBorderLeftWidth(unsigned v) { SET_VAR(surround, border.m_left.m_width, v); }
+ void setBorderLeftWidth(float v)
+ {
+ ASSERT(v >= 0);
+ SET_VAR(surround, border.m_left.m_width, v);
+ }
void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v); }
void setBorderLeftColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround, border.m_left, v); }
- void setBorderRightWidth(unsigned v) { SET_VAR(surround, border.m_right.m_width, v); }
+ void setBorderRightWidth(float v)
+ {
+ ASSERT(v >= 0);
+ SET_VAR(surround, border.m_right.m_width, v);
+ }
void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v); }
void setBorderRightColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround, border.m_right, v); }
- void setBorderTopWidth(unsigned v) { SET_VAR(surround, border.m_top.m_width, v); }
+ void setBorderTopWidth(float v)
+ {
+ ASSERT(v >= 0);
+ SET_VAR(surround, border.m_top.m_width, v);
+ }
void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v); }
void setBorderTopColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround, border.m_top, v); }
- void setBorderBottomWidth(unsigned v) { SET_VAR(surround, border.m_bottom.m_width, v); }
+ void setBorderBottomWidth(float v)
+ {
+ ASSERT(v >= 0);
+ SET_VAR(surround, border.m_bottom.m_width, v);
+ }
void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v); }
void setBorderBottomColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround, border.m_bottom, v); }
@@ -1662,7 +1679,7 @@ public:
static ECursor initialCursor() { return CURSOR_AUTO; }
static Color initialColor() { return Color::black; }
static StyleImage* initialListStyleImage() { return 0; }
- static unsigned initialBorderWidth() { return 3; }
+ static float initialBorderWidth() { return 3.0f; }
static unsigned short initialColumnRuleWidth() { return 3; }
static unsigned short initialOutlineWidth() { return 3; }
static float initialLetterWordSpacing() { return 0.0f; }

Powered by Google App Engine
This is Rietveld 408576698