summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/bridge/jni/jni_instance.h11
-rw-r--r--WebCore/rendering/bidi.cpp20
2 files changed, 23 insertions, 8 deletions
diff --git a/WebCore/bridge/jni/jni_instance.h b/WebCore/bridge/jni/jni_instance.h
index c2e0d9d..551b8e7 100644
--- a/WebCore/bridge/jni/jni_instance.h
+++ b/WebCore/bridge/jni/jni_instance.h
@@ -33,6 +33,12 @@
#include <JavaVM/jni.h>
+#if PLATFORM(ANDROID)
+namespace android {
+class WeakJavaInstance;
+}
+#endif
+
namespace JSC {
namespace Bindings {
@@ -46,6 +52,9 @@ friend class JavaArray;
friend class JavaField;
friend class JavaInstance;
friend class JavaMethod;
+#if PLATFORM(ANDROID)
+friend class android::WeakJavaInstance;
+#endif
protected:
JObjectWrapper(jobject instance);
@@ -92,7 +101,9 @@ protected:
virtual void virtualBegin();
virtual void virtualEnd();
+#if !PLATFORM(ANDROID) // Submit patch to webkit.org
private:
+#endif
JavaInstance(jobject instance, PassRefPtr<RootObject>);
RefPtr<JObjectWrapper> _instance;
diff --git a/WebCore/rendering/bidi.cpp b/WebCore/rendering/bidi.cpp
index 2f05e7f..212bf3c 100644
--- a/WebCore/rendering/bidi.cpp
+++ b/WebCore/rendering/bidi.cpp
@@ -859,19 +859,23 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
#ifdef ANDROID_LAYOUT
if (doTextWrap && !hasTextToWrap && o->isText()) {
Node* node = o->element();
- // as it is very common for sites to use a serial of <a> as
- // tabs, we don't force text to wrap if all the text are
- // short and within an <a> tag, or only separated by short
- // word like "|" or ";".
+ // as it is very common for sites to use a serial of <a> or
+ // <li> as tabs, we don't force text to wrap if all the text
+ // are short and within an <a> or <li> tag, and only separated
+ // by short word like "|" or ";".
if (node && node->isTextNode() &&
!static_cast<Text*>(node)->containsOnlyWhitespace()) {
int length = static_cast<Text*>(node)->length();
- if (length > 20 || (length >3 &&
- !node->parent()->hasTagName(HTMLNames::aTag)))
- hasTextToWrap = true;
+ // FIXME, need a magic number to decide it is too long to
+ // be a tab. Pick 25 for now as it covers around 160px
+ // (half of 320px) with the default font.
+ if (length > 25 || (length > 3 &&
+ (!node->parent()->hasTagName(HTMLNames::aTag) &&
+ !node->parent()->hasTagName(HTMLNames::liTag))))
+ hasTextToWrap = true;
}
}
-#endif
+#endif
}
o = bidiNext(this, o, 0, false, &endOfInline);
}