| Index: Source/core/rendering/RenderTable.cpp
|
| diff --git a/Source/core/rendering/RenderTable.cpp b/Source/core/rendering/RenderTable.cpp
|
| index 0d53d378d26e8f8710a59abe50af38f4667b8a89..66d8feb0464158bcba589955c13e220392d6e5e9 100644
|
| --- a/Source/core/rendering/RenderTable.cpp
|
| +++ b/Source/core/rendering/RenderTable.cpp
|
| @@ -31,6 +31,7 @@
|
| #include "core/frame/FrameView.h"
|
| #include "core/html/HTMLTableElement.h"
|
| #include "core/paint/BoxPainter.h"
|
| +#include "core/paint/TablePainter.h"
|
| #include "core/rendering/AutoTableLayout.h"
|
| #include "core/rendering/FixedTableLayout.h"
|
| #include "core/rendering/GraphicsContextAnnotator.h"
|
| @@ -586,7 +587,6 @@ void RenderTable::recalcCollapsedBorders()
|
| RenderTableCell::sortBorderValues(m_collapsedBorders);
|
| }
|
|
|
| -
|
| void RenderTable::addOverflowFromChildren()
|
| {
|
| // Add overflow from borders.
|
| @@ -615,75 +615,12 @@ void RenderTable::addOverflowFromChildren()
|
|
|
| void RenderTable::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
| {
|
| - ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
|
| -
|
| - LayoutPoint adjustedPaintOffset = paintOffset + location();
|
| -
|
| - PaintPhase paintPhase = paintInfo.phase;
|
| -
|
| - if (!isDocumentElement()) {
|
| - LayoutRect overflowBox = visualOverflowRect();
|
| - flipForWritingMode(overflowBox);
|
| - overflowBox.moveBy(adjustedPaintOffset);
|
| - if (!overflowBox.intersects(paintInfo.rect))
|
| - return;
|
| - }
|
| -
|
| - bool pushedClip = pushContentsClip(paintInfo, adjustedPaintOffset, ForceContentsClip);
|
| - paintObject(paintInfo, adjustedPaintOffset);
|
| - if (pushedClip)
|
| - popContentsClip(paintInfo, paintPhase, adjustedPaintOffset);
|
| + TablePainter(*this).paint(paintInfo, paintOffset);
|
| }
|
|
|
| void RenderTable::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
| {
|
| - PaintPhase paintPhase = paintInfo.phase;
|
| - if ((paintPhase == PaintPhaseBlockBackground || paintPhase == PaintPhaseChildBlockBackground) && hasBoxDecorationBackground() && style()->visibility() == VISIBLE)
|
| - paintBoxDecorationBackground(paintInfo, paintOffset);
|
| -
|
| - if (paintPhase == PaintPhaseMask) {
|
| - paintMask(paintInfo, paintOffset);
|
| - return;
|
| - }
|
| -
|
| - // We're done. We don't bother painting any children.
|
| - if (paintPhase == PaintPhaseBlockBackground)
|
| - return;
|
| -
|
| - // We don't paint our own background, but we do let the kids paint their backgrounds.
|
| - if (paintPhase == PaintPhaseChildBlockBackgrounds)
|
| - paintPhase = PaintPhaseChildBlockBackground;
|
| -
|
| - PaintInfo info(paintInfo);
|
| - info.phase = paintPhase;
|
| - info.updatePaintingRootForChildren(this);
|
| -
|
| - for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
|
| - if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child->isTableCaption())) {
|
| - LayoutPoint childPoint = flipForWritingModeForChild(toRenderBox(child), paintOffset);
|
| - child->paint(info, childPoint);
|
| - }
|
| - }
|
| -
|
| - if (collapseBorders() && paintPhase == PaintPhaseChildBlockBackground && style()->visibility() == VISIBLE) {
|
| - recalcCollapsedBorders();
|
| - // Using our cached sorted styles, we then do individual passes,
|
| - // painting each style of border from lowest precedence to highest precedence.
|
| - info.phase = PaintPhaseCollapsedTableBorders;
|
| - size_t count = m_collapsedBorders.size();
|
| - for (size_t i = 0; i < count; ++i) {
|
| - m_currentBorder = &m_collapsedBorders[i];
|
| - for (RenderTableSection* section = bottomSection(); section; section = sectionAbove(section)) {
|
| - LayoutPoint childPoint = flipForWritingModeForChild(section, paintOffset);
|
| - section->paint(info, childPoint);
|
| - }
|
| - }
|
| - m_currentBorder = 0;
|
| - }
|
| -
|
| - // Paint outline.
|
| - if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline) && style()->hasOutline() && style()->visibility() == VISIBLE)
|
| - paintOutline(paintInfo, LayoutRect(paintOffset, size()));
|
| + TablePainter(*this).paintObject(paintInfo, paintOffset);
|
| }
|
|
|
| void RenderTable::subtractCaptionRect(LayoutRect& rect) const
|
| @@ -705,23 +642,12 @@ void RenderTable::subtractCaptionRect(LayoutRect& rect) const
|
|
|
| void RenderTable::paintBoxDecorationBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
| {
|
| - if (!paintInfo.shouldPaintWithinRoot(this))
|
| - return;
|
| -
|
| - LayoutRect rect(paintOffset, size());
|
| - subtractCaptionRect(rect);
|
| - BoxPainter(*this).paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, rect);
|
| + TablePainter(*this).paintBoxDecorationBackground(paintInfo, paintOffset);
|
| }
|
|
|
| void RenderTable::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
| {
|
| - if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
|
| - return;
|
| -
|
| - LayoutRect rect(paintOffset, size());
|
| - subtractCaptionRect(rect);
|
| -
|
| - BoxPainter(*this).paintMaskImages(paintInfo, rect);
|
| + TablePainter(*this).paintMask(paintInfo, paintOffset);
|
| }
|
|
|
| void RenderTable::computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) const
|
|
|