From 2fc2651226baac27029e38c9d6ef883fa32084db Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 18 May 2011 13:36:51 +0100 Subject: Merge WebKit at r78450: Initial merge by git. Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1 --- Source/WebCore/rendering/RenderText.cpp | 35 ++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'Source/WebCore/rendering/RenderText.cpp') diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp index 86b32d5..1b05af2 100644 --- a/Source/WebCore/rendering/RenderText.cpp +++ b/Source/WebCore/rendering/RenderText.cpp @@ -26,7 +26,6 @@ #include "RenderText.h" #include "AXObjectCache.h" -#include "CharacterNames.h" #include "EllipsisBox.h" #include "FloatQuad.h" #include "FontTranscoder.h" @@ -35,6 +34,7 @@ #include "Range.h" #include "RenderArena.h" #include "RenderBlock.h" +#include "RenderCombineText.h" #include "RenderLayer.h" #include "RenderView.h" #include "Text.h" @@ -45,6 +45,7 @@ #include "break_lines.h" #include #include +#include using namespace std; using namespace WTF; @@ -345,8 +346,12 @@ void RenderText::absoluteQuads(Vector& quads, ClippingOption option) // Shorten the width of this text box if it ends in an ellipsis. IntRect ellipsisRect = (option == ClipToEllipsis) ? ellipsisRectForBox(box, 0, textLength()) : IntRect(); - if (!ellipsisRect.isEmpty()) - boundaries.setWidth(ellipsisRect.right() - boundaries.x()); + if (!ellipsisRect.isEmpty()) { + if (style()->isHorizontalWritingMode()) + boundaries.setWidth(ellipsisRect.maxX() - boundaries.x()); + else + boundaries.setHeight(ellipsisRect.maxY() - boundaries.y()); + } quads.append(localToAbsoluteQuad(FloatRect(boundaries))); } } @@ -374,8 +379,13 @@ void RenderText::absoluteQuadsForRange(Vector& quads, unsigned start, IntRect r(box->calculateBoundaries()); if (useSelectionHeight) { IntRect selectionRect = box->selectionRect(0, 0, start, end); - r.setHeight(selectionRect.height()); - r.setY(selectionRect.y()); + if (box->isHorizontal()) { + r.setHeight(selectionRect.height()); + r.setY(selectionRect.y()); + } else { + r.setWidth(selectionRect.width()); + r.setX(selectionRect.x()); + } } quads.append(localToAbsoluteQuad(FloatRect(r))); } else { @@ -384,8 +394,13 @@ void RenderText::absoluteQuadsForRange(Vector& quads, unsigned start, if (r.height()) { if (!useSelectionHeight) { // change the height and y position because selectionRect uses selection-specific values - r.setHeight(box->logicalHeight()); - r.setY(box->y()); + if (box->isHorizontal()) { + r.setHeight(box->logicalHeight()); + r.setY(box->y()); + } else { + r.setWidth(box->logicalHeight()); + r.setX(box->x()); + } } quads.append(localToAbsoluteQuad(FloatRect(r))); } @@ -547,6 +562,12 @@ IntRect RenderText::localCaretRect(InlineBox* inlineBox, int caretOffset, int* e ALWAYS_INLINE int RenderText::widthFromCache(const Font& f, int start, int len, int xPos, HashSet* fallbackFonts, GlyphOverflow* glyphOverflow) const { + if (style()->hasTextCombine()) { + const RenderCombineText* combineText = toRenderCombineText(this); + if (combineText->isCombined()) + return combineText->combinedTextWidth(f); + } + if (f.isFixedPitch() && !f.isSmallCaps() && m_isAllASCII) { int monospaceCharacterWidth = f.spaceWidth(); int tabWidth = allowTabs() ? monospaceCharacterWidth * 8 : 0; -- cgit v1.1