This source file includes following definitions.
- paintSelectionBackground
- paint
- calculateBoundaries
#include "config.h"
#include "core/rendering/svg/SVGInlineFlowBox.h"
#include "core/rendering/svg/RenderSVGInlineText.h"
#include "core/rendering/svg/SVGInlineTextBox.h"
#include "core/rendering/svg/SVGRenderingContext.h"
using namespace std;
namespace WebCore {
void SVGInlineFlowBox::paintSelectionBackground(PaintInfo& paintInfo)
{
ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
ASSERT(!paintInfo.context->paintingDisabled());
PaintInfo childPaintInfo(paintInfo);
for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
if (child->isSVGInlineTextBox())
toSVGInlineTextBox(child)->paintSelectionBackground(childPaintInfo);
else if (child->isSVGInlineFlowBox())
toSVGInlineFlowBox(child)->paintSelectionBackground(childPaintInfo);
}
}
void SVGInlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit, LayoutUnit)
{
ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
ASSERT(!paintInfo.context->paintingDisabled());
SVGRenderingContext renderingContext(&renderer(), paintInfo, SVGRenderingContext::SaveGraphicsContext);
if (renderingContext.isRenderingPrepared()) {
for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
child->paint(paintInfo, paintOffset, 0, 0);
}
}
FloatRect SVGInlineFlowBox::calculateBoundaries() const
{
FloatRect childRect;
for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
if (!child->isSVGInlineTextBox() && !child->isSVGInlineFlowBox())
continue;
childRect.unite(child->calculateBoundaries());
}
return childRect;
}
}