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

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

Issue 19697011: Change rendering code to use RenderObject::resolveColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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/RenderBox.cpp ('k') | Source/core/rendering/RenderDetailsMarker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index 809d44c78e4bcc1cd621a90954b8d350fc564eca..f2094be1e75a35b074d7d4e240caa99e510291d9 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -509,14 +509,14 @@ RoundedRect RenderBoxModelObject::backgroundRoundedRectAdjustedForBleedAvoidance
return getBackgroundRoundedRect(borderRect, box, boxSize.width(), boxSize.height(), includeLogicalLeftEdge, includeLogicalRightEdge);
}
-static void applyBoxShadowForBackground(GraphicsContext* context, RenderStyle* style)
+static void applyBoxShadowForBackground(GraphicsContext* context, const RenderObject* renderer)
{
- const ShadowData* boxShadow = style->boxShadow();
+ const ShadowData* boxShadow = renderer->style()->boxShadow();
while (boxShadow->style() != Normal)
boxShadow = boxShadow->next();
FloatSize shadowOffset(boxShadow->x(), boxShadow->y());
- context->setShadow(shadowOffset, boxShadow->blur(), boxShadow->color(),
+ context->setShadow(shadowOffset, boxShadow->blur(), renderer->resolveColor(boxShadow->color()),
DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
}
@@ -573,7 +573,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
bool boxShadowShouldBeAppliedToBackground = this->boxShadowShouldBeAppliedToBackground(bleedAvoidance, box);
GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShouldBeAppliedToBackground);
if (boxShadowShouldBeAppliedToBackground)
- applyBoxShadowForBackground(context, style());
+ applyBoxShadowForBackground(context, this);
if (hasRoundedBorder && bleedAvoidance != BackgroundBleedUseTransparencyLayer) {
RoundedRect border = backgroundRoundedRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance, box, boxSize, includeLeftEdge, includeRightEdge);
@@ -717,7 +717,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
GraphicsContextStateSaver shadowStateSaver(*context, boxShadowShouldBeAppliedToBackground);
if (boxShadowShouldBeAppliedToBackground)
- applyBoxShadowForBackground(context, style());
+ applyBoxShadowForBackground(context, this);
if (baseColor.alpha()) {
if (bgColor.alpha())
@@ -1784,7 +1784,7 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect&
path.addRoundedRect(innerBorder);
else
path.addRect(innerBorder.rect());
-
+
graphicsContext->setFillRule(RULE_EVENODD);
graphicsContext->setFillColor(edges[firstVisibleEdge].color);
graphicsContext->fillPath(path);
@@ -2289,25 +2289,25 @@ void RenderBoxModelObject::getBorderEdgeInfo(BorderEdge edges[], const RenderSty
bool horizontal = style->isHorizontalWritingMode();
edges[BSTop] = BorderEdge(style->borderTopWidth(),
- style->visitedDependentColor(CSSPropertyBorderTopColor),
+ resolveColor(style, CSSPropertyBorderTopColor),
style->borderTopStyle(),
style->borderTopIsTransparent(),
horizontal || includeLogicalLeftEdge);
edges[BSRight] = BorderEdge(style->borderRightWidth(),
- style->visitedDependentColor(CSSPropertyBorderRightColor),
+ resolveColor(style, CSSPropertyBorderRightColor),
style->borderRightStyle(),
style->borderRightIsTransparent(),
!horizontal || includeLogicalRightEdge);
edges[BSBottom] = BorderEdge(style->borderBottomWidth(),
- style->visitedDependentColor(CSSPropertyBorderBottomColor),
+ resolveColor(style, CSSPropertyBorderBottomColor),
style->borderBottomStyle(),
style->borderBottomIsTransparent(),
horizontal || includeLogicalRightEdge);
edges[BSLeft] = BorderEdge(style->borderLeftWidth(),
- style->visitedDependentColor(CSSPropertyBorderLeftColor),
+ resolveColor(style, CSSPropertyBorderLeftColor),
style->borderLeftStyle(),
style->borderLeftIsTransparent(),
!horizontal || includeLogicalLeftEdge);
@@ -2374,7 +2374,7 @@ bool RenderBoxModelObject::boxShadowShouldBeAppliedToBackground(BackgroundBleedA
if (!hasOneNormalBoxShadow)
return false;
- Color backgroundColor = style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ Color backgroundColor = resolveColor(CSSPropertyBackgroundColor);
if (!backgroundColor.isValid() || backgroundColor.hasAlpha())
return false;
@@ -2436,7 +2436,7 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
if (shadowOffset.isZero() && !shadowBlur && !shadowSpread)
continue;
- const Color& shadowColor = shadow->color();
+ const Color& shadowColor = resolveColor(shadow->color());
if (shadow->style() == Normal) {
RoundedRect fillRect = border;
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderDetailsMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698