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

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 23581008: Revert r154797: "Move isValid/isCurrentColor from Color to StyleColor" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | « Source/core/rendering/style/RenderStyle.h ('k') | Source/core/rendering/style/ShadowData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index 69c874b311eea4129c343aad1435fdb45f81e7a0..9f27b9493f669c9b685ee26b10fbf93770bb1648 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -186,6 +186,7 @@ void RenderStyle::copyNonInheritedFrom(const RenderStyle* other)
noninherited_flags._page_break_after = other->noninherited_flags._page_break_after;
noninherited_flags._page_break_inside = other->noninherited_flags._page_break_inside;
noninherited_flags.explicitInheritance = other->noninherited_flags.explicitInheritance;
+ noninherited_flags.currentColor = other->noninherited_flags.currentColor;
if (m_svgStyle != other->m_svgStyle)
m_svgStyle.access()->copyNonInheritedFrom(other->m_svgStyle.get());
ASSERT(zoom() == initialZoom());
@@ -916,10 +917,10 @@ void RenderStyle::setListStyleImage(PassRefPtr<StyleImage> v)
rareInheritedData.access()->listStyleImage = v;
}
-StyleColor RenderStyle::color() const { return inherited->color; }
-StyleColor RenderStyle::visitedLinkColor() const { return inherited->visitedLinkColor; }
-void RenderStyle::setColor(const StyleColor& v) { SET_VAR(inherited, color, v); }
-void RenderStyle::setVisitedLinkColor(const StyleColor& v) { SET_VAR(inherited, visitedLinkColor, v); }
+Color RenderStyle::color() const { return inherited->color; }
+Color RenderStyle::visitedLinkColor() const { return inherited->visitedLinkColor; }
+void RenderStyle::setColor(const Color& v) { SET_VAR(inherited, color, v); }
+void RenderStyle::setVisitedLinkColor(const Color& v) { SET_VAR(inherited, visitedLinkColor, v); }
short RenderStyle::horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
short RenderStyle::verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
@@ -1291,9 +1292,9 @@ void RenderStyle::getShadowVerticalExtent(const ShadowData* shadow, LayoutUnit &
}
}
-StyleColor RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) const
+Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) const
{
- StyleColor result;
+ Color result;
EBorderStyle borderStyle = BNONE;
switch (colorProperty) {
case CSSPropertyBackgroundColor:
@@ -1352,7 +1353,7 @@ StyleColor RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLi
break;
}
- if (!result.isValid() && !result.isCurrentColor()) {
+ if (!result.isValid()) {
if (!visitedLink && (borderStyle == INSET || borderStyle == OUTSET || borderStyle == RIDGE || borderStyle == GROOVE))
result.setRGB(238, 238, 238);
else
@@ -1361,13 +1362,13 @@ StyleColor RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLi
return result;
}
-StyleColor RenderStyle::visitedDependentColor(int colorProperty) const
+Color RenderStyle::visitedDependentColor(int colorProperty) const
{
- StyleColor unvisitedColor = colorIncludingFallback(colorProperty, false);
+ Color unvisitedColor = colorIncludingFallback(colorProperty, false);
if (insideLink() != InsideVisitedLink)
return unvisitedColor;
- StyleColor visitedColor = colorIncludingFallback(colorProperty, true);
+ Color visitedColor = colorIncludingFallback(colorProperty, true);
// Text decoration color validity is preserved (checked in RenderObject::decorationColor).
if (colorProperty == CSSPropertyTextDecorationColor)
@@ -1381,12 +1382,8 @@ StyleColor RenderStyle::visitedDependentColor(int colorProperty) const
if (colorProperty == CSSPropertyBackgroundColor && visitedColor == Color::transparent)
return unvisitedColor;
- // Unless the visitied color is 'currentColor'; take the alpha from the unvisited color,
- // but get the RGB values from the visited color.
- if (visitedColor.isCurrentColor())
- return visitedColor;
-
- return StyleColor(visitedColor.red(), visitedColor.green(), visitedColor.blue(), unvisitedColor.alpha());
+ // Take the alpha from the unvisited color, but get the RGB values from the visited color.
+ return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), unvisitedColor.alpha());
}
const BorderValue& RenderStyle::borderBefore() const
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | Source/core/rendering/style/ShadowData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698