| Index: Source/core/rendering/RenderImage.cpp
|
| diff --git a/Source/core/rendering/RenderImage.cpp b/Source/core/rendering/RenderImage.cpp
|
| index 60ead09bd296a5ef2f7db0ec1266ab95fc38963c..6d86bd57a0727bad28c77ff19b772da2dc634577 100644
|
| --- a/Source/core/rendering/RenderImage.cpp
|
| +++ b/Source/core/rendering/RenderImage.cpp
|
| @@ -341,18 +341,20 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
|
| const Font& font = style()->font();
|
| const FontMetrics& fontMetrics = font.fontMetrics();
|
| LayoutUnit ascent = fontMetrics.ascent();
|
| - LayoutPoint altTextOffset = paintOffset;
|
| - altTextOffset.move(leftBorder + leftPad + (paddingWidth / 2) - borderWidth, topBorder + topPad + ascent + (paddingHeight / 2) - borderWidth);
|
| + LayoutPoint textRectOrigin = paintOffset;
|
| + textRectOrigin.move(leftBorder + leftPad + (paddingWidth / 2) - borderWidth, topBorder + topPad + (paddingHeight / 2) - borderWidth);
|
| + LayoutPoint textOrigin(textRectOrigin.x(), textRectOrigin.y() + ascent);
|
|
|
| // Only draw the alt text if it'll fit within the content box,
|
| // and only if it fits above the error image.
|
| TextRun textRun = RenderBlock::constructTextRun(this, font, text, style());
|
| LayoutUnit textWidth = font.width(textRun);
|
| + FloatRect textRect(textRectOrigin, FloatSize(textWidth, fontMetrics.height()));
|
| if (errorPictureDrawn) {
|
| if (usableWidth >= textWidth && fontMetrics.height() <= imageOffset.height())
|
| - context->drawText(font, textRun, altTextOffset);
|
| + context->drawText(font, textRun, textOrigin, textRect);
|
| } else if (usableWidth >= textWidth && usableHeight >= fontMetrics.height())
|
| - context->drawText(font, textRun, altTextOffset);
|
| + context->drawText(font, textRun, textOrigin, textRect);
|
| }
|
| }
|
| } else if (m_imageResource->hasImage() && cWidth > 0 && cHeight > 0) {
|
|
|