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.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index 14e7dce..cf6514e 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -955,17 +955,11 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
}
if (!isConstrained) {
int screenWidth = view()->frameView()->screenWidth();
- if (screenWidth > 0 && width() > screenWidth) {
- // if the current padding is smaller, add an extra to make
- // it 2 * ANDROID_FCTS_MARGIN_PADDING so that the text won't
- // overlap with the screen edge. If the current padding is
- // negative, leave it alone.
- int padding = paddingLeft() + paddingRight();
- if (padding < 0 || padding >= 2 * ANDROID_FCTS_MARGIN_PADDING)
- padding = 0;
- else
- padding = 2 * ANDROID_FCTS_MARGIN_PADDING - padding;
- int maxWidth = screenWidth - padding;
+ int padding = paddingLeft() + paddingRight();
+ if (screenWidth > 0 && width() > (screenWidth + padding)) {
+ // limit the content width (width excluding padding) to be
+ // (screenWidth - 2 * ANDROID_FCTS_MARGIN_PADDING)
+ int maxWidth = screenWidth - 2 * ANDROID_FCTS_MARGIN_PADDING + padding;
setWidth(min(width(), maxWidth));
m_minPrefWidth = min(m_minPrefWidth, maxWidth);
m_maxPrefWidth = min(m_maxPrefWidth, maxWidth);