summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/style/BorderValue.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/style/BorderValue.h')
-rw-r--r--Source/WebCore/rendering/style/BorderValue.h26
1 files changed, 9 insertions, 17 deletions
diff --git a/Source/WebCore/rendering/style/BorderValue.h b/Source/WebCore/rendering/style/BorderValue.h
index c8f6512c5..3eeaae401 100644
--- a/Source/WebCore/rendering/style/BorderValue.h
+++ b/Source/WebCore/rendering/style/BorderValue.h
@@ -22,8 +22,7 @@
*
*/
-#ifndef BorderValue_h
-#define BorderValue_h
+#pragma once
#include "Color.h"
#include "RenderStyleConstants.h"
@@ -34,10 +33,7 @@ class BorderValue {
friend class RenderStyle;
public:
BorderValue()
- : m_color(0)
- , m_colorIsValid(false)
- , m_width(3)
- , m_style(BNONE)
+ : m_style(BNONE)
, m_isAuto(AUTO_OFF)
{
}
@@ -49,7 +45,7 @@ public:
bool isTransparent() const
{
- return m_colorIsValid && !alphaChannel(m_color);
+ return m_color.isValid() && !m_color.isVisible();
}
bool isVisible(bool checkStyle = true) const
@@ -59,7 +55,7 @@ public:
bool operator==(const BorderValue& o) const
{
- return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color && m_colorIsValid == o.m_colorIsValid;
+ return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color;
}
bool operator!=(const BorderValue& o) const
@@ -69,20 +65,18 @@ public:
void setColor(const Color& color)
{
- m_color = color.rgb();
- m_colorIsValid = color.isValid();
+ m_color = color;
}
- Color color() const { return Color(m_color, m_colorIsValid); }
+ const Color& color() const { return m_color; }
- unsigned width() const { return m_width; }
+ float width() const { return m_width; }
EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
protected:
- RGBA32 m_color;
- unsigned m_colorIsValid : 1;
+ float m_width { 3 };
+ Color m_color;
- unsigned m_width : 26;
unsigned m_style : 4; // EBorderStyle
// This is only used by OutlineValue but moved here to keep the bits packed.
@@ -90,5 +84,3 @@ protected:
};
} // namespace WebCore
-
-#endif // BorderValue_h