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

Unified Diff: Source/core/rendering/InlineTextBox.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
Index: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index 5e6648ff1a7b37e4c277973f2be1ba9ff0381128..2e3d986fc8a34b7a0f0a8890f28a5e6fc999cfb5 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -401,8 +401,7 @@ static void paintTextWithShadows(GraphicsContext* context,
int shadowX = horizontal ? shadow->x() : shadow->y();
int shadowY = horizontal ? shadow->y() : -shadow->x();
FloatSize offset(shadowX, shadowY);
- drawLooper.addShadow(offset, shadow->blur(),
- renderer->resolveColor(shadow->color(), Color::stdShadowColor),
+ drawLooper.addShadow(offset, shadow->blur(), renderer->resolveColor(shadow->color()),
DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
} while ((shadow = shadow->next()));
drawLooper.addUnmodifiedContent();
@@ -592,14 +591,14 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
if (haveSelection) {
// Check foreground color first.
Color foreground = paintInfo.forceBlackText() ? Color::black : renderer()->selectionForegroundColor();
- if (foreground != Color::transparent && foreground != selectionFillColor) {
+ if (foreground.isValid() && foreground != selectionFillColor) {
if (!paintSelectedTextOnly)
paintSelectedTextSeparately = true;
selectionFillColor = foreground;
}
Color emphasisMarkForeground = paintInfo.forceBlackText() ? Color::black : renderer()->selectionEmphasisMarkColor();
- if (emphasisMarkForeground != Color::transparent && emphasisMarkForeground != selectionEmphasisMarkColor) {
+ if (emphasisMarkForeground.isValid() && emphasisMarkForeground != selectionEmphasisMarkColor) {
if (!paintSelectedTextOnly)
paintSelectedTextSeparately = true;
selectionEmphasisMarkColor = emphasisMarkForeground;
@@ -839,7 +838,7 @@ void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& b
return;
Color c = renderer()->selectionBackgroundColor();
- if (!c.alpha())
+ if (!c.isValid() || !c.alpha())
return;
// If the text color ends up being the same as the selection background, invert the selection
@@ -1133,8 +1132,7 @@ void InlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint&
}
int shadowX = isHorizontal() ? shadow->x() : shadow->y();
int shadowY = isHorizontal() ? shadow->y() : -shadow->x();
- context->setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow->blur(),
- renderer()->resolveColor(shadow->color(), Color::stdShadowColor));
+ context->setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow->blur(), shadow->color());
shadow = shadow->next();
}

Powered by Google App Engine
This is Rietveld 408576698