diff options
Diffstat (limited to 'WebCore/rendering/style/BorderValue.h')
-rw-r--r-- | WebCore/rendering/style/BorderValue.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/WebCore/rendering/style/BorderValue.h b/WebCore/rendering/style/BorderValue.h index e61e708..3e6fd5d 100644 --- a/WebCore/rendering/style/BorderValue.h +++ b/WebCore/rendering/style/BorderValue.h @@ -31,27 +31,22 @@ namespace WebCore { class BorderValue { +friend class RenderStyle; public: BorderValue() - : width(3) + : m_width(3) , m_style(BNONE) { } - Color color; - unsigned width : 12; - unsigned m_style : 4; // EBorderStyle - - EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); } - bool nonZero(bool checkStyle = true) const { - return width != 0 && (!checkStyle || m_style != BNONE); + return width() && (!checkStyle || m_style != BNONE); } bool isTransparent() const { - return color.isValid() && color.alpha() == 0; + return m_color.isValid() && !m_color.alpha(); } bool isVisible(bool checkStyle = true) const @@ -61,13 +56,22 @@ public: bool operator==(const BorderValue& o) const { - return width == o.width && m_style == o.m_style && color == o.color; + return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color; } bool operator!=(const BorderValue& o) const { return !(*this == o); } + + const Color& color() const { return m_color; } + unsigned short width() const { return m_width; } + EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); } + +protected: + Color m_color; + unsigned m_width : 12; + unsigned m_style : 4; // EBorderStyle }; } // namespace WebCore |