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

Side by Side Diff: Source/core/rendering/RenderTableCell.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 return; 1163 return;
1164 1164
1165 RenderTable* tableElt = table(); 1165 RenderTable* tableElt = table();
1166 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild()) 1166 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild())
1167 return; 1167 return;
1168 1168
1169 LayoutPoint adjustedPaintOffset = paintOffset; 1169 LayoutPoint adjustedPaintOffset = paintOffset;
1170 if (backgroundObject != this) 1170 if (backgroundObject != this)
1171 adjustedPaintOffset.moveBy(location()); 1171 adjustedPaintOffset.moveBy(location());
1172 1172
1173 StyleColor c = backgroundObject->resolveStyleColor(CSSPropertyBackgroundColo r); 1173 Color c = backgroundObject->resolveColor(CSSPropertyBackgroundColor);
1174 const FillLayer* bgLayer = backgroundObject->style()->backgroundLayers(); 1174 const FillLayer* bgLayer = backgroundObject->style()->backgroundLayers();
1175 1175
1176 if (bgLayer->hasImage() || c.isValid()) { 1176 if (bgLayer->hasImage() || c.isValid()) {
1177 // We have to clip here because the background would paint 1177 // We have to clip here because the background would paint
1178 // on top of the borders otherwise. This only matters for cells and row s. 1178 // on top of the borders otherwise. This only matters for cells and row s.
1179 bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == t his || backgroundObject == parent()) && tableElt->collapseBorders(); 1179 bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == t his || backgroundObject == parent()) && tableElt->collapseBorders();
1180 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip); 1180 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip);
1181 if (shouldClip) { 1181 if (shouldClip) {
1182 LayoutRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjusted PaintOffset.y() + borderTop(), 1182 LayoutRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjusted PaintOffset.y() + borderTop(),
1183 width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom()); 1183 width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom());
1184 paintInfo.context->clip(clipRect); 1184 paintInfo.context->clip(clipRect);
1185 } 1185 }
1186 paintFillLayers(paintInfo, c.color(), bgLayer, LayoutRect(adjustedPaintO ffset, pixelSnappedSize()), BackgroundBleedNone, CompositeSourceOver, background Object); 1186 paintFillLayers(paintInfo, c, bgLayer, LayoutRect(adjustedPaintOffset, p ixelSnappedSize()), BackgroundBleedNone, CompositeSourceOver, backgroundObject);
1187 } 1187 }
1188 } 1188 }
1189 1189
1190 void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoin t& paintOffset) 1190 void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoin t& paintOffset)
1191 { 1191 {
1192 if (!paintInfo.shouldPaintWithinRoot(this)) 1192 if (!paintInfo.shouldPaintWithinRoot(this))
1193 return; 1193 return;
1194 1194
1195 RenderTable* tableElt = table(); 1195 RenderTable* tableElt = table();
1196 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild()) 1196 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC hild())
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 1260
1261 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render Object* parent) 1261 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render Object* parent)
1262 { 1262 {
1263 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen t()); 1263 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen t());
1264 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_CELL); 1264 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_CELL);
1265 newCell->setStyle(newStyle.release()); 1265 newCell->setStyle(newStyle.release());
1266 return newCell; 1266 return newCell;
1267 } 1267 }
1268 1268
1269 } // namespace WebCore 1269 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698