| 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 10 matching lines...) Expand all Loading... |
| 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 21 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 22 * Boston, MA 02110-1301, USA. | 22 * Boston, MA 02110-1301, USA. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "config.h" | 25 #include "config.h" |
| 26 #include "core/rendering/RenderTableCell.h" | 26 #include "core/rendering/RenderTableCell.h" |
| 27 | 27 |
| 28 #include "core/HTMLNames.h" | 28 #include "core/HTMLNames.h" |
| 29 #include "core/css/StylePropertySet.h" | 29 #include "core/css/StylePropertySet.h" |
| 30 #include "core/html/HTMLTableCellElement.h" | 30 #include "core/html/HTMLTableCellElement.h" |
| 31 #include "core/paint/BoxPainter.h" |
| 31 #include "core/rendering/PaintInfo.h" | 32 #include "core/rendering/PaintInfo.h" |
| 32 #include "core/rendering/RenderTableCol.h" | 33 #include "core/rendering/RenderTableCol.h" |
| 33 #include "core/rendering/RenderView.h" | 34 #include "core/rendering/RenderView.h" |
| 34 #include "core/rendering/SubtreeLayoutScope.h" | 35 #include "core/rendering/SubtreeLayoutScope.h" |
| 35 #include "core/rendering/style/CollapsedBorderValue.h" | 36 #include "core/rendering/style/CollapsedBorderValue.h" |
| 36 #include "platform/geometry/FloatQuad.h" | 37 #include "platform/geometry/FloatQuad.h" |
| 37 #include "platform/geometry/TransformState.h" | 38 #include "platform/geometry/TransformState.h" |
| 38 #include "platform/graphics/GraphicsContextStateSaver.h" | 39 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 if (bgLayer.hasImage() || c.alpha()) { | 1177 if (bgLayer.hasImage() || c.alpha()) { |
| 1177 // We have to clip here because the background would paint | 1178 // 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. | 1179 // 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(); | 1180 bool shouldClip = backgroundObject->hasLayer() && (backgroundObject == t
his || backgroundObject == parent()) && tableElt->collapseBorders(); |
| 1180 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip); | 1181 GraphicsContextStateSaver stateSaver(*paintInfo.context, shouldClip); |
| 1181 if (shouldClip) { | 1182 if (shouldClip) { |
| 1182 LayoutRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjusted
PaintOffset.y() + borderTop(), | 1183 LayoutRect clipRect(adjustedPaintOffset.x() + borderLeft(), adjusted
PaintOffset.y() + borderTop(), |
| 1183 width() - borderLeft() - borderRight(), height() - borderTop() -
borderBottom()); | 1184 width() - borderLeft() - borderRight(), height() - borderTop() -
borderBottom()); |
| 1184 paintInfo.context->clip(clipRect); | 1185 paintInfo.context->clip(clipRect); |
| 1185 } | 1186 } |
| 1186 paintFillLayers(paintInfo, c, bgLayer, LayoutRect(adjustedPaintOffset, p
ixelSnappedSize()), BackgroundBleedNone, CompositeSourceOver, backgroundObject); | 1187 BoxPainter(*this).paintFillLayers(paintInfo, c, bgLayer, LayoutRect(adju
stedPaintOffset, pixelSnappedSize()), BackgroundBleedNone, CompositeSourceOver,
backgroundObject); |
| 1187 } | 1188 } |
| 1188 } | 1189 } |
| 1189 | 1190 |
| 1190 void RenderTableCell::paintBoxDecorationBackground(PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) | 1191 void RenderTableCell::paintBoxDecorationBackground(PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) |
| 1191 { | 1192 { |
| 1192 if (!paintInfo.shouldPaintWithinRoot(this)) | 1193 if (!paintInfo.shouldPaintWithinRoot(this)) |
| 1193 return; | 1194 return; |
| 1194 | 1195 |
| 1195 RenderTable* tableElt = table(); | 1196 RenderTable* tableElt = table(); |
| 1196 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) | 1197 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1212 | 1213 |
| 1213 void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) | 1214 void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) |
| 1214 { | 1215 { |
| 1215 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) | 1216 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) |
| 1216 return; | 1217 return; |
| 1217 | 1218 |
| 1218 RenderTable* tableElt = table(); | 1219 RenderTable* tableElt = table(); |
| 1219 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) | 1220 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) |
| 1220 return; | 1221 return; |
| 1221 | 1222 |
| 1222 paintMaskImages(paintInfo, LayoutRect(paintOffset, pixelSnappedSize())); | 1223 BoxPainter(*this).paintMaskImages(paintInfo, LayoutRect(paintOffset, pixelSn
appedSize())); |
| 1223 } | 1224 } |
| 1224 | 1225 |
| 1225 bool RenderTableCell::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoida
nce, InlineFlowBox*) const | 1226 bool RenderTableCell::boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoida
nce, InlineFlowBox*) const |
| 1226 { | 1227 { |
| 1227 return false; | 1228 return false; |
| 1228 } | 1229 } |
| 1229 | 1230 |
| 1230 void RenderTableCell::scrollbarsChanged(bool horizontalScrollbarChanged, bool ve
rticalScrollbarChanged) | 1231 void RenderTableCell::scrollbarsChanged(bool horizontalScrollbarChanged, bool ve
rticalScrollbarChanged) |
| 1231 { | 1232 { |
| 1232 LayoutUnit scrollbarHeight = scrollbarLogicalHeight(); | 1233 LayoutUnit scrollbarHeight = scrollbarLogicalHeight(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1260 | 1261 |
| 1261 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
| 1262 { | 1263 { |
| 1263 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); | 1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); |
| 1264 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
| 1265 newCell->setStyle(newStyle.release()); | 1266 newCell->setStyle(newStyle.release()); |
| 1266 return newCell; | 1267 return newCell; |
| 1267 } | 1268 } |
| 1268 | 1269 |
| 1269 } // namespace blink | 1270 } // namespace blink |
| OLD | NEW |