| 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/TablePainter.h" | 6 #include "core/paint/TablePainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutTable.h" | 8 #include "core/layout/LayoutTable.h" |
| 9 #include "core/layout/LayoutTableSection.h" | 9 #include "core/layout/LayoutTableSection.h" |
| 10 #include "core/layout/PaintInfo.h" | 10 #include "core/layout/PaintInfo.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // We don't paint our own background, but we do let the kids paint their bac
kgrounds. | 36 // We don't paint our own background, but we do let the kids paint their bac
kgrounds. |
| 37 if (paintPhase == PaintPhaseChildBlockBackgrounds) | 37 if (paintPhase == PaintPhaseChildBlockBackgrounds) |
| 38 paintPhase = PaintPhaseChildBlockBackground; | 38 paintPhase = PaintPhaseChildBlockBackground; |
| 39 | 39 |
| 40 PaintInfo info(paintInfo); | 40 PaintInfo info(paintInfo); |
| 41 info.phase = paintPhase; | 41 info.phase = paintPhase; |
| 42 info.updatePaintingRootForChildren(&m_layoutTable); | 42 info.updatePaintingRootForChildren(&m_layoutTable); |
| 43 | 43 |
| 44 for (LayoutObject* child = m_layoutTable.firstChild(); child; child = child-
>nextSibling()) { | 44 for (LayoutObject* child = m_layoutTable.firstChild(); child; child = child-
>nextSibling()) { |
| 45 if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (ch
ild->isTableSection() || child->isTableCaption())) { | 45 if (child->isBox() && !toLayoutBox(child)->hasSelfPaintingLayer() && (ch
ild->isTableSection() || child->isTableCaption())) { |
| 46 LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChild(to
RenderBox(child), paintOffset); | 46 LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChild(to
LayoutBox(child), paintOffset); |
| 47 child->paint(info, childPoint); | 47 child->paint(info, childPoint); |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 if (m_layoutTable.collapseBorders() && paintPhase == PaintPhaseChildBlockBac
kground && m_layoutTable.style()->visibility() == VISIBLE) { | 51 if (m_layoutTable.collapseBorders() && paintPhase == PaintPhaseChildBlockBac
kground && m_layoutTable.style()->visibility() == VISIBLE) { |
| 52 m_layoutTable.recalcCollapsedBorders(); | 52 m_layoutTable.recalcCollapsedBorders(); |
| 53 // Using our cached sorted styles, we then do individual passes, | 53 // Using our cached sorted styles, we then do individual passes, |
| 54 // painting each style of border from lowest precedence to highest prece
dence. | 54 // painting each style of border from lowest precedence to highest prece
dence. |
| 55 info.phase = PaintPhaseCollapsedTableBorders; | 55 info.phase = PaintPhaseCollapsedTableBorders; |
| 56 LayoutTable::CollapsedBorderValues collapsedBorders = m_layoutTable.coll
apsedBorders(); | 56 LayoutTable::CollapsedBorderValues collapsedBorders = m_layoutTable.coll
apsedBorders(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return; | 88 return; |
| 89 | 89 |
| 90 LayoutRect rect(paintOffset, m_layoutTable.size()); | 90 LayoutRect rect(paintOffset, m_layoutTable.size()); |
| 91 m_layoutTable.subtractCaptionRect(rect); | 91 m_layoutTable.subtractCaptionRect(rect); |
| 92 RenderDrawingRecorder recorder(paintInfo.context, m_layoutTable, paintInfo.p
hase, pixelSnappedIntRect(rect)); | 92 RenderDrawingRecorder recorder(paintInfo.context, m_layoutTable, paintInfo.p
hase, pixelSnappedIntRect(rect)); |
| 93 if (!recorder.canUseCachedDrawing()) | 93 if (!recorder.canUseCachedDrawing()) |
| 94 BoxPainter(m_layoutTable).paintMaskImages(paintInfo, rect); | 94 BoxPainter(m_layoutTable).paintMaskImages(paintInfo, rect); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace blink | 97 } // namespace blink |
| OLD | NEW |