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

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

Issue 2838643003: Invalidate collapsed borders using currentColor when color changes (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
Index: third_party/WebKit/Source/core/style/CollapsedBorderValue.h
diff --git a/third_party/WebKit/Source/core/style/CollapsedBorderValue.h b/third_party/WebKit/Source/core/style/CollapsedBorderValue.h
index b22e8f58c69d891952bee5aabf8952bde9ccc126..a31500720696316ff84f3ef9b22626984d02d267 100644
--- a/third_party/WebKit/Source/core/style/CollapsedBorderValue.h
+++ b/third_party/WebKit/Source/core/style/CollapsedBorderValue.h
@@ -36,17 +36,15 @@ class CollapsedBorderValue {
public:
CollapsedBorderValue()
: color_(0),
- color_is_current_color_(true),
width_(0),
style_(kBorderStyleNone),
precedence_(kBorderPrecedenceOff),
transparent_(false) {}
CollapsedBorderValue(const BorderValue& border,
- const StyleColor& color,
+ const Color& color,
Xianzhu 2017/04/24 21:09:22 Actually we always pass Color instead of StyleColo
EBorderPrecedence precedence)
- : color_(color.Resolve(Color())),
- color_is_current_color_(color.IsCurrentColor()),
+ : color_(color),
width_(border.NonZero() ? border.Width() : 0),
style_(border.Style()),
precedence_(precedence),
@@ -55,10 +53,7 @@ class CollapsedBorderValue {
unsigned Width() const { return style_ > kBorderStyleHidden ? width_ : 0; }
EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); }
bool Exists() const { return precedence_ != kBorderPrecedenceOff; }
- StyleColor GetColor() const {
- return color_is_current_color_ ? StyleColor::CurrentColor()
- : StyleColor(color_);
- }
+ Color GetColor() const { return color_; }
bool IsTransparent() const { return transparent_; }
EBorderPrecedence Precedence() const {
return static_cast<EBorderPrecedence>(precedence_);
@@ -87,8 +82,7 @@ class CollapsedBorderValue {
private:
Color color_;
- unsigned color_is_current_color_ : 1;
- unsigned width_ : 23;
+ unsigned width_ : 24;
unsigned style_ : 4; // EBorderStyle
unsigned precedence_ : 3; // EBorderPrecedence
unsigned transparent_ : 1;

Powered by Google App Engine
This is Rietveld 408576698