summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/EllipsisBox.cpp
diff options
context:
space:
mode:
authorFeng Qian <>2009-04-10 18:11:29 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-10 18:11:29 -0700
commit8f72e70a9fd78eec56623b3a62e68f16b7b27e28 (patch)
tree181bf9a400c30a1bf34ea6d72560e8d00111d549 /WebCore/rendering/EllipsisBox.cpp
parent7ed56f225e0ade046e1c2178977f72b2d896f196 (diff)
downloadexternal_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.zip
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.gz
external_webkit-8f72e70a9fd78eec56623b3a62e68f16b7b27e28.tar.bz2
AI 145796: Land the WebKit merge @r42026.
Automated import of CL 145796
Diffstat (limited to 'WebCore/rendering/EllipsisBox.cpp')
-rw-r--r--WebCore/rendering/EllipsisBox.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/WebCore/rendering/EllipsisBox.cpp b/WebCore/rendering/EllipsisBox.cpp
index fcce87d..db9a101 100644
--- a/WebCore/rendering/EllipsisBox.cpp
+++ b/WebCore/rendering/EllipsisBox.cpp
@@ -31,7 +31,7 @@ namespace WebCore {
void EllipsisBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
{
GraphicsContext* context = paintInfo.context;
- RenderStyle* style = m_object->style(m_firstLine);
+ RenderStyle* style = m_renderer->style(m_firstLine);
Color textColor = style->color();
if (textColor != context->fillColor())
context->setFillColor(textColor);
@@ -43,15 +43,15 @@ void EllipsisBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
}
const String& str = m_str;
- context->drawText(style->font(), TextRun(str.characters(), str.length(), false, 0, 0, false, style->visuallyOrdered()), IntPoint(m_x + tx, m_y + ty + m_baseline));
+ context->drawText(style->font(), TextRun(str.characters(), str.length(), false, 0, 0, false, style->visuallyOrdered()), IntPoint(m_x + tx, m_y + ty + style->font().ascent()));
if (setShadow)
context->clearShadow();
if (m_markupBox) {
// Paint the markup box
- tx += m_x + m_width - m_markupBox->xPos();
- ty += m_y + m_baseline - (m_markupBox->yPos() + m_markupBox->baseline());
+ tx += m_x + m_width - m_markupBox->x();
+ ty += m_y + style->font().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->font().ascent());
m_markupBox->paint(paintInfo, tx, ty);
}
}
@@ -63,16 +63,17 @@ bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
// Hit test the markup box.
if (m_markupBox) {
- int mtx = tx + m_width - m_markupBox->xPos();
- int mty = ty + m_baseline - (m_markupBox->yPos() + m_markupBox->baseline());
+ RenderStyle* style = m_renderer->style(m_firstLine);
+ int mtx = tx + m_width - m_markupBox->x();
+ int mty = ty + style->font().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->font().ascent());
if (m_markupBox->nodeAtPoint(request, result, x, y, mtx, mty)) {
- object()->updateHitTestResult(result, IntPoint(x - mtx, y - mty));
+ renderer()->updateHitTestResult(result, IntPoint(x - mtx, y - mty));
return true;
}
}
if (visibleToHitTesting() && IntRect(tx, ty, m_width, m_height).contains(x, y)) {
- object()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
+ renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
return true;
}