OLD | NEW |
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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 return; | 1161 return; |
1162 | 1162 |
1163 RenderTable* tableElt = table(); | 1163 RenderTable* tableElt = table(); |
1164 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) | 1164 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) |
1165 return; | 1165 return; |
1166 | 1166 |
1167 LayoutPoint adjustedPaintOffset = paintOffset; | 1167 LayoutPoint adjustedPaintOffset = paintOffset; |
1168 if (backgroundObject != this) | 1168 if (backgroundObject != this) |
1169 adjustedPaintOffset.moveBy(location()); | 1169 adjustedPaintOffset.moveBy(location()); |
1170 | 1170 |
1171 Color c = backgroundObject->resolveColor(CSSPropertyBackgroundColor); | 1171 StyleColor c = backgroundObject->resolveStyleColor(CSSPropertyBackgroundColo
r); |
1172 const FillLayer* bgLayer = backgroundObject->style()->backgroundLayers(); | 1172 const FillLayer* bgLayer = backgroundObject->style()->backgroundLayers(); |
1173 | 1173 |
1174 if (bgLayer->hasImage() || c.isValid()) { | 1174 if (bgLayer->hasImage() || c.isValid()) { |
1175 // We have to clip here because the background would paint | 1175 // We have to clip here because the background would paint |
1176 // on top of the borders otherwise. This only matters for cells and row
s. | 1176 // on top of the borders otherwise. This only matters for cells and row
s. |
1177 bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == t
his || backgroundObject == parent()) && tableElt->collapseBorders(); | 1177 bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == t
his || backgroundObject == parent()) && tableElt->collapseBorders(); |
1178 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip); | 1178 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip); |
1179 if (shouldClip) { | 1179 if (shouldClip) { |
1180 LayoutRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjusted
PaintOffset.y() + borderTop(), | 1180 LayoutRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjusted
PaintOffset.y() + borderTop(), |
1181 width() - borderLeft() - borderRight(), height() - borderTop() -
borderBottom()); | 1181 width() - borderLeft() - borderRight(), height() - borderTop() -
borderBottom()); |
1182 paintInfo.context->clip(clipRect); | 1182 paintInfo.context->clip(clipRect); |
1183 } | 1183 } |
1184 paintFillLayers(paintInfo, c, bgLayer, LayoutRect(adjustedPaintOffset, p
ixelSnappedSize()), BackgroundBleedNone, CompositeSourceOver, backgroundObject); | 1184 paintFillLayers(paintInfo, c.color(), bgLayer, LayoutRect(adjustedPaintO
ffset, pixelSnappedSize()), BackgroundBleedNone, CompositeSourceOver, background
Object); |
1185 } | 1185 } |
1186 } | 1186 } |
1187 | 1187 |
1188 void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoin
t& paintOffset) | 1188 void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoin
t& paintOffset) |
1189 { | 1189 { |
1190 if (!paintInfo.shouldPaintWithinRoot(this)) | 1190 if (!paintInfo.shouldPaintWithinRoot(this)) |
1191 return; | 1191 return; |
1192 | 1192 |
1193 RenderTable* tableElt = table(); | 1193 RenderTable* tableElt = table(); |
1194 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) | 1194 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 | 1258 |
1259 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1259 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
1260 { | 1260 { |
1261 RenderTableCell* newCell = RenderTableCell::createAnonymous(parent->document
()); | 1261 RenderTableCell* newCell = RenderTableCell::createAnonymous(parent->document
()); |
1262 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1262 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
1263 newCell->setStyle(newStyle.release()); | 1263 newCell->setStyle(newStyle.release()); |
1264 return newCell; | 1264 return newCell; |
1265 } | 1265 } |
1266 | 1266 |
1267 } // namespace WebCore | 1267 } // namespace WebCore |
OLD | NEW |