Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / style / BorderValue.h
index 8703132..3fcecdc 100644 (file)
@@ -29,7 +29,7 @@
 #include "core/rendering/style/RenderStyleConstants.h"
 #include "platform/graphics/Color.h"
 
-namespace WebCore {
+namespace blink {
 
 class BorderValue {
 friend class RenderStyle;
@@ -63,6 +63,16 @@ public:
         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
     {
         return !(*this == o);
@@ -77,7 +87,9 @@ public:
     StyleColor color() const { return m_colorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_color); }
 
     unsigned width() const { return m_width; }
+
     EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
+    void setStyle(EBorderStyle style) { m_style = style; }
 
 protected:
     Color m_color;
@@ -90,6 +102,6 @@ protected:
     unsigned m_isAuto : 1; // OutlineIsAuto
 };
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // BorderValue_h