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

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

Issue 2858143003: Move condition in CollapsedBorderValue::Width() into constructor (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | no next file » | 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/layout/CollapsedBorderValue.h b/third_party/WebKit/Source/core/layout/CollapsedBorderValue.h
index d555c97fd2f81c6c81e1ea07a76c5e68eb75edc0..8c5c5b628a96897259230d09fdb3bdae399be2af 100644
--- a/third_party/WebKit/Source/core/layout/CollapsedBorderValue.h
+++ b/third_party/WebKit/Source/core/layout/CollapsedBorderValue.h
@@ -56,14 +56,14 @@ class CollapsedBorderValue {
const Color& color,
EBorderPrecedence precedence)
: color_(color),
- width_(border.NonZero() ? border.Width() : 0),
+ width_(border.Style() > kBorderStyleHidden ? border.Width() : 0),
Xianzhu 2017/05/04 20:45:26 BorderValue::NonZero() is: { return Width() && (s
wkorman 2017/05/04 21:13:04 Seems like unit tests for these permutations could
Xianzhu 2017/05/04 22:23:35 Added tests.
style_(border.Style()),
precedence_(precedence),
transparent_(border.IsTransparent()) {
DCHECK(precedence != kBorderPrecedenceOff);
}
- unsigned Width() const { return style_ > kBorderStyleHidden ? width_ : 0; }
+ unsigned Width() const { return width_; }
EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); }
bool Exists() const { return precedence_ != kBorderPrecedenceOff; }
Color GetColor() const { return color_; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698