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

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

Issue 746173002: Respect fallback colors when interpolating text-decoration-color. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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') | no next file » | 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 5dcb788e556cd2aa2baea22ad982534606fc08e4..43f5439d373c7d7652ba3e86e1c2c5cd7378a0d5 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -1271,7 +1271,7 @@ void RenderStyle::applyTextDecorations()
return;
TextDecorationStyle style = textDecorationStyle();
- StyleColor styleColor = visitedDependentDecorationStyleColor();
+ StyleColor styleColor = decorationColorIncludingFallback(insideLink() == InsideVisitedLink);
int decorations = textDecoration();
@@ -1382,29 +1382,21 @@ void RenderStyle::getShadowVerticalExtent(const ShadowList* shadowList, LayoutUn
}
}
-StyleColor RenderStyle::visitedDependentDecorationStyleColor() const
+StyleColor RenderStyle::decorationColorIncludingFallback(bool visitedLink) const
{
- bool isVisited = insideLink() == InsideVisitedLink;
-
- StyleColor styleColor = isVisited ? visitedLinkTextDecorationColor() : textDecorationColor();
+ StyleColor styleColor = visitedLink ? visitedLinkTextDecorationColor() : textDecorationColor();
if (!styleColor.isCurrentColor())
return styleColor;
if (textStrokeWidth()) {
// Prefer stroke color if possible, but not if it's fully transparent.
- StyleColor textStrokeStyleColor = isVisited ? visitedLinkTextStrokeColor() : textStrokeColor();
+ StyleColor textStrokeStyleColor = visitedLink ? visitedLinkTextStrokeColor() : textStrokeColor();
if (!textStrokeStyleColor.isCurrentColor() && textStrokeStyleColor.color().alpha())
return textStrokeStyleColor;
}
- return isVisited ? visitedLinkTextFillColor() : textFillColor();
-}
-
-Color RenderStyle::visitedDependentDecorationColor() const
-{
- bool isVisited = insideLink() == InsideVisitedLink;
- return visitedDependentDecorationStyleColor().resolve(isVisited ? visitedLinkColor() : color());
+ return visitedLink ? visitedLinkTextFillColor() : textFillColor();
}
Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) const
@@ -1461,6 +1453,9 @@ Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) c
case CSSPropertyWebkitTapHighlightColor:
result = tapHighlightColor();
break;
+ case CSSPropertyTextDecorationColor:
+ result = decorationColorIncludingFallback(visitedLink);
+ break;
default:
ASSERT_NOT_REACHED();
break;
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698