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 64b409e8ede5755e6572e1d1479c583447349df4..60ae134cc8862cfa4772121f3d3cc8f1b008cc3f 100644 |
| --- a/Source/core/rendering/style/RenderStyle.cpp |
| +++ b/Source/core/rendering/style/RenderStyle.cpp |
| @@ -1324,20 +1324,25 @@ void RenderStyle::applyTextDecorations() |
| if (textDecoration() == TextDecorationNone) |
| return; |
| + TextDecorationStyle style = textDecorationStyle(); |
| + StyleColor styleColor = visitedDependentDecorationStyleColor(); |
| + |
| int decorations = textDecoration(); |
| if (decorations & TextDecorationUnderline) { |
| // To save memory, we don't use AppliedTextDecoration objects in the |
| - // common case of a single underline. |
| - if (!rareInheritedData->appliedTextDecorations) |
| + // common case of a single simple underline. |
| + AppliedTextDecoration underline(TextDecorationUnderline, style, styleColor); |
| + |
| + if (!rareInheritedData->appliedTextDecorations && underline.isSimple()) |
| inherited_flags.m_textUnderline = true; |
| else |
| - addAppliedTextDecoration(AppliedTextDecoration(TextDecorationUnderline)); |
| + addAppliedTextDecoration(underline); |
| } |
| if (decorations & TextDecorationOverline) |
| - addAppliedTextDecoration(AppliedTextDecoration(TextDecorationOverline)); |
| + addAppliedTextDecoration(AppliedTextDecoration(TextDecorationOverline, style, styleColor)); |
| if (decorations & TextDecorationLineThrough) |
| - addAppliedTextDecoration(AppliedTextDecoration(TextDecorationLineThrough)); |
| + addAppliedTextDecoration(AppliedTextDecoration(TextDecorationLineThrough, style, styleColor)); |
| } |
| void RenderStyle::clearAppliedTextDecorations() |
| @@ -1425,10 +1430,29 @@ void RenderStyle::getShadowVerticalExtent(const ShadowList* shadowList, LayoutUn |
| } |
| } |
| -StyleColor RenderStyle::visitedDependentDecorationColor() const |
| +StyleColor RenderStyle::visitedDependentDecorationStyleColor() const |
| +{ |
| + bool isVisited = insideLink() == InsideVisitedLink; |
| + |
| + StyleColor styleColor = isVisited ? visitedLinkTextDecorationColor() : textDecorationColor(); |
| + |
| + if (!styleColor.isCurrentColor()) |
|
Julien - ping for review
2014/05/19 10:30:18
Shouldn't we also make sure that |styleColor| is n
andersr
2014/05/19 12:54:02
Hmm, I don't think so, because then we would fall
|
| + return styleColor; |
| + |
| + if (textStrokeWidth()) { |
| + // Prefer stroke color if possible, but not if it's fully transparent. |
| + StyleColor textStrokeStyleColor = isVisited ? visitedLinkTextStrokeColor() : textStrokeColor(); |
| + if (!textStrokeStyleColor.isCurrentColor() && textStrokeStyleColor.color().alpha()) |
| + return textStrokeStyleColor; |
| + } |
| + |
| + return isVisited ? visitedLinkTextFillColor() : textFillColor(); |
| +} |
| + |
| +Color RenderStyle::visitedDependentDecorationColor() const |
| { |
| - // Text decoration color fallback is handled in RenderObject::decorationColor. |
| - return insideLink() == InsideVisitedLink ? visitedLinkTextDecorationColor() : textDecorationColor(); |
| + bool isVisited = insideLink() == InsideVisitedLink; |
| + return visitedDependentDecorationStyleColor().resolve(isVisited ? visitedLinkColor() : color()); |
| } |
| Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) const |