diff options
| author | Shimeng (Simon) Wang <swang@google.com> | 2010-01-06 16:27:25 -0800 |
|---|---|---|
| committer | Shimeng (Simon) Wang <swang@google.com> | 2010-01-06 16:27:25 -0800 |
| commit | ef5ff0dbc68f344b819b75af5dc5bcc7bda8f411 (patch) | |
| tree | 628f0fc3b485c71093362c7f9bf8c462a152aef6 /WebCore/rendering | |
| parent | 072c35b9022c8ec79b25f7215f4fe092a8c244ce (diff) | |
| download | external_webkit-ef5ff0dbc68f344b819b75af5dc5bcc7bda8f411.zip external_webkit-ef5ff0dbc68f344b819b75af5dc5bcc7bda8f411.tar.gz external_webkit-ef5ff0dbc68f344b819b75af5dc5bcc7bda8f411.tar.bz2 | |
Disable "fit to screen" if line height < font size.
Bug: 2289376
modified: WebCore/rendering/RenderBlockLineLayout.cpp
Diffstat (limited to 'WebCore/rendering')
| -rw-r--r-- | WebCore/rendering/RenderBlockLineLayout.cpp | 5 |
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) || |
