summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2010-01-14 16:22:56 -0800
committerGrace Kloba <klobag@google.com>2010-01-14 16:22:56 -0800
commit9f20cbf56188e83d4a3a631aba9607697ebac6c0 (patch)
treeece966f5cba7896f70ffc18d7550304ff1e56931 /WebCore
parentf48712a096831a3b85a5e18dabd44a541f6b4712 (diff)
downloadexternal_webkit-9f20cbf56188e83d4a3a631aba9607697ebac6c0.zip
external_webkit-9f20cbf56188e83d4a3a631aba9607697ebac6c0.tar.gz
external_webkit-9f20cbf56188e83d4a3a631aba9607697ebac6c0.tar.bz2
For mobile site, allow text wrap to screen if scale
is not same as screen width scale. Fix http://b/issue?id=2375232
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/rendering/RenderBlockLineLayout.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index 615a369..cc0fc58 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -40,6 +40,7 @@
#include "Settings.h"
#include "Text.h"
#include "HTMLNames.h"
+#include "WebViewCore.h"
#endif // ANDROID_LAYOUT
using namespace std;
@@ -861,8 +862,10 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
// will wrap text around screen width so that it doesn't need to scroll
// horizontally when reading a paragraph.
const Settings* settings = document()->settings();
- bool doTextWrap = settings && settings->viewportWidth() != 0 &&
- settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen;
+ android::WebViewCore* core = android::WebViewCore::getWebViewCore(view()->frameView());
+ bool doTextWrap = settings && (settings->viewportWidth() != 0
+ || fabs(core->scale() - core->screenWidthScale()) > 0.01)
+ && settings->layoutAlgorithm() == Settings::kLayoutFitColumnToScreen;
if (doTextWrap) {
int ta = style()->textAlign();
int dir = style()->direction();