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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 195093002: Support multiple text decoration styles. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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/RenderObject.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/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 9562761e91aeb1863012833c8bc802c1e974419b..f06cf1a2a454c45e303f2c71317bb5678e36d9b1 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -2968,31 +2968,35 @@ static Color decorationColor(const RenderObject* object, RenderStyle* style)
return object->resolveColor(style, CSSPropertyWebkitTextFillColor);
}
-void RenderObject::getTextDecorationColors(unsigned decorations, Color& underline, Color& overline,
- Color& linethrough, bool quirksMode, bool firstlineStyle)
+void RenderObject::getTextDecorations(unsigned decorations, AppliedTextDecoration& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethrough, bool quirksMode, bool firstlineStyle)
{
RenderObject* curr = this;
RenderStyle* styleToUse = 0;
unsigned currDecs = TextDecorationNone;
Color resultColor;
+ TextDecorationStyle resultStyle;
do {
styleToUse = curr->style(firstlineStyle);
currDecs = styleToUse->textDecoration();
currDecs &= decorations;
resultColor = decorationColor(this, styleToUse);
+ resultStyle = styleToUse->textDecorationStyle();
// Parameter 'decorations' is cast as an int to enable the bitwise operations below.
if (currDecs) {
if (currDecs & TextDecorationUnderline) {
decorations &= ~TextDecorationUnderline;
- underline = resultColor;
+ underline.color = resultColor;
+ underline.style = resultStyle;
}
if (currDecs & TextDecorationOverline) {
decorations &= ~TextDecorationOverline;
- overline = resultColor;
+ overline.color = resultColor;
+ overline.style = resultStyle;
}
if (currDecs & TextDecorationLineThrough) {
decorations &= ~TextDecorationLineThrough;
- linethrough = resultColor;
+ linethrough.color = resultColor;
+ linethrough.style = resultStyle;
}
}
if (curr->isRubyText())
@@ -3006,12 +3010,18 @@ void RenderObject::getTextDecorationColors(unsigned decorations, Color& underlin
if (decorations && curr) {
styleToUse = curr->style(firstlineStyle);
resultColor = decorationColor(this, styleToUse);
- if (decorations & TextDecorationUnderline)
- underline = resultColor;
- if (decorations & TextDecorationOverline)
- overline = resultColor;
- if (decorations & TextDecorationLineThrough)
- linethrough = resultColor;
+ if (decorations & TextDecorationUnderline) {
+ underline.color = resultColor;
+ underline.style = resultStyle;
+ }
+ if (decorations & TextDecorationOverline) {
+ overline.color = resultColor;
+ overline.style = resultStyle;
+ }
+ if (decorations & TextDecorationLineThrough) {
+ linethrough.color = resultColor;
+ linethrough.style = resultStyle;
+ }
}
}
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698