summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderBlockLineLayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/RenderBlockLineLayout.cpp')
-rw-r--r--WebCore/rendering/RenderBlockLineLayout.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index 8517d6d..4d209de 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -852,6 +852,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
// and text align is auto, or justify or left in LTR, or right in RTL, we
// will wrap text around screen width so that it doesn't need to scroll
// horizontally when reading a paragraph.
+ // In case the line height is less than the font size, we skip
+ // the text wrapping since this will cause text overlapping.
const Settings* settings = document()->settings();
bool doTextWrap = settings && settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen;
if (doTextWrap) {
@@ -862,7 +864,10 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
// width as it may cause text to overlap.
bool positioned = isPositioned();
EFloat cssfloat = style()->floating();
+ const int lineHeight = style()->computedLineHeight();
+ const int fontSize = style()->fontSize();
doTextWrap = autowrap && !positioned &&
+ (fontSize <= lineHeight) &&
(((dir == LTR && cssfloat != FRIGHT) ||
(dir == RTL && cssfloat != FLEFT)) &&
((ta == TAAUTO) || (ta == JUSTIFY) ||