From ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 8 Aug 2014 14:30:41 +0200 Subject: Update Chromium to beta version 37.0.2062.68 Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi --- .../Source/core/rendering/style/BorderValue.h | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'chromium/third_party/WebKit/Source/core/rendering/style/BorderValue.h') diff --git a/chromium/third_party/WebKit/Source/core/rendering/style/BorderValue.h b/chromium/third_party/WebKit/Source/core/rendering/style/BorderValue.h index dcd5096df0b..211f0be97f9 100644 --- a/chromium/third_party/WebKit/Source/core/rendering/style/BorderValue.h +++ b/chromium/third_party/WebKit/Source/core/rendering/style/BorderValue.h @@ -25,6 +25,7 @@ #ifndef BorderValue_h #define BorderValue_h +#include "core/css/StyleColor.h" #include "core/rendering/style/RenderStyleConstants.h" #include "platform/graphics/Color.h" @@ -35,7 +36,7 @@ friend class RenderStyle; public: BorderValue() : m_color(0) - , m_colorIsValid(false) + , m_colorIsCurrentColor(true) , m_width(3) , m_style(BNONE) , m_isAuto(AUTO_OFF) @@ -49,7 +50,7 @@ public: bool isTransparent() const { - return m_colorIsValid && !alphaChannel(m_color); + return !m_colorIsCurrentColor && !m_color.alpha(); } bool isVisible(bool checkStyle = true) const @@ -59,7 +60,17 @@ 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 && m_colorIsCurrentColor == o.m_colorIsCurrentColor; + } + + // The default width is 3px, but if the style is none we compute a value of 0 (in RenderStyle itself) + bool visuallyEqual(const BorderValue& o) const + { + if (m_style == BNONE && o.m_style == BNONE) + return true; + if (m_style == BHIDDEN && o.m_style == BHIDDEN) + return true; + return *this == o; } bool operator!=(const BorderValue& o) const @@ -67,20 +78,20 @@ public: return !(*this == o); } - void setColor(const Color& color) + void setColor(const StyleColor& color) { - m_color = color.rgb(); - m_colorIsValid = color.isValid(); + m_color = color.resolve(Color()); + m_colorIsCurrentColor = color.isCurrentColor(); } - Color color() const { return Color(m_color, m_colorIsValid); } + StyleColor color() const { return m_colorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_color); } unsigned width() const { return m_width; } EBorderStyle style() const { return static_cast(m_style); } protected: - RGBA32 m_color; - unsigned m_colorIsValid : 1; + Color m_color; + unsigned m_colorIsCurrentColor : 1; unsigned m_width : 26; unsigned m_style : 4; // EBorderStyle -- cgit v1.2.3