From 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 7 May 2012 11:21:11 +0200 Subject: Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286) --- Source/WebCore/rendering/EllipsisBox.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Source/WebCore/rendering/EllipsisBox.cpp') diff --git a/Source/WebCore/rendering/EllipsisBox.cpp b/Source/WebCore/rendering/EllipsisBox.cpp index e403fe667..5969a3222 100644 --- a/Source/WebCore/rendering/EllipsisBox.cpp +++ b/Source/WebCore/rendering/EllipsisBox.cpp @@ -33,7 +33,7 @@ namespace WebCore { void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom) { GraphicsContext* context = paintInfo.context; - RenderStyle* style = m_renderer->style(m_firstLine); + RenderStyle* style = m_renderer->style(isFirstLineStyle()); Color textColor = style->visitedDependentColor(CSSPropertyColor); if (textColor != context->fillColor()) context->setFillColor(textColor, style->colorSpace()); @@ -68,17 +68,17 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La // Paint the markup box LayoutPoint adjustedPaintOffset = paintOffset; adjustedPaintOffset.move(x() + m_logicalWidth - m_markupBox->x(), - y() + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->fontMetrics().ascent())); + y() + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(isFirstLineStyle())->fontMetrics().ascent())); m_markupBox->paint(paintInfo, adjustedPaintOffset, lineTop, lineBottom); } } IntRect EllipsisBox::selectionRect() { - RenderStyle* style = m_renderer->style(m_firstLine); + RenderStyle* style = m_renderer->style(isFirstLineStyle()); const Font& font = style->font(); // FIXME: Why is this always LTR? Fix by passing correct text run flags below. - return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x(), y() + root()->selectionTop()), root()->selectionHeight())); + return enclosingIntRect(font.selectionRectForText(RenderBlock::constructTextRun(renderer(), font, m_str, style, TextRun::AllowTrailingExpansion), IntPoint(x(), y() + root()->selectionTopAdjustedForPrecedingBlock()), root()->selectionHeightAdjustedForPrecedingBlock())); } void EllipsisBox::paintSelection(GraphicsContext* context, const LayoutPoint& paintOffset, RenderStyle* style, const Font& font) @@ -108,9 +108,9 @@ bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu // Hit test the markup box. if (m_markupBox) { - RenderStyle* style = m_renderer->style(m_firstLine); + RenderStyle* style = m_renderer->style(isFirstLineStyle()); LayoutUnit mtx = adjustedLocation.x() + m_logicalWidth - m_markupBox->x(); - LayoutUnit mty = adjustedLocation.y() + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->fontMetrics().ascent()); + LayoutUnit mty = adjustedLocation.y() + style->fontMetrics().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(isFirstLineStyle())->fontMetrics().ascent()); if (m_markupBox->nodeAtPoint(request, result, pointInContainer, LayoutPoint(mtx, mty), lineTop, lineBottom)) { renderer()->updateHitTestResult(result, pointInContainer - LayoutSize(mtx, mty)); return true; -- cgit v1.2.1