Chromium Code Reviews| Index: Source/core/rendering/InlineFlowBox.cpp |
| diff --git a/Source/core/rendering/InlineFlowBox.cpp b/Source/core/rendering/InlineFlowBox.cpp |
| index aa71555193366c35f4b10a8ff1c42da851b65d3b..a6ce9a7943647841c8cb9fcf853cd7c44e5fec9d 100644 |
| --- a/Source/core/rendering/InlineFlowBox.cpp |
| +++ b/Source/core/rendering/InlineFlowBox.cpp |
| @@ -1228,12 +1228,14 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, c |
| void InlineFlowBox::paintBoxShadow(const PaintInfo& info, RenderStyle* s, ShadowStyle shadowStyle, const LayoutRect& paintRect) |
| { |
| + ASSERT(!renderer()->isText); |
|
jbroman
2014/09/11 21:31:36
ASSERT(!renderer()->isText());
jbroman
2014/09/11 21:32:42
Actually, this returns RenderObject&.
You actuall
pdr.
2014/09/11 22:01:37
toRenderBox already contains this assert.
chrishtr
2014/09/12 18:00:15
Done.
chrishtr
2014/09/12 18:00:15
Done.
|
| + BoxPainter boxPainter(toRenderBox(renderer())); |
| if ((!prevLineBox() && !nextLineBox()) || !parent()) |
| - boxModelObject()->paintBoxShadow(info, paintRect, s, shadowStyle); |
| + boxPainter.paintBoxShadow(info, paintRect, s, shadowStyle); |
| else { |
| // FIXME: We can do better here in the multi-line case. We want to push a clip so that the shadow doesn't |
| // protrude incorrectly at the edges, and we want to possibly include shadows cast from the previous/following lines |
| - boxModelObject()->paintBoxShadow(info, paintRect, s, shadowStyle, includeLogicalLeftEdge(), includeLogicalRightEdge()); |
| + boxPainter.paintBoxShadow(info, paintRect, s, shadowStyle, includeLogicalLeftEdge(), includeLogicalRightEdge()); |
| } |
| } |
| @@ -1332,8 +1334,11 @@ void InlineFlowBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const Lay |
| // The simple case is where we either have no border image or we are the only box for this object. |
| // In those cases only a single call to draw is required. |
| + ASSERT(!renderer().isText()); |
| + BoxPainter boxPainter(toRenderBox(renderer())); |
| if (!hasBorderImage || (!prevLineBox() && !nextLineBox())) { |
| - boxModelObject()->paintBorder(paintInfo, paintRect, renderer().style(isFirstLineStyle()), BackgroundBleedNone, includeLogicalLeftEdge(), includeLogicalRightEdge()); |
| + |
| + boxPainter.paintBorder(paintInfo, paintRect, renderer().style(isFirstLineStyle()), BackgroundBleedNone, includeLogicalLeftEdge(), includeLogicalRightEdge()); |
| } else { |
| // We have a border image that spans multiple lines. |
| // We need to adjust tx and ty by the width of all previous lines. |
| @@ -1357,7 +1362,7 @@ void InlineFlowBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const Lay |
| LayoutRect clipRect = clipRectForNinePieceImageStrip(this, borderImage, paintRect); |
| GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| paintInfo.context->clip(clipRect); |
| - boxModelObject()->paintBorder(paintInfo, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer().style(isFirstLineStyle())); |
| + boxPainter.paintBorder(paintInfo, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer().style(isFirstLineStyle())); |
| } |
| } |
| } |
| @@ -1409,8 +1414,10 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs |
| // The simple case is where we are the only box for this object. In those |
| // cases only a single call to draw is required. |
| + ASSERT(!renderer().isText()); |
| + BoxPainter boxPainter(toRenderBox(renderer())); |
| if (!prevLineBox() && !nextLineBox()) { |
| - boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer().style(), maskNinePieceImage, compositeOp); |
| + boxPainter.paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer().style(), maskNinePieceImage, compositeOp); |
| } else { |
| // We have a mask image that spans multiple lines. |
| // We need to adjust _tx and _ty by the width of all previous lines. |
| @@ -1428,7 +1435,7 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs |
| LayoutRect clipRect = clipRectForNinePieceImageStrip(this, maskNinePieceImage, paintRect); |
| GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| paintInfo.context->clip(clipRect); |
| - boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer().style(), maskNinePieceImage, compositeOp); |
| + boxPainter.paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer().style(), maskNinePieceImage, compositeOp); |
| } |
| if (pushTransparencyLayer) |