void RenderInline::addFocusRingRects(GraphicsContext* graphicsContext, int tx, int ty)
{
// DB("RenderInline::addFocusRingRects/n");
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
RootInlineBox* root = curr->root();
int top = max(root->lineTop(), curr->y());
int bottom = min(root->lineBottom(), curr->y() + curr->height());
graphicsContext->clearFocusRing();
graphicsContext->addFocusRingRect(IntRect(tx + curr->x(), ty + top, curr->width(), bottom - top));
// DB("for InlineRunBox(%d,%d)/n",curr->width(),bottom - top);
}
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (!curr->isText() && !curr->isListMarker()) {
FloatPoint pos(tx, ty);
// FIXME: This doesn't work correctly with transforms.
if (curr->hasLayer())
pos = curr->localToAbsolute();
else if (curr->isBox())
pos.move(toRenderBox(curr)->x(), toRenderBox(curr)->y());
graphicsContext->clearFocusRing();
curr->addFocusRingRects(graphicsContext, pos.x(), pos.y());
// DB("!curr->isText() && !curr->isListMarker()/n");
}
}
if (continuation()) {
if (continuation()->isInline())
{
continuation()->addFocusRingRects(graphicsContext,
tx - containingBlock()->x() + continuation()->containingBlock()->x(),
ty - containingBlock()->y() + continuation()->containingBlock()->y());
// DB("continuation()->isInline()/n");
}
else
{
continuation()->addFocusRingRects(graphicsContext,
tx - containingBlock()->x() + toRenderBox(continuation())->x(),
ty - containingBlock()->y() + toRenderBox(continuation())->y());
// DB("continuation()->isInline() else/n");
}
}
}