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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2880573002: Store border-*-style on SurroundData in ComputedStyle (Closed)
Patch Set: Store border-*-style on SurroundData in ComputedStyle not BorderStyle 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
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index aab482d8813b3d2dbf7066651129b08df4c23228..a8b1fdc63cb750f793d4027652bbad9b3e2a72b2 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -774,22 +774,22 @@ bool ComputedStyle::DiffNeedsFullLayoutAndPaintInvalidation(
// In the collapsing border model, 'hidden' suppresses other borders, while
// 'none' does not, so these style differences can be width differences.
if ((BorderCollapse() == EBorderCollapse::kCollapse) &&
- ((BorderTopStyle() == kBorderStyleHidden &&
- other.BorderTopStyle() == kBorderStyleNone) ||
- (BorderTopStyle() == kBorderStyleNone &&
- other.BorderTopStyle() == kBorderStyleHidden) ||
- (BorderBottomStyle() == kBorderStyleHidden &&
- other.BorderBottomStyle() == kBorderStyleNone) ||
- (BorderBottomStyle() == kBorderStyleNone &&
- other.BorderBottomStyle() == kBorderStyleHidden) ||
- (BorderLeftStyle() == kBorderStyleHidden &&
- other.BorderLeftStyle() == kBorderStyleNone) ||
- (BorderLeftStyle() == kBorderStyleNone &&
- other.BorderLeftStyle() == kBorderStyleHidden) ||
- (BorderRightStyle() == kBorderStyleHidden &&
- other.BorderRightStyle() == kBorderStyleNone) ||
- (BorderRightStyle() == kBorderStyleNone &&
- other.BorderRightStyle() == kBorderStyleHidden)))
+ ((BorderTopStyle() == EBorderStyle::kHidden &&
+ other.BorderTopStyle() == EBorderStyle::kNone) ||
+ (BorderTopStyle() == EBorderStyle::kNone &&
+ other.BorderTopStyle() == EBorderStyle::kHidden) ||
+ (BorderBottomStyle() == EBorderStyle::kHidden &&
+ other.BorderBottomStyle() == EBorderStyle::kNone) ||
+ (BorderBottomStyle() == EBorderStyle::kNone &&
+ other.BorderBottomStyle() == EBorderStyle::kHidden) ||
+ (BorderLeftStyle() == EBorderStyle::kHidden &&
+ other.BorderLeftStyle() == EBorderStyle::kNone) ||
+ (BorderLeftStyle() == EBorderStyle::kNone &&
+ other.BorderLeftStyle() == EBorderStyle::kHidden) ||
+ (BorderRightStyle() == EBorderStyle::kHidden &&
+ other.BorderRightStyle() == EBorderStyle::kNone) ||
+ (BorderRightStyle() == EBorderStyle::kNone &&
+ other.BorderRightStyle() == EBorderStyle::kHidden)))
return true;
} else if (Display() == EDisplay::kListItem) {
if (ListStyleType() != other.ListStyleType() ||
@@ -869,10 +869,8 @@ bool ComputedStyle::DiffNeedsPaintInvalidationObject(
const ComputedStyle& other) const {
if (Visibility() != other.Visibility() ||
PrintColorAdjust() != other.PrintColorAdjust() ||
- InsideLink() != other.InsideLink() ||
- !Border().VisuallyEqual(other.Border()) || !RadiiEqual(other) ||
- !BorderColorVisuallyEquals(other) || !BorderSizeEquals(other) ||
- *background_data_ != *other.background_data_)
+ InsideLink() != other.InsideLink() || !BorderVisuallyEqual(other) ||
+ !RadiiEqual(other) || *background_data_ != *other.background_data_)
return true;
if (rare_inherited_data_.Get() != other.rare_inherited_data_.Get()) {
@@ -2100,7 +2098,7 @@ StyleColor ComputedStyle::DecorationColorIncludingFallback(
Color ComputedStyle::ColorIncludingFallback(int color_property,
bool visited_link) const {
StyleColor result(StyleColor::CurrentColor());
- EBorderStyle border_style = kBorderStyleNone;
+ EBorderStyle border_style = EBorderStyle::kNone;
switch (color_property) {
case CSSPropertyBackgroundColor:
result = visited_link ? VisitedLinkBackgroundColor() : BackgroundColor();
@@ -2176,10 +2174,10 @@ Color ComputedStyle::ColorIncludingFallback(int color_property,
// FIXME: Treating styled borders with initial color differently causes
// problems, see crbug.com/316559, crbug.com/276231
- if (!visited_link &&
- (border_style == kBorderStyleInset ||
- border_style == kBorderStyleOutset ||
- border_style == kBorderStyleRidge || border_style == kBorderStyleGroove))
+ if (!visited_link && (border_style == EBorderStyle::kInset ||
+ border_style == EBorderStyle::kOutset ||
+ border_style == EBorderStyle::kRidge ||
+ border_style == EBorderStyle::kGroove))
return Color(238, 238, 238);
return visited_link ? VisitedLinkColor() : GetColor();
}

Powered by Google App Engine
This is Rietveld 408576698