Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Unified Diff: third_party/WebKit/Source/core/layout/CollapsedBorderValue.h

Issue 2842323002: Treat zero-width collapsed borders as invisible (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/LayoutTable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « third_party/WebKit/Source/core/layout/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/LayoutTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698