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

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

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.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 874e929fbcf1e18d199b48bc3f6870a7f744c8fb..b16e4cdf5cd2d38c28ff6f70b401cdc9f5c8d557 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -52,7 +52,8 @@ namespace blink {
struct SameSizeAsBorderValue {
RGBA32 m_color;
- unsigned m_width;
+ float m_width;
+ unsigned m_style;
};
static_assert(sizeof(BorderValue) == sizeof(SameSizeAsBorderValue), "BorderValue should stay small");
@@ -1598,7 +1599,7 @@ const BorderValue& ComputedStyle::borderEnd() const
return isLeftToRightDirection() ? borderBottom() : borderTop();
}
-int ComputedStyle::borderBeforeWidth() const
+float ComputedStyle::borderBeforeWidth() const
{
switch (writingMode()) {
case TopToBottomWritingMode:
@@ -1612,7 +1613,7 @@ int ComputedStyle::borderBeforeWidth() const
return borderTopWidth();
}
-int ComputedStyle::borderAfterWidth() const
+float ComputedStyle::borderAfterWidth() const
{
switch (writingMode()) {
case TopToBottomWritingMode:
@@ -1626,26 +1627,26 @@ int ComputedStyle::borderAfterWidth() const
return borderBottomWidth();
}
-int ComputedStyle::borderStartWidth() const
+float ComputedStyle::borderStartWidth() const
{
if (isHorizontalWritingMode())
return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth();
return isLeftToRightDirection() ? borderTopWidth() : borderBottomWidth();
}
-int ComputedStyle::borderEndWidth() const
+float ComputedStyle::borderEndWidth() const
{
if (isHorizontalWritingMode())
return isLeftToRightDirection() ? borderRightWidth() : borderLeftWidth();
return isLeftToRightDirection() ? borderBottomWidth() : borderTopWidth();
}
-int ComputedStyle::borderOverWidth() const
+float ComputedStyle::borderOverWidth() const
{
return isHorizontalWritingMode() ? borderTopWidth() : borderRightWidth();
}
-int ComputedStyle::borderUnderWidth() const
+float ComputedStyle::borderUnderWidth() const
{
return isHorizontalWritingMode() ? borderBottomWidth() : borderLeftWidth();
}
@@ -1691,6 +1692,7 @@ void ComputedStyle::resetMotionPath()
rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = nullptr;
}
+// TODO(bugsnash): change return value to float when outline is changed to float
int ComputedStyle::outlineOutsetExtent() const
{
if (!hasOutline())

Powered by Google App Engine
This is Rietveld 408576698