| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/TableCellPainter.h" | 6 #include "core/paint/TableCellPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutTableCell.h" | 8 #include "core/layout/LayoutTableCell.h" |
| 9 #include "core/paint/BlockPainter.h" | 9 #include "core/paint/BlockPainter.h" |
| 10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 void TableCellPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo,
const LayoutPoint& paintOffset) | 178 void TableCellPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo,
const LayoutPoint& paintOffset) |
| 179 { | 179 { |
| 180 if (!paintInfo.shouldPaintWithinRoot(&m_layoutTableCell)) | 180 if (!paintInfo.shouldPaintWithinRoot(&m_layoutTableCell)) |
| 181 return; | 181 return; |
| 182 | 182 |
| 183 LayoutTable* table = m_layoutTableCell.table(); | 183 LayoutTable* table = m_layoutTableCell.table(); |
| 184 if (!table->collapseBorders() && m_layoutTableCell.style()->emptyCells() ==
HIDE && !m_layoutTableCell.firstChild()) | 184 if (!table->collapseBorders() && m_layoutTableCell.style()->emptyCells() ==
HIDE && !m_layoutTableCell.firstChild()) |
| 185 return; | 185 return; |
| 186 | 186 |
| 187 bool needsToPaintBorder = m_layoutTableCell.styleRef().hasBorder() && !table
->collapseBorders(); | 187 bool needsToPaintBorder = m_layoutTableCell.styleRef().hasBorderDecoration()
&& !table->collapseBorders(); |
| 188 if (!m_layoutTableCell.hasBackground() && !m_layoutTableCell.styleRef().boxS
hadow() && !needsToPaintBorder) | 188 if (!m_layoutTableCell.hasBackground() && !m_layoutTableCell.styleRef().boxS
hadow() && !needsToPaintBorder) |
| 189 return; | 189 return; |
| 190 | 190 |
| 191 LayoutRect paintRect = paintBounds(paintOffset, DoNotAddOffsetFromParent); | 191 LayoutRect paintRect = paintBounds(paintOffset, DoNotAddOffsetFromParent); |
| 192 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell,
DisplayItem::BoxDecorationBackground, pixelSnappedIntRect(paintRect)); | 192 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTableCell,
DisplayItem::BoxDecorationBackground, pixelSnappedIntRect(paintRect)); |
| 193 if (recorder.canUseCachedDrawing()) | 193 if (recorder.canUseCachedDrawing()) |
| 194 return; | 194 return; |
| 195 | 195 |
| 196 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutTableCell.styleRef(
), Normal); | 196 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutTableCell.styleRef(
), Normal); |
| 197 | 197 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 221 LayoutRect TableCellPainter::paintBounds(const LayoutPoint& paintOffset, PaintBo
undOffsetBehavior paintBoundOffsetBehavior) | 221 LayoutRect TableCellPainter::paintBounds(const LayoutPoint& paintOffset, PaintBo
undOffsetBehavior paintBoundOffsetBehavior) |
| 222 { | 222 { |
| 223 LayoutPoint adjustedPaintOffset = paintOffset; | 223 LayoutPoint adjustedPaintOffset = paintOffset; |
| 224 if (paintBoundOffsetBehavior == AddOffsetFromParent) | 224 if (paintBoundOffsetBehavior == AddOffsetFromParent) |
| 225 adjustedPaintOffset.moveBy(m_layoutTableCell.location()); | 225 adjustedPaintOffset.moveBy(m_layoutTableCell.location()); |
| 226 return LayoutRect(adjustedPaintOffset, LayoutSize(m_layoutTableCell.pixelSna
ppedSize())); | 226 return LayoutRect(adjustedPaintOffset, LayoutSize(m_layoutTableCell.pixelSna
ppedSize())); |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace blink | 229 } // namespace blink |
| 230 | 230 |
| OLD | NEW |