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

Unified Diff: Source/core/rendering/RenderBoxModelObject.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/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index 3917086023c2ddb19338130cb5ab893e5845337e..aada21668d2aeabe3d149fa3e8ad5fe5988748ad 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -556,14 +556,14 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
// while rendering.)
if (forceBackgroundToWhite) {
// Note that we can't reuse this variable below because the bgColor might be changed
- bool shouldPaintBackgroundColor = !bgLayer->next() && bgColor.alpha();
+ bool shouldPaintBackgroundColor = !bgLayer->next() && bgColor.isValid() && bgColor.alpha();
if (shouldPaintBackgroundImage || shouldPaintBackgroundColor) {
bgColor = Color::white;
shouldPaintBackgroundImage = false;
}
}
- bool colorVisible = bgColor.alpha();
+ bool colorVisible = bgColor.isValid() && bgColor.alpha();
// Fast path for drawing simple color backgrounds.
if (!isRoot && !clippedWithLocalScrolling && !shouldPaintBackgroundImage && isBorderFill && !bgLayer->next()) {
@@ -673,7 +673,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
bool isOpaqueRoot = false;
if (isRoot) {
isOpaqueRoot = true;
- if (!bgLayer->next() && !(bgColor.alpha() == 255) && view()->frameView()) {
+ if (!bgLayer->next() && !(bgColor.isValid() && bgColor.alpha() == 255) && view()->frameView()) {
Element* ownerElement = document().ownerElement();
if (ownerElement) {
if (!ownerElement->hasTagName(frameTag)) {
@@ -2401,7 +2401,7 @@ bool RenderBoxModelObject::boxShadowShouldBeAppliedToBackground(BackgroundBleedA
return false;
Color backgroundColor = resolveColor(CSSPropertyBackgroundColor);
- if (backgroundColor.hasAlpha())
+ if (!backgroundColor.isValid() || backgroundColor.hasAlpha())
return false;
const FillLayer* lastBackgroundLayer = style()->backgroundLayers();
@@ -2463,7 +2463,7 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
if (shadowOffset.isZero() && !shadowBlur && !shadowSpread)
continue;
- const Color& shadowColor = resolveColor(shadow->color(), Color::stdShadowColor);
+ const Color& shadowColor = resolveColor(shadow->color());
if (shadow->style() == Normal) {
RoundedRect fillRect = border;

Powered by Google App Engine
This is Rietveld 408576698