| Index: Source/core/paint/InlineFlowBoxPainter.cpp
|
| diff --git a/Source/core/paint/InlineFlowBoxPainter.cpp b/Source/core/paint/InlineFlowBoxPainter.cpp
|
| index d595a1650c3ea57b87f609591e7355c46a3be7c8..bd8c1ca532553bee30e1e667a5087b52496fc36b 100644
|
| --- a/Source/core/paint/InlineFlowBoxPainter.cpp
|
| +++ b/Source/core/paint/InlineFlowBoxPainter.cpp
|
| @@ -29,8 +29,8 @@ void InlineFlowBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
|
| if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) {
|
| // Add ourselves to the paint info struct's list of inlines that need to paint their
|
| // outlines.
|
| - if (m_inlineFlowBox.renderer().style()->visibility() == VISIBLE && m_inlineFlowBox.renderer().style()->hasOutline() && !m_inlineFlowBox.isRootInlineBox()) {
|
| - LayoutInline& inlineFlow = toLayoutInline(m_inlineFlowBox.renderer());
|
| + if (m_inlineFlowBox.layoutObject().style()->visibility() == VISIBLE && m_inlineFlowBox.layoutObject().style()->hasOutline() && !m_inlineFlowBox.isRootInlineBox()) {
|
| + LayoutInline& inlineFlow = toLayoutInline(m_inlineFlowBox.layoutObject());
|
|
|
| LayoutBlock* cb = 0;
|
| bool containingBlockPaintsContinuationOutline = inlineFlow.continuation() || inlineFlow.isInlineElementContinuation();
|
| @@ -38,7 +38,7 @@ void InlineFlowBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
|
| // FIXME: See https://bugs.webkit.org/show_bug.cgi?id=54690. We currently don't reconnect inline continuations
|
| // after a child removal. As a result, those merged inlines do not get seperated and hence not get enclosed by
|
| // anonymous blocks. In this case, it is better to bail out and paint it ourself.
|
| - LayoutBlock* enclosingAnonymousBlock = m_inlineFlowBox.renderer().containingBlock();
|
| + LayoutBlock* enclosingAnonymousBlock = m_inlineFlowBox.layoutObject().containingBlock();
|
| if (!enclosingAnonymousBlock->isAnonymousBlock()) {
|
| containingBlockPaintsContinuationOutline = false;
|
| } else {
|
| @@ -55,7 +55,7 @@ void InlineFlowBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
|
| if (containingBlockPaintsContinuationOutline) {
|
| // Add ourselves to the containing block of the entire continuation so that it can
|
| // paint us atomically.
|
| - cb->addContinuationWithOutline(toLayoutInline(m_inlineFlowBox.renderer().node()->renderer()));
|
| + cb->addContinuationWithOutline(toLayoutInline(m_inlineFlowBox.layoutObject().node()->layoutObject()));
|
| } else if (!inlineFlow.isInlineElementContinuation()) {
|
| paintInfo.outlineObjects()->add(&inlineFlow);
|
| }
|
| @@ -75,13 +75,13 @@ void InlineFlowBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoint&
|
| PaintInfo childInfo(paintInfo);
|
| childInfo.phase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPhaseOutline : paintInfo.phase;
|
|
|
| - if (childInfo.paintingRoot && childInfo.paintingRoot->isDescendantOf(&m_inlineFlowBox.renderer()))
|
| + if (childInfo.paintingRoot && childInfo.paintingRoot->isDescendantOf(&m_inlineFlowBox.layoutObject()))
|
| childInfo.paintingRoot = 0;
|
| else
|
| - childInfo.updatePaintingRootForChildren(&m_inlineFlowBox.renderer());
|
| + childInfo.updatePaintingRootForChildren(&m_inlineFlowBox.layoutObject());
|
|
|
| for (InlineBox* curr = m_inlineFlowBox.firstChild(); curr; curr = curr->nextOnLine()) {
|
| - if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintingLayer())
|
| + if (curr->layoutObject().isText() || !curr->boxModelObject()->hasSelfPaintingLayer())
|
| curr->paint(childInfo, paintOffset, lineTop, lineBottom);
|
| }
|
| }
|
| @@ -99,10 +99,10 @@ void InlineFlowBoxPainter::paintFillLayers(const PaintInfo& paintInfo, const Col
|
| void InlineFlowBoxPainter::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer& fillLayer, const LayoutRect& rect, SkXfermode::Mode op)
|
| {
|
| StyleImage* img = fillLayer.image();
|
| - bool hasFillImage = img && img->canRender(m_inlineFlowBox.renderer(), m_inlineFlowBox.renderer().style()->effectiveZoom());
|
| - if ((!hasFillImage && !m_inlineFlowBox.renderer().style()->hasBorderRadius()) || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowBox.nextLineBox()) || !m_inlineFlowBox.parent()) {
|
| + bool hasFillImage = img && img->canRender(m_inlineFlowBox.layoutObject(), m_inlineFlowBox.layoutObject().style()->effectiveZoom());
|
| + if ((!hasFillImage && !m_inlineFlowBox.layoutObject().style()->hasBorderRadius()) || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowBox.nextLineBox()) || !m_inlineFlowBox.parent()) {
|
| BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), paintInfo, c, fillLayer, rect, BackgroundBleedNone, &m_inlineFlowBox, rect.size(), op);
|
| - } else if (m_inlineFlowBox.renderer().style()->boxDecorationBreak() == DCLONE) {
|
| + } else if (m_inlineFlowBox.layoutObject().style()->boxDecorationBreak() == DCLONE) {
|
| GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), m_inlineFlowBox.width(), m_inlineFlowBox.height()));
|
| BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), paintInfo, c, fillLayer, rect, BackgroundBleedNone, &m_inlineFlowBox, rect.size(), op);
|
| @@ -110,7 +110,7 @@ void InlineFlowBoxPainter::paintFillLayer(const PaintInfo& paintInfo, const Colo
|
| // We have a fill image that spans multiple lines.
|
| // FIXME: frameSize ought to be the same as rect.size().
|
| LayoutSize frameSize(m_inlineFlowBox.width().toLayoutUnit(), m_inlineFlowBox.height().toLayoutUnit());
|
| - LayoutRect imageStripPaintRect = paintRectForImageStrip(rect.location(), frameSize, m_inlineFlowBox.renderer().style()->direction());
|
| + LayoutRect imageStripPaintRect = paintRectForImageStrip(rect.location(), frameSize, m_inlineFlowBox.layoutObject().style()->direction());
|
| GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), m_inlineFlowBox.width(), m_inlineFlowBox.height()));
|
| BoxPainter::paintFillLayerExtended(*m_inlineFlowBox.boxModelObject(), paintInfo, c, fillLayer, imageStripPaintRect, BackgroundBleedNone, &m_inlineFlowBox, rect.size(), op);
|
| @@ -132,7 +132,7 @@ void InlineFlowBoxPainter::paintBoxShadow(const PaintInfo& info, const LayoutSty
|
| static LayoutRect clipRectForNinePieceImageStrip(InlineFlowBox* box, const NinePieceImage& image, const LayoutRect& paintRect)
|
| {
|
| LayoutRect clipRect(paintRect);
|
| - const LayoutStyle& style = box->renderer().styleRef();
|
| + const LayoutStyle& style = box->layoutObject().styleRef();
|
| LayoutRectOutsets outsets = style.imageOutsets(image);
|
| if (box->isHorizontal()) {
|
| clipRect.setY(paintRect.y() - outsets.top());
|
| @@ -189,17 +189,17 @@ LayoutRect InlineFlowBoxPainter::paintRectForImageStrip(const LayoutPoint& paint
|
| void InlineFlowBoxPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
| {
|
| ASSERT(paintInfo.phase == PaintPhaseForeground);
|
| - if (!paintInfo.shouldPaintWithinRoot(&m_inlineFlowBox.renderer()) || m_inlineFlowBox.renderer().style()->visibility() != VISIBLE)
|
| + if (!paintInfo.shouldPaintWithinRoot(&m_inlineFlowBox.layoutObject()) || m_inlineFlowBox.layoutObject().style()->visibility() != VISIBLE)
|
| return;
|
|
|
| // You can use p::first-line to specify a background. If so, the root line boxes for
|
| // a line may actually have to paint a background.
|
| - const LayoutStyle* styleToUse = m_inlineFlowBox.renderer().style(m_inlineFlowBox.isFirstLineStyle());
|
| + const LayoutStyle* styleToUse = m_inlineFlowBox.layoutObject().style(m_inlineFlowBox.isFirstLineStyle());
|
| bool shouldPaintBoxDecorationBackground;
|
| if (m_inlineFlowBox.parent())
|
| - shouldPaintBoxDecorationBackground = m_inlineFlowBox.renderer().hasBoxDecorationBackground();
|
| + shouldPaintBoxDecorationBackground = m_inlineFlowBox.layoutObject().hasBoxDecorationBackground();
|
| else
|
| - shouldPaintBoxDecorationBackground = m_inlineFlowBox.isFirstLineStyle() && styleToUse != m_inlineFlowBox.renderer().style();
|
| + shouldPaintBoxDecorationBackground = m_inlineFlowBox.isFirstLineStyle() && styleToUse != m_inlineFlowBox.layoutObject().style();
|
|
|
| if (!shouldPaintBoxDecorationBackground)
|
| return;
|
| @@ -221,23 +221,23 @@ void InlineFlowBoxPainter::paintBoxDecorationBackground(const PaintInfo& paintIn
|
| if (!m_inlineFlowBox.boxModelObject()->boxShadowShouldBeAppliedToBackground(BackgroundBleedNone, &m_inlineFlowBox))
|
| paintBoxShadow(paintInfo, *styleToUse, Normal, paintRect);
|
|
|
| - Color backgroundColor = m_inlineFlowBox.renderer().resolveColor(*styleToUse, CSSPropertyBackgroundColor);
|
| + Color backgroundColor = m_inlineFlowBox.layoutObject().resolveColor(*styleToUse, CSSPropertyBackgroundColor);
|
| paintFillLayers(paintInfo, backgroundColor, styleToUse->backgroundLayers(), paintRect);
|
| paintBoxShadow(paintInfo, *styleToUse, Inset, paintRect);
|
|
|
| // :first-line cannot be used to put borders on a line. Always paint borders with our
|
| // non-first-line style.
|
| - if (m_inlineFlowBox.parent() && m_inlineFlowBox.renderer().style()->hasBorder()) {
|
| - const NinePieceImage& borderImage = m_inlineFlowBox.renderer().style()->borderImage();
|
| + if (m_inlineFlowBox.parent() && m_inlineFlowBox.layoutObject().style()->hasBorder()) {
|
| + const NinePieceImage& borderImage = m_inlineFlowBox.layoutObject().style()->borderImage();
|
| StyleImage* borderImageSource = borderImage.image();
|
| - bool hasBorderImage = borderImageSource && borderImageSource->canRender(m_inlineFlowBox.renderer(), styleToUse->effectiveZoom());
|
| + bool hasBorderImage = borderImageSource && borderImageSource->canRender(m_inlineFlowBox.layoutObject(), styleToUse->effectiveZoom());
|
| if (hasBorderImage && !borderImageSource->isLoaded())
|
| return; // Don't paint anything while we wait for the image to load.
|
|
|
| // 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.
|
| if (!hasBorderImage || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowBox.nextLineBox())) {
|
| - BoxPainter::paintBorder(*m_inlineFlowBox.boxModelObject(), paintInfo, paintRect, m_inlineFlowBox.renderer().styleRef(m_inlineFlowBox.isFirstLineStyle()), BackgroundBleedNone, m_inlineFlowBox.includeLogicalLeftEdge(), m_inlineFlowBox.includeLogicalRightEdge());
|
| + BoxPainter::paintBorder(*m_inlineFlowBox.boxModelObject(), paintInfo, paintRect, m_inlineFlowBox.layoutObject().styleRef(m_inlineFlowBox.isFirstLineStyle()), BackgroundBleedNone, m_inlineFlowBox.includeLogicalLeftEdge(), m_inlineFlowBox.includeLogicalRightEdge());
|
| } else {
|
| // We have a border image that spans multiple lines.
|
| // FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
|
| @@ -246,14 +246,14 @@ void InlineFlowBoxPainter::paintBoxDecorationBackground(const PaintInfo& paintIn
|
| LayoutRect clipRect = clipRectForNinePieceImageStrip(&m_inlineFlowBox, borderImage, paintRect);
|
| GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| paintInfo.context->clip(clipRect);
|
| - BoxPainter::paintBorder(*m_inlineFlowBox.boxModelObject(), paintInfo, imageStripPaintRect, m_inlineFlowBox.renderer().styleRef(m_inlineFlowBox.isFirstLineStyle()));
|
| + BoxPainter::paintBorder(*m_inlineFlowBox.boxModelObject(), paintInfo, imageStripPaintRect, m_inlineFlowBox.layoutObject().styleRef(m_inlineFlowBox.isFirstLineStyle()));
|
| }
|
| }
|
| }
|
|
|
| void InlineFlowBoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
|
| {
|
| - if (!paintInfo.shouldPaintWithinRoot(&m_inlineFlowBox.renderer()) || m_inlineFlowBox.renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
|
| + if (!paintInfo.shouldPaintWithinRoot(&m_inlineFlowBox.layoutObject()) || m_inlineFlowBox.layoutObject().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
|
| return;
|
|
|
| LayoutRect frameRect = roundedFrameRectClampedToLineTopAndBottomIfNeeded();
|
| @@ -263,16 +263,16 @@ void InlineFlowBoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoi
|
| m_inlineFlowBox.flipForWritingMode(localRect);
|
| LayoutPoint adjustedPaintOffset = paintOffset + localRect.location();
|
|
|
| - const NinePieceImage& maskNinePieceImage = m_inlineFlowBox.renderer().style()->maskBoxImage();
|
| - StyleImage* maskBoxImage = m_inlineFlowBox.renderer().style()->maskBoxImage().image();
|
| + const NinePieceImage& maskNinePieceImage = m_inlineFlowBox.layoutObject().style()->maskBoxImage();
|
| + StyleImage* maskBoxImage = m_inlineFlowBox.layoutObject().style()->maskBoxImage().image();
|
|
|
| // Figure out if we need to push a transparency layer to render our mask.
|
| bool pushTransparencyLayer = false;
|
| - bool compositedMask = m_inlineFlowBox.renderer().hasLayer() && m_inlineFlowBox.boxModelObject()->layer()->hasCompositedMask();
|
| - bool flattenCompositingLayers = m_inlineFlowBox.renderer().view()->frameView() && m_inlineFlowBox.renderer().view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
|
| + bool compositedMask = m_inlineFlowBox.layoutObject().hasLayer() && m_inlineFlowBox.boxModelObject()->layer()->hasCompositedMask();
|
| + bool flattenCompositingLayers = m_inlineFlowBox.layoutObject().view()->frameView() && m_inlineFlowBox.layoutObject().view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers;
|
| SkXfermode::Mode compositeOp = SkXfermode::kSrcOver_Mode;
|
| if (!compositedMask || flattenCompositingLayers) {
|
| - if ((maskBoxImage && m_inlineFlowBox.renderer().style()->maskLayers().hasImage()) || m_inlineFlowBox.renderer().style()->maskLayers().next())
|
| + if ((maskBoxImage && m_inlineFlowBox.layoutObject().style()->maskLayers().hasImage()) || m_inlineFlowBox.layoutObject().style()->maskLayers().next())
|
| pushTransparencyLayer = true;
|
|
|
| compositeOp = SkXfermode::kDstIn_Mode;
|
| @@ -284,9 +284,9 @@ void InlineFlowBoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoi
|
| }
|
|
|
| LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size());
|
| - paintFillLayers(paintInfo, Color::transparent, m_inlineFlowBox.renderer().style()->maskLayers(), paintRect, compositeOp);
|
| + paintFillLayers(paintInfo, Color::transparent, m_inlineFlowBox.layoutObject().style()->maskLayers(), paintRect, compositeOp);
|
|
|
| - bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(m_inlineFlowBox.renderer(), m_inlineFlowBox.renderer().style()->effectiveZoom());
|
| + bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(m_inlineFlowBox.layoutObject(), m_inlineFlowBox.layoutObject().style()->effectiveZoom());
|
| if (!hasBoxImage || !maskBoxImage->isLoaded()) {
|
| if (pushTransparencyLayer)
|
| paintInfo.context->endLayer();
|
| @@ -296,7 +296,7 @@ void InlineFlowBoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoi
|
| // The simple case is where we are the only box for this object. In those
|
| // cases only a single call to draw is required.
|
| if (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowBox.nextLineBox()) {
|
| - BoxPainter::paintNinePieceImage(*m_inlineFlowBox.boxModelObject(), paintInfo.context, paintRect, m_inlineFlowBox.renderer().styleRef(), maskNinePieceImage, compositeOp);
|
| + BoxPainter::paintNinePieceImage(*m_inlineFlowBox.boxModelObject(), paintInfo.context, paintRect, m_inlineFlowBox.layoutObject().styleRef(), maskNinePieceImage, compositeOp);
|
| } else {
|
| // We have a mask image that spans multiple lines.
|
| // FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
|
| @@ -305,7 +305,7 @@ void InlineFlowBoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoi
|
| LayoutRect clipRect = clipRectForNinePieceImageStrip(&m_inlineFlowBox, maskNinePieceImage, paintRect);
|
| GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| paintInfo.context->clip(clipRect);
|
| - BoxPainter::paintNinePieceImage(*m_inlineFlowBox.boxModelObject(), paintInfo.context, imageStripPaintRect, m_inlineFlowBox.renderer().styleRef(), maskNinePieceImage, compositeOp);
|
| + BoxPainter::paintNinePieceImage(*m_inlineFlowBox.boxModelObject(), paintInfo.context, imageStripPaintRect, m_inlineFlowBox.layoutObject().styleRef(), maskNinePieceImage, compositeOp);
|
| }
|
|
|
| if (pushTransparencyLayer)
|
| @@ -317,7 +317,7 @@ LayoutRect InlineFlowBoxPainter::roundedFrameRectClampedToLineTopAndBottomIfNeed
|
| // Pixel snap rect painting.
|
| LayoutRect rect(m_inlineFlowBox.roundedFrameRect());
|
|
|
| - bool noQuirksMode = m_inlineFlowBox.renderer().document().inNoQuirksMode();
|
| + bool noQuirksMode = m_inlineFlowBox.layoutObject().document().inNoQuirksMode();
|
| if (!noQuirksMode && !m_inlineFlowBox.hasTextChildren() && !(m_inlineFlowBox.descendantsHaveSameLineHeightAndBaseline() && m_inlineFlowBox.hasTextDescendants())) {
|
| const RootInlineBox& rootBox = m_inlineFlowBox.root();
|
| LayoutUnit logicalTop = m_inlineFlowBox.isHorizontal() ? rect.y() : rect.x();
|
|
|