diff options
Diffstat (limited to 'WebCore/rendering/EllipsisBox.cpp')
-rw-r--r-- | WebCore/rendering/EllipsisBox.cpp | 17 |
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; } |