diff options
author | Steve Block <steveblock@google.com> | 2011-05-18 13:36:51 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-24 15:38:28 +0100 |
commit | 2fc2651226baac27029e38c9d6ef883fa32084db (patch) | |
tree | e396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebCore/rendering/RenderText.cpp | |
parent | b3725cedeb43722b3b175aaeff70552e562d2c94 (diff) | |
download | external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2 |
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebCore/rendering/RenderText.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderText.cpp | 35 |
1 files changed, 28 insertions, 7 deletions
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 <wtf/AlwaysInline.h> #include <wtf/text/StringBuffer.h> +#include <wtf/unicode/CharacterNames.h> using namespace std; using namespace WTF; @@ -345,8 +346,12 @@ void RenderText::absoluteQuads(Vector<FloatQuad>& 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<FloatQuad>& 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<FloatQuad>& 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<const SimpleFontData*>* 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; |