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 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 | 1135 |
1136 // We never paint diagonals at the joins. We simply let the border with the
highest | 1136 // We never paint diagonals at the joins. We simply let the border with the
highest |
1137 // precedence paint on top of borders with lower precedence. | 1137 // precedence paint on top of borders with lower precedence. |
1138 CollapsedBorders borders; | 1138 CollapsedBorders borders; |
1139 borders.addBorder(topVal, BSTop, renderTop, borderRect.x(), borderRect.y(),
borderRect.maxX(), borderRect.y() + topWidth, topStyle); | 1139 borders.addBorder(topVal, BSTop, renderTop, borderRect.x(), borderRect.y(),
borderRect.maxX(), borderRect.y() + topWidth, topStyle); |
1140 borders.addBorder(bottomVal, BSBottom, renderBottom, borderRect.x(), borderR
ect.maxY() - bottomWidth, borderRect.maxX(), borderRect.maxY(), bottomStyle); | 1140 borders.addBorder(bottomVal, BSBottom, renderBottom, borderRect.x(), borderR
ect.maxY() - bottomWidth, borderRect.maxX(), borderRect.maxY(), bottomStyle); |
1141 borders.addBorder(leftVal, BSLeft, renderLeft, borderRect.x(), borderRect.y(
), borderRect.x() + leftWidth, borderRect.maxY(), leftStyle); | 1141 borders.addBorder(leftVal, BSLeft, renderLeft, borderRect.x(), borderRect.y(
), borderRect.x() + leftWidth, borderRect.maxY(), leftStyle); |
1142 borders.addBorder(rightVal, BSRight, renderRight, borderRect.maxX() - rightW
idth, borderRect.y(), borderRect.maxX(), borderRect.maxY(), rightStyle); | 1142 borders.addBorder(rightVal, BSRight, renderRight, borderRect.maxX() - rightW
idth, borderRect.y(), borderRect.maxX(), borderRect.maxY(), rightStyle); |
1143 | 1143 |
1144 GraphicsContext* graphicsContext = paintInfo.context; | 1144 GraphicsContext* graphicsContext = paintInfo.context; |
1145 bool antialias = shouldAntialiasLines(graphicsContext); | 1145 bool antialias = BoxPainter::shouldAntialiasLines(graphicsContext); |
1146 | 1146 |
1147 for (CollapsedBorder* border = borders.nextBorder(); border; border = border
s.nextBorder()) { | 1147 for (CollapsedBorder* border = borders.nextBorder(); border; border = border
s.nextBorder()) { |
1148 if (border->borderValue.isSameIgnoringColor(*table()->currentBorderValue
())) { | 1148 if (border->borderValue.isSameIgnoringColor(*table()->currentBorderValue
())) { |
1149 drawLineForBoxSide(graphicsContext, border->x1, border->y1, border->
x2, border->y2, border->side, | 1149 drawLineForBoxSide(graphicsContext, border->x1, border->y1, border->
x2, border->y2, border->side, |
1150 border->borderValue.color().resolve(style()->visitedDependentCol
or(CSSPropertyColor)), border->style, 0, 0, antialias); | 1150 border->borderValue.color().resolve(style()->visitedDependentCol
or(CSSPropertyColor)), border->style, 0, 0, antialias); |
1151 } | 1151 } |
1152 } | 1152 } |
1153 } | 1153 } |
1154 | 1154 |
1155 void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, const Lay
outPoint& paintOffset, RenderObject* backgroundObject) | 1155 void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, const Lay
outPoint& paintOffset, RenderObject* backgroundObject) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 void RenderTableCell::paintBoxDecorationBackground(PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) | 1191 void RenderTableCell::paintBoxDecorationBackground(PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) |
1192 { | 1192 { |
1193 if (!paintInfo.shouldPaintWithinRoot(this)) | 1193 if (!paintInfo.shouldPaintWithinRoot(this)) |
1194 return; | 1194 return; |
1195 | 1195 |
1196 RenderTable* tableElt = table(); | 1196 RenderTable* tableElt = table(); |
1197 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) | 1197 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) |
1198 return; | 1198 return; |
1199 | 1199 |
1200 LayoutRect paintRect = LayoutRect(paintOffset, pixelSnappedSize()); | 1200 LayoutRect paintRect = LayoutRect(paintOffset, pixelSnappedSize()); |
1201 paintBoxShadow(paintInfo, paintRect, style(), Normal); | 1201 BoxPainter::paintBoxShadow(paintInfo, paintRect, style(), Normal); |
1202 | 1202 |
1203 // Paint our cell background. | 1203 // Paint our cell background. |
1204 paintBackgroundsBehindCell(paintInfo, paintOffset, this); | 1204 paintBackgroundsBehindCell(paintInfo, paintOffset, this); |
1205 | 1205 |
1206 paintBoxShadow(paintInfo, paintRect, style(), Inset); | 1206 BoxPainter::paintBoxShadow(paintInfo, paintRect, style(), Inset); |
1207 | 1207 |
1208 if (!style()->hasBorder() || tableElt->collapseBorders()) | 1208 if (!style()->hasBorder() || tableElt->collapseBorders()) |
1209 return; | 1209 return; |
1210 | 1210 |
1211 paintBorder(paintInfo, paintRect, style()); | 1211 BoxPainter::paintBorder(*this, paintInfo, paintRect, style()); |
1212 } | 1212 } |
1213 | 1213 |
1214 void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) | 1214 void RenderTableCell::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) |
1215 { | 1215 { |
1216 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) | 1216 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) |
1217 return; | 1217 return; |
1218 | 1218 |
1219 RenderTable* tableElt = table(); | 1219 RenderTable* tableElt = table(); |
1220 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) | 1220 if (!tableElt->collapseBorders() && style()->emptyCells() == HIDE && !firstC
hild()) |
1221 return; | 1221 return; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 | 1261 |
1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) | 1262 RenderTableCell* RenderTableCell::createAnonymousWithParentRenderer(const Render
Object* parent) |
1263 { | 1263 { |
1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); | 1264 RenderTableCell* newCell = RenderTableCell::createAnonymous(&parent->documen
t()); |
1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); | 1265 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(
parent->style(), TABLE_CELL); |
1266 newCell->setStyle(newStyle.release()); | 1266 newCell->setStyle(newStyle.release()); |
1267 return newCell; | 1267 return newCell; |
1268 } | 1268 } |
1269 | 1269 |
1270 } // namespace blink | 1270 } // namespace blink |
OLD | NEW |