Chromium Code Reviews| 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..ac3480b025fa1068b2a70262fc9455c1cdfa119c 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: |
| @@ -1335,24 +1336,12 @@ StyleColor RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLi |
| case CSSPropertyWebkitTextStrokeColor: |
| result = visitedLink ? visitedLinkTextStrokeColor() : textStrokeColor(); |
| break; |
| - case CSSPropertyFloodColor: |
|
leviw_travelin_and_unemployed
2013/09/04 00:37:11
May want to double-check this part.
eae
2013/09/04 00:42:14
Odd. Good catch, fixed.
|
| - result = floodColor(); |
| - break; |
| - case CSSPropertyLightingColor: |
| - result = lightingColor(); |
| - break; |
| - case CSSPropertyStopColor: |
| - result = stopColor(); |
| - break; |
| - case CSSPropertyWebkitTapHighlightColor: |
| - result = tapHighlightColor(); |
| - break; |
| default: |
| ASSERT_NOT_REACHED(); |
| 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 +1350,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 +1370,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 |