diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
commit | 79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch) | |
tree | 0287b1a69d84492c901e8bc820e635e7133809a0 /Source/WebCore/rendering/RootInlineBox.cpp | |
parent | 682ab87480e7757346802ce7f54cfdbdfeb2339e (diff) | |
download | qtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz |
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/WebCore/rendering/RootInlineBox.cpp')
-rw-r--r-- | Source/WebCore/rendering/RootInlineBox.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Source/WebCore/rendering/RootInlineBox.cpp b/Source/WebCore/rendering/RootInlineBox.cpp index bcbe7bd89..e410be009 100644 --- a/Source/WebCore/rendering/RootInlineBox.cpp +++ b/Source/WebCore/rendering/RootInlineBox.cpp @@ -122,7 +122,7 @@ bool RootInlineBox::lineCanAccommodateEllipsis(bool ltr, int blockEdge, int line return InlineFlowBox::canAccommodateEllipsis(ltr, blockEdge, ellipsisWidth); } -void RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, +float RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, InlineBox* markupBox) { // Create an ellipsis box. @@ -138,21 +138,26 @@ void RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, bool ltr, fl // FIXME: Do we need an RTL version of this? if (ltr && (x() + logicalWidth() + ellipsisWidth) <= blockRightEdge) { ellipsisBox->setX(x() + logicalWidth()); - return; + return logicalWidth() + ellipsisWidth; } // Now attempt to find the nearest glyph horizontally and place just to the right (or left in RTL) // of that glyph. Mark all of the objects that intersect the ellipsis box as not painting (as being // truncated). bool foundBox = false; - ellipsisBox->setX(placeEllipsisBox(ltr, blockLeftEdge, blockRightEdge, ellipsisWidth, foundBox)); + float truncatedWidth = 0; + float position = placeEllipsisBox(ltr, blockLeftEdge, blockRightEdge, ellipsisWidth, truncatedWidth, foundBox); + ellipsisBox->setX(position); + return truncatedWidth; } -float RootInlineBox::placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, bool& foundBox) +float RootInlineBox::placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox) { - float result = InlineFlowBox::placeEllipsisBox(ltr, blockLeftEdge, blockRightEdge, ellipsisWidth, foundBox); - if (result == -1) + float result = InlineFlowBox::placeEllipsisBox(ltr, blockLeftEdge, blockRightEdge, ellipsisWidth, truncatedWidth, foundBox); + if (result == -1) { result = ltr ? blockRightEdge - ellipsisWidth : blockLeftEdge; + truncatedWidth = blockRightEdge - blockLeftEdge; + } return result; } @@ -212,11 +217,11 @@ void RootInlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, #endif } -bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom) +bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestPoint& pointInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom) { if (hasEllipsisBox() && visibleToHitTesting()) { if (ellipsisBox()->nodeAtPoint(request, result, pointInContainer, accumulatedOffset, lineTop, lineBottom)) { - renderer()->updateHitTestResult(result, pointInContainer - toLayoutSize(accumulatedOffset)); + renderer()->updateHitTestResult(result, pointInContainer.point() - toLayoutSize(accumulatedOffset)); return true; } } @@ -231,6 +236,8 @@ void RootInlineBox::adjustPosition(float dx, float dy) m_lineBottom += blockDirectionDelta; m_lineTopWithLeading += blockDirectionDelta; m_lineBottomWithLeading += blockDirectionDelta; + if (hasEllipsisBox()) + ellipsisBox()->adjustPosition(dx, dy); } void RootInlineBox::childRemoved(InlineBox* box) |