summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderBlockLineLayout.cpp
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-11-11 17:09:10 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-11 17:09:10 -0800
commitdc15689bee9b47fbe177511e969153f247bf3670 (patch)
tree6fc57300cbdb128cb09b31814f623598962252a5 /WebCore/rendering/RenderBlockLineLayout.cpp
parent46c1ee2072ee97ac3f59e265676f03e2229a4ad1 (diff)
parenta56054997e46fcd04621cc67d650b6daf85f7b59 (diff)
downloadexternal_webkit-dc15689bee9b47fbe177511e969153f247bf3670.zip
external_webkit-dc15689bee9b47fbe177511e969153f247bf3670.tar.gz
external_webkit-dc15689bee9b47fbe177511e969153f247bf3670.tar.bz2
am a5605499: Changing fit column to screen to exclude the padding.
Merge commit 'a56054997e46fcd04621cc67d650b6daf85f7b59' into eclair-mr2 * commit 'a56054997e46fcd04621cc67d650b6daf85f7b59': Changing fit column to screen to exclude the padding.
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);