Index: third_party/WebKit/Source/core/layout/CollapsedBorderValue.h |
diff --git a/third_party/WebKit/Source/core/style/CollapsedBorderValue.h b/third_party/WebKit/Source/core/layout/CollapsedBorderValue.h |
similarity index 87% |
rename from third_party/WebKit/Source/core/style/CollapsedBorderValue.h |
rename to third_party/WebKit/Source/core/layout/CollapsedBorderValue.h |
index a31500720696316ff84f3ef9b22626984d02d267..d555c97fd2f81c6c81e1ea07a76c5e68eb75edc0 100644 |
--- a/third_party/WebKit/Source/core/style/CollapsedBorderValue.h |
+++ b/third_party/WebKit/Source/core/layout/CollapsedBorderValue.h |
@@ -30,10 +30,21 @@ |
namespace blink { |
+enum EBorderPrecedence { |
+ kBorderPrecedenceOff, |
+ kBorderPrecedenceTable, |
+ kBorderPrecedenceColumnGroup, |
+ kBorderPrecedenceColumn, |
+ kBorderPrecedenceRowGroup, |
+ kBorderPrecedenceRow, |
+ kBorderPrecedenceCell |
+}; |
+ |
class CollapsedBorderValue { |
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
public: |
+ // Constructs a CollapsedBorderValue for non-existence border. |
CollapsedBorderValue() |
: color_(0), |
width_(0), |
@@ -48,7 +59,9 @@ class CollapsedBorderValue { |
width_(border.NonZero() ? border.Width() : 0), |
style_(border.Style()), |
precedence_(precedence), |
- transparent_(border.IsTransparent()) {} |
+ transparent_(border.IsTransparent()) { |
+ DCHECK(precedence != kBorderPrecedenceOff); |
+ } |
unsigned Width() const { return style_ > kBorderStyleHidden ? width_ : 0; } |
EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); } |
@@ -71,9 +84,7 @@ class CollapsedBorderValue { |
IsSameIgnoringColor(o); |
} |
- bool IsVisible() const { |
- return Style() > kBorderStyleHidden && !IsTransparent() && Exists(); |
- } |
+ bool IsVisible() const { return Width() && !IsTransparent(); } |
bool ShouldPaint( |
const CollapsedBorderValue& table_current_border_value) const { |