diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-08-04 14:22:08 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-08-04 14:22:08 -0700 |
commit | 2792e6b92c85f6a20d2203484d2aa72d6df78a22 (patch) | |
tree | 6f44d2c063c74979b761dcf93b348bc4c945200b | |
parent | 10c34b4139f0041a0dac539139c7dbee46595b2c (diff) | |
parent | 7b6d5776535672a588bdf68d374b7d1b03c21cec (diff) | |
download | external_webkit-2792e6b92c85f6a20d2203484d2aa72d6df78a22.zip external_webkit-2792e6b92c85f6a20d2203484d2aa72d6df78a22.tar.gz external_webkit-2792e6b92c85f6a20d2203484d2aa72d6df78a22.tar.bz2 |
Merge change 20004
* changes:
Another tweak for text wrap screen. We add a fixed padding when wrapping text around the screen width. If the block already has a padding, we should put it under consideration so that we won't add too much padding.
-rw-r--r-- | WebCore/rendering/bidi.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/WebCore/rendering/bidi.cpp b/WebCore/rendering/bidi.cpp index 24c2051..dc5176e 100644 --- a/WebCore/rendering/bidi.cpp +++ b/WebCore/rendering/bidi.cpp @@ -953,7 +953,16 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i if (!isConstrained) { int screenWidth = view()->frameView()->screenWidth(); if (screenWidth > 0 && width() > screenWidth) { - int maxWidth = screenWidth - 2 * ANDROID_FCTS_MARGIN_PADDING; + // 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; setWidth(min(width(), maxWidth)); m_minPrefWidth = min(m_minPrefWidth, maxWidth); m_maxPrefWidth = min(m_maxPrefWidth, maxWidth); |